From: Miao Xie <miaox@cn.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH V3] btrfs: implement delayed inode items operation
Date: Wed, 09 Mar 2011 13:40:28 +0800 [thread overview]
Message-ID: <4D7712CC.9030807@cn.fujitsu.com> (raw)
In-Reply-To: <20110308165640.GN17108@twin.jikos.cz>
On tue, 8 Mar 2011 17:56:40 +0100, David Sterba wrote:
> Hi,
>
> I did some testing, the speedup results match yours. I was watching kmem cache
> stats of the delayed_node, seem to behave well. Increase and decrease of
> number of active objects, from 3 to about ~400 (creat_unlink 50000) and went
> back to initial values after a few seconds. On my setup, there are 13
> delayed_node objects per page, which gives a good chance of quick allocation of
> the spare objects.
>
> Size of the delayed_node is 304 bytes, which would slack 208 bytes (hitting the
> nearest kmalloc bucket of 512 bytes) per node.
>
> So to justify the recommendation of kmem_cache use.
>
> I was thinking about reducing size of the structure by a few bytes, to 292
> bytes. In this case it would make 14 objects per slab page. There are padding
> holes after
> * atomic_t count (4 bytes)
> * bool inode_dirty (2 bytes)
>
> you may want to reorder the fileds like this:
> * [no change up to inode_item]
> * index_cnt
> * refs
> * count
> * the bool fields
Thanks for your advice. But AFAIK, reordering the fields like what you said can not
reduce the space of delayed_nodes, because a hole is placed on the end to make the
structure big enough to pack tightly into arrays and maintain proper alignment. So
although we reorder the fields, the size of delayed_node is still 304 bytes.
> Still needed to reduce by 7 from 304-6=298. Does not seem to be possible, the
> bool flags provide only 1 byte. Under these conditions, I suggest to make the
> bool fields int again to reduce instruction count which manage these flags.
> Compiler did not make them int automatically (altough it is free to do it).
Sorry, I don't understand what you said above clearly, Did you mean
we can not access bool variables by one instruction?
Thanks
Miao
>
> dave
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-03-09 5:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 6:06 [PATCH V3] btrfs: implement delayed inode items operation Miao Xie
2011-03-05 7:01 ` Itaru Kitayama
2011-03-06 23:25 ` Tsutomu Itoh
2011-03-07 1:57 ` Miao Xie
2011-03-10 3:07 ` Itaru Kitayama
2011-03-08 16:56 ` David Sterba
2011-03-09 5:40 ` Miao Xie [this message]
2011-03-11 15:24 ` David Sterba
-- strict thread matches above, loose matches on Subject: below --
2011-03-09 15:03 Itaru Kitayama
2011-03-10 6:21 ` Miao Xie
2011-03-16 9:48 ` Itaru Kitayama
2011-03-16 14:24 ` Miao Xie
2011-03-16 17:49 ` Chris Mason
2011-03-17 1:37 ` Itaru Kitayama
2011-03-18 3:37 ` Miao Xie
2011-03-18 8:59 ` Itaru Kitayama
2011-03-18 9:18 ` 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=4D7712CC.9030807@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).