Re: [PATCH 5/9] writeback: introduce the pageout work

From: Andrew Morton
Date: Thu Mar 01 2012 - 14:42:02 EST


On Thu, 1 Mar 2012 12:04:04 +0100
Jan Kara <jack@xxxxxxx> wrote:

> > iirc, the way I "grabbed" the page was to actually lock it, with
> > [try_]_lock_page(). And unlock it again way over within the writeback
> > thread. I forget why I did it this way, rather than get_page() or
> > whatever. Locking the page is a good way of preventing anyone else
> > from futzing with it. It also pins the inode, which perhaps meant that
> > with careful management, I could avoid the igrab()/iput() horrors
> > discussed above.
>
> I think using get_page() might be a good way to go.

get_page() doesn't pin the inode - truncate() will still detach it
from the address_space().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/