lkml.org 
[lkml]   [2010]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] NFS: Fix a memory leak in nfs_readdir
On Wed, 1 Dec 2010 15:31:11 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, Dec 1, 2010 at 2:38 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > OK, the stop_machine() plugs a lot of potential race-vs-module-unload
> > things. __But Trond is referring to races against vmscan inode reclaim,
> > unmount, etc.
>
> So?
>
> A filesystem module cannot be unloaded while it's still mounted.
>
> And unmount doesn't succeed until all inodes are gone.
>
> And getting rid of an inode doesn't succeed until all pages associated
> with it are gone.
>
> And getting rid of the pages involves locking them (whether in
> truncate or vmscan) and removing them from all lists.
>
> Ergo: vmscan has a locked page leads to the filesystem being
> guaranteed to not be unmounted. And that, in turn, guarantees that
> the module won't be unloaded until the machine has gone through an
> idle cycle.

The page isn't attached to the address_space any more:

static int __remove_mapping(struct address_space *mapping, struct page *page)
{
...
__remove_from_page_cache(page);
spin_unlock_irq(&mapping->tree_lock);
...
}



\
 
 \ /
  Last update: 2010-12-02 00:39    [W:0.426 / U:2.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site