All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: David Chinner <dgc@sgi.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] A deadlock free and best try version of drop_caches()
Date: Thu, 20 Mar 2008 20:28:07 +0800	[thread overview]
Message-ID: <406016111.11683@ustc.edu.cn> (raw)
Message-ID: <E1JcJsN-0005K0-RW@localhost> (raw)
In-Reply-To: <20080319220318.GK155407@sgi.com>

On Thu, Mar 20, 2008 at 09:03:18AM +1100, David Chinner wrote:
> On Wed, Mar 19, 2008 at 07:27:29PM +0800, Fengguang Wu wrote:
> > On Tue, Mar 18, 2008 at 10:28:44PM +1100, David Chinner wrote:
> > > Looks like everything is backed up on the inode_lock.  Why? Looks
> > > like drop_pagecache_sb() is doing something ..... suboptimal.
> ......
> > > Anyone know the reason why drop_pagecache_sb() uses such a brute-force
> > > mechanism to free up clean page cache pages?
> > 
> > Because extensive use of it(out of testings) is discouraged? ;-)
> > 
> > I have been running a longer but safer version, let's merge it?
> 
> So you walk the inode hash to find inodes? Seems like a nice idea on
> the surface.... Won't it need to hold the iprune_mutex to prevent
> races with prune_icache() and invalidate_list()?

Oh, I didn't notice iprune_mutex :-/

> Hmmmm - what about unhashed inodes? We'll never see them with this
> method of traversal. I ask because I'm working on some prototype
> patches for XFS that avoid using the inode hash altogether and drive
> inode lookup from the multitude of radix trees we have per filesystem
> (for parallelised and lockless inode lookup).
> 
> The above scanning method would not work at all with that sort of
> filesystem structure. Perhaps combining the bulk get/put with Jan's
> get/put method for walking the sb inode list would be sufficient?

You mean to move __invalidate_mapping_pages() out of inode_lock in
drop_pagecache_sb()? Sounds reasonable.

BTW, I noticed the following comments on locking order are outdated:

filemap.c 
 *  ->inode_lock
 *    ->sb_lock                 (fs/fs-writeback.c)

rmap.c 
 *                 sb_lock (within inode_lock in fs/fs-writeback.c)

They are invalidated by this patch:
http://git.kernel.org/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commit;h=03da8814512f55441b9bd57c1ceddd28fbcf59ba
[PATCH] Rearrangement of inode_lock in writeback_inodes()

[...] It narrows down use of inode_lock and removes unneccassary
nesting of sb_lock and inode_lock. [...]

Thank you,
Fengguang


  reply	other threads:[~2008-03-20 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 11:28 BUG: drop_pagecache_sb vs kjournald lockup David Chinner
2008-03-18 11:28 ` David Chinner
2008-03-18 13:43 ` Jan Kara
2008-03-18 20:46   ` David Chinner
2008-03-19 10:08     ` Jan Kara
2008-03-19 12:17       ` David Chinner
     [not found] ` <E1JbwS9-0008Gq-7h@localhost>
2008-03-19 22:03   ` [PATCH] A deadlock free and best try version of drop_caches() David Chinner
2008-03-20 12:28     ` Fengguang Wu [this message]
2008-03-20 12:28       ` Fengguang Wu

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=406016111.11683@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=dgc@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.