From: Andrew Morton <akpm@linux-foundation.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hugetlbfs: simplify destroying inode
Date: Wed, 20 Apr 2011 09:38:23 -0700 [thread overview]
Message-ID: <20110420093823.38f1c2fe.akpm@linux-foundation.org> (raw)
In-Reply-To: <BANLkTins3c6r0z-WR8PWrVvYa5OdOZ1BGg@mail.gmail.com>
On Mon, 4 Apr 2011 11:36:56 +0800
Hillf Danton <dhillf@gmail.com> wrote:
> Just before reclaimed by the hugetlbfs inode cache, little difference
> could be made by initializing the list head of the dentry member of
> vfs inode, thus the operation of initialization could be removed to
> simplify the destroy of hugetlbfs inode.
>
> Signed-off-by: Hillf Danton <gmail.com>
> ---
>
> --- a/fs/hugetlbfs/inode.c 2011-03-30 03:09:48.000000000 +0800
> +++ b/fs/hugetlbfs/inode.c 2011-04-04 11:27:30.000000000 +0800
> @@ -665,7 +665,6 @@ static struct inode *hugetlbfs_alloc_ino
> static void hugetlbfs_i_callback(struct rcu_head *head)
> {
> struct inode *inode = container_of(head, struct inode, i_rcu);
> - INIT_LIST_HEAD(&inode->i_dentry);
> kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode));
> }
How well was this tested?
hugetlbfs_inode_cachep has a slab constructor,
init_once()->inode_init_once(). The slab protocol requires that
objects be returned to the cache in the same state as that which the
constructor creates. (It's a bit weird and it would probably be faster
and certainly saner if the ctor were run by kmem_cache_alloc()).
inode_init_once() does INIT_LIST_HEAD(&inode->i_dentry), so objects
should be returned to the cache in that state. If no other code was
already reliably reinitialising ->i_dentry, the patch will add a bug.
next prev parent reply other threads:[~2011-04-20 16:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 3:36 Hillf Danton
2011-04-20 16:38 ` Andrew Morton [this message]
2011-04-21 12:44 ` Hillf Danton
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=20110420093823.38f1c2fe.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dhillf@gmail.com \
--cc=linux-kernel@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
Powered by JetHome