From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: set_page_dirty races (was: Re: [patch 2/4] vfs: add set_page_dirty_notag) Date: Tue, 17 Feb 2009 13:30:17 +0100 Message-ID: <20090217123017.GG26402@wotan.suse.de> References: <18841.60432.329341.514726@edward.zelnet.ru> <1234861781.4744.21.camel@laptop> <20090217093805.GB31323@wotan.suse.de> <1234865116.4744.46.camel@laptop> <20090217102443.GA26402@wotan.suse.de> <1234867200.4744.65.camel@laptop> <20090217112512.GD26402@wotan.suse.de> <1234870772.4744.79.camel@laptop> <20090217115532.GF26402@wotan.suse.de> <1234872334.4744.95.camel@laptop> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1234872334.4744.95.camel@laptop> Sender: reiserfs-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Peter Zijlstra Cc: Edward Shishkin , Andrew Morton , Ryan Hope , Randy Dunlap , linux-kernel@vger.kernel.org, ReiserFS Mailing List 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.