From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Pagewriteback clarification Date: Tue, 27 Sep 2005 18:57:38 -0700 Message-ID: <20050928015738.GA12461@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: sukadev@us.ibm.com Return-path: Received: from e4.ny.us.ibm.com ([32.97.182.144]:17116 "EHLO e4.ny.us.ibm.com") by vger.kernel.org with ESMTP id S965246AbVI1BzG (ORCPT ); Tue, 27 Sep 2005 21:55:06 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j8S1sxun000308 for ; Tue, 27 Sep 2005 21:54:59 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j8S1sxk6107344 for ; Tue, 27 Sep 2005 21:54:59 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j8S1sxm6023338 for ; Tue, 27 Sep 2005 21:54:59 -0400 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, I have a couple of questions regarding PageWriteback flag and its relationship to locked buffers and in-progress I/O in progress. I would appreciate any input/pointers on this. 1. Based on documentation in Documentation/filesystems/filesystems (LK 2.6.13), .writepage() can be called even if I/O is in progress for the page. And if an I/O is in progress, PageWriteback is TRUE for the page. Then, can a filesystem's .writepage simply rely on PageWriteback flag to determine if I/O is currently in progress ? (ext3/reiser etc seem to use test_set_buffer_locked() to determine if I/O is in progress) 2. __block_write_full_page() has following lines of code: In a do..while() loop: if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { lock_buffer(bh); } else if (test_set_buffer_locked(bh)) { redirty_page_for_writepage(wbc, page); continue; } and immediately after the loop is following BUG_ON(). BUG_ON(PageWriteback(page)); The test_set_buffer_locked(bh) appears to be testing for in-progress I/O and if TRUE redirties the page. But if a sync I/O is in progress for the page for instance, would PageWriteback not be TRUE ? Thanks, Sukadev