From: Nick Piggin Subject: Re: [patch 2/4] vfs: add set_page_dirty_notag Date: Tue, 17 Feb 2009 10:38:05 +0100 Message-ID: <20090217093805.GB31323@wotan.suse.de> References: <18837.24581.181196.569183@edward.zelnet.ru> <1234530519.6519.46.camel@twins> <49957C43.7050701@gmail.com> <1234534150.6519.101.camel@twins> <18838.49922.215481.399653@edward.zelnet.ru> <1234645893.4695.8.camel@laptop> <18841.60432.329341.514726@edward.zelnet.ru> <1234861781.4744.21.camel@laptop> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1234861781.4744.21.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 10:09:41AM +0100, Peter Zijlstra wrote: > On Tue, 2009-02-17 at 01:43 +0300, Edward Shishkin wrote: > > > > How much performance gain do you see by avoiding that radix tree op? > > > > > > > Nop. We want to use it with extended semantics. > > All dirty pages are divided into 2 categories: > > > > A) tagged in the radix tree (with PAGECACHE_TAG_DIRTY). > > B) captured by atoms (usual linked lists). > > > > reiser4_writepages() looks for pages of "A" in the radix tree > > and moves them to "B". set_page_dirty_notag(), introduced by > > my patch, is needed for pages of "B". > > > > If "B" is empty, then we get the traditional semantics with > > regular ->writepages(). > > > > That's all! > > Ah, indeed. I had not considered such a scheme. It is a great shame that filesystems are not properly notified that a page may become dirty before the actual set_page_dirty event (which is not allowed to fail and is called after the page is already dirty). This is a big problem I have with fsblock simply in trying to make the memory allocation robust. page_mkwrite unfortunately is racy and I've fixed problems there... the big problem though is get_user_pages. Fixing that properly seems to require fixing callers so it is not really realistic in the short term. As such... > > Add set_page_dirty_notag() to the core library to enable > > extended functionality of radix tree attached to inode->i_mapping. > > > > Signed-off-by: Edward Shishkin > > Looks good to me > > Acked-by: Peter Zijlstra I'm fine with it too. Acked-by: Nick Piggin You know... it wouldn't be terribly painful to introduce a new pagecache radix tree tag for filesystem private use (doesn't bloat the radix tree node size) if there is a strong need for it. But if you have this workaround then I think it is also reasonable.