From: Miao Xie <miaox@cn.fujitsu.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 5/6] Btrfs: use flags instead of the bool variants in delayed node
Date: Fri, 03 Jan 2014 17:27:51 +0800 [thread overview]
Message-ID: <52C68297.80707@cn.fujitsu.com> (raw)
In-Reply-To: <20140102174955.GO6498@twin.jikos.cz>
On Thu, 2 Jan 2014 18:49:55 +0100, David Sterba wrote:
> On Thu, Dec 26, 2013 at 01:07:05PM +0800, Miao Xie wrote:
>> +#define BTRFS_DELAYED_NODE_IN_LIST 0
>> +#define BTRFS_DELAYED_NODE_INODE_DIRTY 1
>> +
>> struct btrfs_delayed_node {
>> u64 inode_id;
>> u64 bytes_reserved;
>> @@ -65,8 +68,7 @@ struct btrfs_delayed_node {
>> struct btrfs_inode_item inode_item;
>> atomic_t refs;
>> u64 index_cnt;
>> - bool in_list;
>> - bool inode_dirty;
>> + unsigned long flags;
>> int count;
>> };
>
> What's the reason to do that? Replacing 2 bools with a bitfield
> does not seem justified, not from saving memory, nor from a performance
> gain side. Also some of the bit operations imply the lock instruction
> prefix so this affects the surrounding items as well.
>
> I don't think this is needed, unless you have further plans with the
> flags item.
Yes, I introduced a flag in the next patch.
And we can not common bit operation here because we hold different locks when we change
those bits, we have to use the bit operations which implies the lock instruction.
Thanks
Miao
next prev parent reply other threads:[~2014-01-03 9:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-26 5:07 [PATCH v2 1/6] Btrfs: remove residual code in delayed inode async helper Miao Xie
2013-12-26 5:07 ` [PATCH v2 2/6] Btrfs: don't run delayed nodes again after all nodes flush Miao Xie
2013-12-26 5:07 ` [PATCH v2 3/6] Btrfs: cleanup code of btrfs_balance_delayed_items() Miao Xie
2013-12-26 5:07 ` [PATCH v2 4/6] Btrfs: remove btrfs_end_transaction_dmeta() Miao Xie
2013-12-26 5:07 ` [PATCH v2 5/6] Btrfs: use flags instead of the bool variants in delayed node Miao Xie
2014-01-02 17:49 ` David Sterba
2014-01-03 9:27 ` Miao Xie [this message]
2014-01-03 18:36 ` David Sterba
2014-01-07 3:59 ` Miao Xie
2014-01-07 21:11 ` David Sterba
2013-12-26 5:07 ` [PATCH v2 6/6] Btrfs: introduce the delayed inode ref deletion for the single link inode Miao Xie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52C68297.80707@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.