From: Christoph Lameter <cl@linux-foundation.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: penberg@cs.helsinki.fi, nickpiggin@yahoo.com.au,
hugh@veritas.com, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: SLUB defrag pull request?
Date: Mon, 20 Oct 2008 13:22:42 -0500 [thread overview]
Message-ID: <48FCCC72.5020202@linux-foundation.org> (raw)
In-Reply-To: <E1Krz4o-0002Fi-Pu@pomaz-ex.szeredi.hu>
Miklos Szeredi wrote:
> On Mon, 20 Oct 2008, Christoph Lameter wrote:
>>>> kick_inodes() only works on inodes that first have undergone
>>>> get_inodes() where we establish a refcount under inode_lock(). The final
>>>> cleanup in kick_inodes() is done under iprune_mutex. You are looking at
>>>> the loop that does writeback and invalidates attached dentries. This can
>>>> fail for various reasons.
>>> Yes, but I'm not at all sure that calling remove_inode_buffers() or
>>> invalidate_mapping_pages() is OK on a live inode. They should be done
>>> after checking the refcount, just like prune_icache() does.
>> Dont we do the same on a truncate?
>
> Yes, with i_mutex and i_alloc_sem held.
There is another call to invalidate_mapping_pages() in prune_icache (that is
where this code originates). No i_mutex and i_alloc. Only iprune_mutex held
and that seems to be for the protection of the list. So just checking
inode->i_count would do the trick?
>>> Also, while d_invalidate() is not actually wrong here, because you
>>> check S_ISDIR(), but it's still the wrong function to use. You really
>>> just want to shrink the children. Invalidation means: the filesystem
>>> found out that the cached inode is invalid, so we want to throw it
>>> away. In the future it might actually be able to do it for
>>> directories as well, but currently it cannot because of possible
>>> mounts on the dentry.
>> Thats the same issue as with the dentries. The new function could deal with
>> both situations?
>
> Sure.
>
> The big issue is dealing with umount. You could do something like
> grab_super() on sb before getting a ref on the inode/dentry. But I'm
> not sure this is a good idea. There must be a simpler way to achieve
> this...
Taking a lock on vfsmount_lock? But that would make dentry reclaim a pain.
We are only interested in the reclaim a dentry if its currently unused. If so
then why does unmount matter? Both unmount and reclaim will attempt to remove
the dentry.
Have a look at get_dentries(). It takes the dcache_lock and checks the dentry
state. Either the entry is ignored or dget_locked() removes it from the lru.
If its off the LRU then it can no longer be reclaimed by umount.
--
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>
next prev parent reply other threads:[~2008-10-20 18:22 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1223883004.31587.15.camel@penberg-laptop>
[not found] ` <1223883164.31587.16.camel@penberg-laptop>
[not found] ` <Pine.LNX.4.64.0810131227120.20511@blonde.site>
2008-10-13 12:54 ` Nick Piggin
2008-10-13 13:59 ` Miklos Szeredi
2008-10-13 14:27 ` Miklos Szeredi
2008-10-13 16:35 ` Christoph Lameter
2008-10-13 14:49 ` Miklos Szeredi
2008-10-13 15:22 ` Miklos Szeredi
2008-10-20 14:59 ` Christoph Lameter
2008-10-20 18:01 ` Miklos Szeredi
2008-10-20 18:22 ` Christoph Lameter [this message]
2008-10-20 18:40 ` Miklos Szeredi
2008-10-20 19:11 ` Christoph Lameter
2008-10-20 19:28 ` Miklos Szeredi
2008-10-20 19:53 ` Christoph Lameter
2008-10-20 20:50 ` Miklos Szeredi
2008-10-21 23:17 ` Christoph Lameter
2008-10-22 7:10 ` Miklos Szeredi
2008-10-22 15:42 ` Christoph Lameter
2008-10-22 19:46 ` Miklos Szeredi
2008-10-22 19:54 ` Christoph Lameter
2008-10-22 20:11 ` Miklos Szeredi
2008-10-22 20:19 ` Christoph Lameter
2008-10-22 20:26 ` Miklos Szeredi
2008-10-22 20:48 ` Pekka Enberg
2008-10-22 21:01 ` Christoph Lameter
2008-10-22 21:04 ` Miklos Szeredi
2008-10-22 21:12 ` Pekka Enberg
2008-10-22 21:28 ` Christoph Lameter
2008-10-22 22:10 ` Miklos Szeredi
2008-10-22 23:20 ` Christoph Lameter
2008-10-23 7:10 ` Pekka Enberg
2008-10-23 8:38 ` Miklos Szeredi
2008-10-23 13:40 ` Christoph Lameter
2008-10-23 13:58 ` Pekka Enberg
2008-10-23 14:09 ` Christoph Lameter
2008-10-23 14:14 ` Pekka Enberg
2008-10-23 14:25 ` Christoph Lameter
2008-10-23 15:17 ` Eric Dumazet
2008-10-23 15:39 ` Christoph Lameter
2008-10-23 16:35 ` Eric Dumazet
2008-10-23 16:47 ` Christoph Lameter
2008-10-23 17:14 ` Eric Dumazet
2008-10-28 11:06 ` Pekka Enberg
2008-10-28 11:19 ` Nick Piggin
2008-10-30 15:45 ` Christoph Lameter
2008-10-22 20:59 ` Christoph Lameter
2008-10-20 23:04 ` Dave Chinner
2008-10-13 16:24 ` Christoph Lameter
2008-10-13 14:28 ` Miklos Szeredi
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=48FCCC72.5020202@linux-foundation.org \
--to=cl@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=penberg@cs.helsinki.fi \
/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