mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Balbir Singh <balbir@in.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Per-superblock unused dentry LRU lists.
Date: Wed, 24 May 2006 18:15:45 +1000	[thread overview]
Message-ID: <20060524081545.GI7418631@melbourne.sgi.com> (raw)
In-Reply-To: <20060524070605.GA7743@in.ibm.com>

On Wed, May 24, 2006 at 12:36:06PM +0530, Balbir Singh wrote:
> > > You can use trylock. Please see the patches in -mm to fix the umount
> > > race.
> > 
> > I'm not sure what unmount race you are talking about.
> > 
> > AFAICT, there is no race here - we've got a reference on the superblock so  it
> > can't go away and the lru list is protected by the dcache_lock, so there's
> > nothing else we can race with. However, we can deadlock by taking the
> > s_umount lock here. So why even bother to try to take the lock when we don't
> > actually need it?
> 
> Please read the thread at http://lkml.org/lkml/2006/4/2/101.

Ok, thanks for the pointer. it's a completely differnt sort of race you're
talking about ;)

I'll have to look at the -mm tree and how the locking is different
there before commenting further.

> > > > +		if (__put_super_and_need_restart(sb) && count)
> > > > +			goto restart;
> > > 
> > > Comment please.
> > 
> > I'm not sure what a comment needs to explain that the code doesn't.
> > Which bit do you think needs commenting?
> 
> I was referring to the __put_super_and_need_restart() part.

Ok. i didn't think it necessary given it's use in several other places
and the comment at the head of __put_super_and_need_restart() explain
exactly what it does and when to use it. Comment added anyway.

> > > This should not be required with per super-block dentries. The only
> > > reason, I think we moved dentries to the tail is to club all entries
> > > from the sb together (to free them all at once).
> > 
> > I think we still need to do that. We get called in contexts that aren't
> > related to unmounting, so we want these dentries to be the first
> > to be reclaimed from that superblock when we next call prune_dcache().
> 
> Is it? I quickly checked the callers of shrink_dcache_sb() and all of
> them seem to be mount related. shrink_dcache_parent() is another story.
> Am I missing something? Code reference will be particularly useful.

I thought you were referring to shrink_dcache_parent(). At least, I
was, and the hunk of diff that your comment followed after was from
select_parent(). Please correct me if I'm wrong, but I think we're
agreeing that it's doing the right thing in select_parent().

The modified shrink_dcache_sb() doesn't do do any list moving at all,
it simply frees all the dentries on the superblock in a single pass.....

Cheers,

Dave.
-- 
Dave Chinner
R&D Software Enginner
SGI Australian Software Group

  reply	other threads:[~2006-05-24  8:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24  1:24 David Chinner
2006-05-24  1:44 ` Randy.Dunlap
2006-05-24  1:48   ` David Chinner
2006-05-24  1:59 ` Arjan van de Ven
2006-05-24  4:01   ` David Chinner
2006-05-24  4:23     ` Arjan van de Ven
2006-05-24  5:47       ` David Chinner
2006-05-24  5:02 ` Balbir Singh
2006-05-24  6:19   ` David Chinner
2006-05-24  7:06     ` Balbir Singh
2006-05-24  8:15       ` David Chinner [this message]
2006-05-24  8:28         ` Balbir Singh

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=20060524081545.GI7418631@melbourne.sgi.com \
    --to=dgc@sgi.com \
    --cc=balbir@in.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®