diff mbox

[OPW,kernel,v2,1/3] fs: btrfs: Pack struct btrfs_delayed_ref_node

Message ID 0b0ed1b28767a398a46a31d570d6cb73e78c369c.1382439014.git.rashika.kheria@gmail.com
State New, archived
Headers show

Commit Message

Rashika Oct. 22, 2013, 10:51 a.m. UTC
Packed the structure btrfs_delayed_ref_node in delayed-ref.h to eliminate holes detected
by pahole in order to reduce space wastage.

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---
 fs/btrfs/delayed-ref.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Rusty Russell Oct. 24, 2013, 1:54 a.m. UTC | #1
Rashika Kheria <rashika.kheria@gmail.com> writes:
> Packed the structure btrfs_delayed_ref_node in delayed-ref.h to eliminate holes detected
> by pahole in order to reduce space wastage.
>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>

I'm confused.  This looks like you swapped the 'int ref_mod' and
'atomic_t refs' fields.  Yet both should be sizeof(int), so I don't see
how that changes the layout?

Thanks,
Rusty.

> ---
>  fs/btrfs/delayed-ref.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
> index 70b962c..a6fadd1 100644
> --- a/fs/btrfs/delayed-ref.h
> +++ b/fs/btrfs/delayed-ref.h
> @@ -36,9 +36,6 @@ struct btrfs_delayed_ref_node {
>  	/* seq number to keep track of insertion order */
>  	u64 seq;
>  
> -	/* ref count on this data structure */
> -	atomic_t refs;
> -
>  	/*
>  	 * how many refs is this entry adding or deleting.  For
>  	 * head refs, this may be a negative number because it is keeping
> @@ -50,6 +47,9 @@ struct btrfs_delayed_ref_node {
>  	 */
>  	int ref_mod;
>  
> +	/* ref count on this data structure */
> +	atomic_t refs;
> +
>  	unsigned int action:8;
>  	unsigned int type:8;
>  	/* is this node still in the rbtree? */
> -- 
> 1.7.9.5
>
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Rashika Oct. 24, 2013, 1:04 p.m. UTC | #2
On Thu, Oct 24, 2013 at 7:24 AM, Rusty Russell <rusty@rustcorp.com.au>wrote:

> Rashika Kheria <rashika.kheria@gmail.com> writes:
> > Packed the structure btrfs_delayed_ref_node in delayed-ref.h to
> eliminate holes detected
> > by pahole in order to reduce space wastage.
> >
> > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
>
> I'm confused.  This looks like you swapped the 'int ref_mod' and
> 'atomic_t refs' fields.  Yet both should be sizeof(int), so I don't see
> how that changes the layout?
>
> Thanks,
> Rusty.
>
>
Hi,

Sorry but this structure does not require any transformations.
Sorry for the inconvenience.
Please ignore this patch and kindly review other two in the series.

Thanks,
Rashika Oct. 24, 2013, 1:13 p.m. UTC | #3
On Thu, Oct 24, 2013 at 6:34 PM, Rashika Kheria <rashika.kheria@gmail.com>wrote:

>
>
>
> On Thu, Oct 24, 2013 at 7:24 AM, Rusty Russell <rusty@rustcorp.com.au>wrote:
>
>> Rashika Kheria <rashika.kheria@gmail.com> writes:
>> > Packed the structure btrfs_delayed_ref_node in delayed-ref.h to
>> eliminate holes detected
>> > by pahole in order to reduce space wastage.
>> >
>> > Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
>>
>> I'm confused.  This looks like you swapped the 'int ref_mod' and
>> 'atomic_t refs' fields.  Yet both should be sizeof(int), so I don't see
>> how that changes the layout?
>>
>> Thanks,
>> Rusty.
>>
>>
> Hi,
>
> Sorry but this structure does not require any transformations.
> Sorry for the inconvenience.
> Please ignore this patch and kindly review other two in the series.
>
> Thanks,
>
>
>
Also please kindly review
https://groups.google.com/forum/#!searchin/opw-kernel/btrfs/opw-kernel/JXD1BakBy3o/BWnjgCgOQ1AJ



Thanks,
diff mbox

Patch

diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index 70b962c..a6fadd1 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -36,9 +36,6 @@  struct btrfs_delayed_ref_node {
 	/* seq number to keep track of insertion order */
 	u64 seq;
 
-	/* ref count on this data structure */
-	atomic_t refs;
-
 	/*
 	 * how many refs is this entry adding or deleting.  For
 	 * head refs, this may be a negative number because it is keeping
@@ -50,6 +47,9 @@  struct btrfs_delayed_ref_node {
 	 */
 	int ref_mod;
 
+	/* ref count on this data structure */
+	atomic_t refs;
+
 	unsigned int action:8;
 	unsigned int type:8;
 	/* is this node still in the rbtree? */