From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Chow Subject: Re: fs block size and PAGE_CACHE_SIZE Date: Tue, 13 May 2003 01:46:05 +0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <3EBFDDDD.6030301@shaolinmicro.com> References: <3EB7F401.1010908@shaolinmicro.com> <3EBE85E8.50906@shaolinmicro.com> <16062.60265.978839.698174@charged.uio.no> <3EBF01D5.7000002@shaolinmicro.com> <3EBF8672.9060706@lougher.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: trond.myklebust@fys.uio.no, linux-fsdevel@vger.kernel.org Return-path: Received: from [202.94.238.145] ([202.94.238.145]:57235 "EHLO mail.shaolinmicro.com") by vger.kernel.org with ESMTP id S262335AbTELRdE (ORCPT ); Mon, 12 May 2003 13:33:04 -0400 To: Phillip Lougher List-Id: linux-fsdevel.vger.kernel.org > > >> So it is impossible to do under 2.4? Since all the design of VFS and >> page cache assumes the underlying fs uses a 4k page or something >> equivalent less to the size of a PAGE_CACHE_SIZE as the largest unit >> of a cache. If you read Phillip Lougher's mail which points to the >> squash fs (read-only), plus the problem of sleeping which really >> impossible to implement a read/write fs on smp systems (which I >> suppose to, and the current fs already supported). If it is >> impossible, I don't bother to think though. > > > Hi, > > I think you slightly mis-understood my post. There is no problem doing > this with SMP or pre-emptive kernels. > > What I did say was to point out it was better to use > grab_page_nowait() rather than read_cache_page. The problem with > read_cache_page is not to with smp or pre-emptive kernels, it is to do > with the fact read_cache_page tries to grab the lock of the page it is > called to fill. If the page is already locked by another process, it > will sleep on the lock. Grab_page_nowait() doesn't wait if the page is > locked. > > Regards > > Phillip Lougher > Thanks for your clarifications. But what to do if one page is locked out of 4 (a 16k block)? It is easy when readpage() so that I just fill the reset 12k with up-to-date data. But for write, it is likely I need something to compress, right? If I simply grab the page data without considering the lock, corruption will likely to occur. I should sleep and wait for the page lock since it might be never unlocked for some mmapped and locked pages in different vmarea. Have you consider this at all? This is where it comes different with rw fs. regards, David Chow