cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Hillf Danton <dhillf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Lennart Poettering
	<lpoetter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v6 1/4] xattr: extract simple_xattr code from tmpfs
Date: Wed, 22 Aug 2012 16:55:57 -0400	[thread overview]
Message-ID: <20120822205556.GE16951@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1208221312540.1909-fupSdm12i1nKWymIFiNcPA@public.gmane.org>

On Wed, Aug 22, 2012 at 01:25:06PM -0700, Hugh Dickins wrote:
> > > 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.

ah, I see.

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

cgroup does it differently and it's called in d_iput() path (see cgroup_diput),
because it needs to selectively remove files upon remount.

> 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.

I agree with you. That's why I'm looking into it because I'm pretty sure
I removed it at some point in the past and decided to put it back after
investigating the easily reproducible oops. Sadly I managed to forget
the analisys I did at the time.

-- 
Aristeu

  parent reply	other threads:[~2012-08-22 20:55 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
     [not found]   ` <20120816174453.507922179-cd6kKtb6gxi3M6m420IelR/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2012-08-16 19:58     ` Tejun Heo
     [not found]       ` <20120816195831.GF24861-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-20  7:10         ` Hugh Dickins
     [not found]           ` <alpine.LSU.2.00.1208192356580.24824-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2012-08-20 19:00             ` Aristeu Rozanski
     [not found]               ` <20120820190039.GR25353-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-21  4:47                 ` Hugh Dickins
     [not found]                   ` <alpine.LSU.2.00.1208202122470.1286-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2012-08-22 20:07                     ` Aristeu Rozanski
     [not found]                       ` <20120822200746.GD16951-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-22 20:25                         ` Hugh Dickins
     [not found]                           ` <alpine.LSU.2.00.1208221312540.1909-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2012-08-22 20:55                             ` Aristeu Rozanski [this message]
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
     [not found]     ` <20120816200006.GG24861-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-21 21:43       ` Lennart Poettering
     [not found]         ` <50340110.50607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-21 21:48           ` Tejun Heo
2012-08-21 23:29             ` Hugh Dickins
     [not found]               ` <alpine.LSU.2.00.1208211606580.2383-fupSdm12i1nKWymIFiNcPA@public.gmane.org>
2012-08-23 19:44                 ` Tejun Heo
     [not found]                   ` <20120823194423.GC14962-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
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-H+wXaHxf7aLQT0dZR+AlfA

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=20120822205556.GE16951@redhat.com \
    --to=aris-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dhillf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=lpoetter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).