All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Nick Piggin <npiggin@suse.de>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [rfc][patch] fs: turn iprune_mutex into rwsem
Date: Sun, 16 Aug 2009 16:11:59 -0600	[thread overview]
Message-ID: <20090816221159.GR5931@webber.adilger.int> (raw)
In-Reply-To: <20090815195742.GA14842@infradead.org>

On Aug 15, 2009  15:57 -0400, Christoph Hellwig wrote:
> On Fri, Aug 14, 2009 at 05:25:05PM +0200, Nick Piggin wrote:
> > Now I think the main problem is having the filesystem block (and do IO
> > in inode reclaim. The problem is that this doesn't get accounted well
> > and penalizes a random allocator with a big latency spike caused by
> > work generated from elsewhere.
> > 
> > I think the best idea would be to avoid this. By design if possible,
> > or by deferring the hard work to an asynchronous context. If the latter,
> > then the fs would probably want to throttle creation of new work with
> > queue size of the deferred work, but let's not get into those details.
> 
> I don't really see a good way to avoid this.  For any filesystem that
> does some sort of preallocations we need to drop them in ->clear_inode.

One of the problems I've seen in the past is that filesystem memory reclaim
(in particular dentry/inode cleanup) cannot happen within filesystems due
to potential deadlocks.  This is particularly problematic when there is a
lot of memory pressure from within the kernel and very little from userspace
(e.g. updatedb or find).

However, many/most inodes/dentries in the filesystem could be discarded
quite easily and would not deadlock the system.  I wonder if it makes
sense to keep a mask in the inode that the filesystem could set that
determines whether it is safe to clean up the inode even though __GFP_FS
is not set?  That would potentially allow e.g. shrink_icache_memory()
to free a large number of "non-tricky" inodes if needed (e.g. ones without
locks/preallocation/expensive cleanup).

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


WARNING: multiple messages have this Message-ID (diff)
From: Andreas Dilger <adilger@sun.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Nick Piggin <npiggin@suse.de>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [rfc][patch] fs: turn iprune_mutex into rwsem
Date: Sun, 16 Aug 2009 16:11:59 -0600	[thread overview]
Message-ID: <20090816221159.GR5931@webber.adilger.int> (raw)
In-Reply-To: <20090815195742.GA14842@infradead.org>

On Aug 15, 2009  15:57 -0400, Christoph Hellwig wrote:
> On Fri, Aug 14, 2009 at 05:25:05PM +0200, Nick Piggin wrote:
> > Now I think the main problem is having the filesystem block (and do IO
> > in inode reclaim. The problem is that this doesn't get accounted well
> > and penalizes a random allocator with a big latency spike caused by
> > work generated from elsewhere.
> > 
> > I think the best idea would be to avoid this. By design if possible,
> > or by deferring the hard work to an asynchronous context. If the latter,
> > then the fs would probably want to throttle creation of new work with
> > queue size of the deferred work, but let's not get into those details.
> 
> I don't really see a good way to avoid this.  For any filesystem that
> does some sort of preallocations we need to drop them in ->clear_inode.

One of the problems I've seen in the past is that filesystem memory reclaim
(in particular dentry/inode cleanup) cannot happen within filesystems due
to potential deadlocks.  This is particularly problematic when there is a
lot of memory pressure from within the kernel and very little from userspace
(e.g. updatedb or find).

However, many/most inodes/dentries in the filesystem could be discarded
quite easily and would not deadlock the system.  I wonder if it makes
sense to keep a mask in the inode that the filesystem could set that
determines whether it is safe to clean up the inode even though __GFP_FS
is not set?  That would potentially allow e.g. shrink_icache_memory()
to free a large number of "non-tricky" inodes if needed (e.g. ones without
locks/preallocation/expensive cleanup).

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2009-08-16 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14 15:25 [rfc][patch] fs: turn iprune_mutex into rwsem Nick Piggin
2009-08-14 15:25 ` Nick Piggin
2009-08-14 22:58 ` Andrew Morton
2009-08-14 23:39   ` Jan Kara
2009-08-14 23:39     ` Jan Kara
2009-08-15  4:45   ` Nick Piggin
2009-08-15  4:45     ` Nick Piggin
2009-08-15  5:14   ` Nick Piggin
2009-08-15  5:14     ` Nick Piggin
2009-08-15 19:57 ` Christoph Hellwig
2009-08-15 19:57   ` Christoph Hellwig
2009-08-16 10:05   ` Nick Piggin
2009-08-16 10:05     ` Nick Piggin
2009-08-16 22:11   ` Andreas Dilger [this message]
2009-08-16 22:11     ` Andreas Dilger
2009-08-17  6:34     ` Nick Piggin

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=20090816221159.GR5931@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    /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.