linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Aristeu Rozanski <aris@redhat.com>
Cc: Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	Li Zefan <lizefan@huawei.com>, Hillf Danton <dhillf@gmail.com>,
	Lennart Poettering <lpoetter@redhat.com>
Subject: Re: [PATCH v6 1/4] xattr: extract simple_xattr code from tmpfs
Date: Wed, 22 Aug 2012 13:25:06 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.00.1208221312540.1909@eggly.anvils> (raw)
In-Reply-To: <20120822200746.GD16951@redhat.com>

On Wed, 22 Aug 2012, Aristeu Rozanski wrote:
> On Mon, Aug 20, 2012 at 09:47:15PM -0700, Hugh Dickins wrote:
> > On Mon, 20 Aug 2012, Aristeu Rozanski wrote:
> > > On Mon, Aug 20, 2012 at 12:10:09AM -0700, Hugh Dickins wrote:
> > > > Yes, it looks nice to me.  I might have preferred more as inlines in
> > > > the header file to lower the slight init/evict overhead, and I don't
> > > > see why __simple_xattr_set() isn't using simple_xattr_alloc() in the
> > > > same way that shmem_xattr_set() used shmem_xattr_alloc().  But none
> > > > of that matters:
> > > > 
> > > > Acked-by: Hugh Dickins <hughd@google.com>
> > > 
> > > I can submit additional patches to fix these. What functions you want
> > > inlined?
> > 
> > Oh, thank you.  I was thinking that it's uncommon for tmpfs files to
> > have xattrs (and the same probably true of other filesystems), so it's
> > best to minimize xattrs impact on shared paths.  If simple_xattrs_init()
> > and simple_xattrs_free() can be static inline functions in linux/xattr.h,
> > that would be nice.
> 
> ok, done. and since Tejun is waiting for those before integrating, I'll
> merge them in the original patches and resubmit everything.

Thanks.

> 
> > Probably more important would be to remove spin_lock() and spin_unlock()
> > (and INIT_LIST_HEAD) from simple_xattrs_free() - those are unnecessary
> > in shmem_evict_inode(), and wouldn't they be unnecessary whenever
> > simple_xattrs_free() gets called?
> 
> Removing INIT_LIST_HEAD() it's possible by actually unlinking each xattr
> inside the loop before freeing them. still, it'll have to check if the list is
> empty or not, which might end up being the same?
> 
> About the locking, I'm not sure, I'm investigating it.

I think we have a misunderstanding.

INIT_LIST_HEAD() is not expensive, I just meant to remove it because
I thought it unnecessary by that point.

Do you envisage anywhere that would call simple_xattrs_free() except
a filesystem's evict_inode()?

By that point, the inode is on its way out of the system: nothing
much (yes, I am being a bit vague there ;) can get to it any more,
there's no need to reinitialize the list head and there's no need for
locking, because nothing else can be playing with those xattrs now.

If I'm wrong, then the current shmem_evict_inode() is already wrong
not to be locking there.

Would renaming simple_xattrs_free() to simple_xattrs_evict() help?

Hugh

  reply	other threads:[~2012-08-22 20:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 17:44 [PATCH v6 0/4] cgroup: add xattr support aris
2012-08-16 17:44 ` [PATCH v6 1/4] xattr: extract simple_xattr code from tmpfs aris
2012-08-16 19:58   ` Tejun Heo
2012-08-20  7:10     ` Hugh Dickins
2012-08-20 19:00       ` Aristeu Rozanski
2012-08-21  4:47         ` Hugh Dickins
2012-08-22 20:07           ` Aristeu Rozanski
2012-08-22 20:25             ` Hugh Dickins [this message]
2012-08-22 20:55               ` Aristeu Rozanski
2012-08-16 17:44 ` [PATCH v6 2/4] cgroup: revise how we re-populate root directory aris
2012-08-16 17:44 ` [PATCH v6 3/4] cgroup: add xattr support aris
2012-08-16 20:00   ` Tejun Heo
2012-08-21 21:43     ` Lennart Poettering
2012-08-21 21:48       ` Tejun Heo
2012-08-21 23:29         ` Hugh Dickins
2012-08-23 19:44           ` Tejun Heo
2012-08-23 19:58             ` Aristeu Rozanski
2012-08-24  0:02       ` Eric W. Biederman
2012-08-16 17:44 ` [PATCH v6 4/4] cgroup: rename subsys_bits to subsys_mask aris

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=alpine.LSU.2.00.1208221312540.1909@eggly.anvils \
    --to=hughd@google.com \
    --cc=aris@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=lpoetter@redhat.com \
    --cc=tj@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).