lkml.org 
[lkml]   [2009]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: set_page_dirty races (was: Re: [patch 2/4] vfs: add set_page_dirty_notag)
On Tue, Feb 17, 2009 at 01:05:34PM +0100, Peter Zijlstra wrote:
> On Tue, 2009-02-17 at 12:55 +0100, Nick Piggin wrote:
> > If nobody thinks it is insane, I'll resend to Andrew in a new thread.
>
> Right, gup_fast() seems to also respect .write properly,

Phew! :)

> so it would
> also be used to balance that.
>
> I guess gup_fast() would need to use trylock_page(), and fall back to
> the slow path when we start taking PG_locked on .write.

Yeah, you're right there. It might also be possible to have a flag
somewhere to avoid the lock if the underlying filesystem doesn't
have a page_mkwrite or doesn't account dirty... which could avoid
the overhead for the common case of anonymous or tmpfs memory.

For gup_fast that pretty much implies an extra page flag I think. But
let's not get too worried with details... I don't think put_user_pages
hurts, even if it only remains as put_page loop. Just to help reader
through the page refcounting.

> I suppose we should start converting a few gup users over to pup before
> handing the thing to Andrew, to have at least a few examples in-kernel.

Could do. There are quite a few easy ones.


\
 
 \ /
  Last update: 2009-02-18 12:23    [W:0.166 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site