From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: Re: __fsync_super and inode dirty pages Date: Tue, 5 Aug 2008 23:38:17 +0530 Message-ID: <20080805180817.GB17772@skywalker> References: <20080805175439.GA17772@skywalker> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "linux-fsdevel@vger.kernel.org" To: Christoph Hellwig , Alexander Viro , Andrew Morton Return-path: Received: from E23SMTP04.au.ibm.com ([202.81.18.173]:52897 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759088AbYHESIg (ORCPT ); Tue, 5 Aug 2008 14:08:36 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.18.234]) by e23smtp04.au.ibm.com (8.13.1/8.13.1) with ESMTP id m75I7VeB005976 for ; Wed, 6 Aug 2008 04:07:31 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m75I8WBD4255766 for ; Wed, 6 Aug 2008 04:08:32 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m75I8VVj031376 for ; Wed, 6 Aug 2008 04:08:32 +1000 Content-Disposition: inline In-Reply-To: <20080805175439.GA17772@skywalker> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Aug 05, 2008 at 11:24:39PM +0530, Aneesh Kumar K.V wrote: > Hi, > > I am trying to understand the expectation on filesystem > writepages by __fsync_super -> generic_sync_sb_inodes call path. > __fsync_super make two calls to generic_sync_sb_inodes and the > second call is made with WB_SYNC_ALL. The problem is, i am finding > multiple ways we may 'break' from the generic_sync_sb_inodes > while (!list_empty(&sb->s_io)) loop. For ex: > > a) When wbc->nr_to_write <=0 > This should normally indicate that we wrote more than we requested > That means we have more dirty pages . So why break from loop ? > This may be ok for nr_to_write limited writeback. But is it ok > for __fsync_super ? > > b) pages_skipped != wbc->pages_skipped. > That means writepages was not able to write some of the pages > and it redirtied the same. We add such inode to s_dirty list. But > we don't loop through the s_dirty list later trying to write the > dirty pages. We actually call generic_sync_sb_inodes again. That > can actually cause s_dirty list content to move to s_io once > via queue_io. But then we can have pages skipped again in the second > call to generic_sync_sb_inodes ? > > > Shouldn't we have a variant that actually loop trough s_dirty and s_more_io > list MULTIPLE times and make sure we force all the dirty pages to disk > before __fsync_super returns ? Or is there an expectation from file > system writepages that would make sure calling generic_sync_sb_inodes > TWICE would guarantee that ? The problem I am lookin at is listed here. http://thread.gmane.org/gmane.comp.file-systems.ext4/8277 basically a mount -o remount,ro followed by a sync is indicating that there are dirty pages left after remount,ro -aneesh