public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Lougher <phillip@lougher.demon.co.uk>
To: David Chow <davidchow@shaolinmicro.com>
Cc: trond.myklebust@fys.uio.no, linux-fsdevel@vger.kernel.org
Subject: Re: fs block size and PAGE_CACHE_SIZE
Date: Mon, 12 May 2003 12:33:06 +0100	[thread overview]
Message-ID: <3EBF8672.9060706@lougher.demon.co.uk> (raw)
In-Reply-To: 3EBF01D5.7000002@shaolinmicro.com

David Chow wrote:

> Trond Myklebust wrote:
>
>>>>>>> " " == David Chow <davidchow@shaolinmicro.com> writes:
>>>>>>>           
>>>>>>
>>
>>     > How can you make sure there are no race conditions in
>>     > populating multiple page caches and making them up-to-date
>>     > afterwards? Since readpage only make sures you lock one page,
>>
>> Have a browse through mm/readahead.c (in particular read_pages() and
>> read_cache_pages()).
>> The page is is anonymous when it gets locked, and is only added to the
>> page cache) if there is no existing page. The lock is only released by
>> the filler.
>>
>>     > If readpages() is added for 2.5, it doesn't mean read page
>>     > don't have to implement readpage(), right?
>>
>> Right. You still have to implement readpage.
>>
> 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

>
> regards,
> David Chow
>
>>  
>>
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>




  parent reply	other threads:[~2003-05-12 11:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 17:42 fs block size and PAGE_CACHE_SIZE David Chow
2003-05-06 19:34 ` Szakacsits Szabolcs
2003-05-06 21:08 ` Bryan Henderson
2003-05-07  0:59   ` Phillip Lougher
2003-05-12  1:59   ` David Chow
2003-05-06 21:34 ` Trond Myklebust
     [not found]   ` <3EBE85E8.50906@shaolinmicro.com>
2003-05-12  0:31     ` Trond Myklebust
2003-05-12  2:07       ` David Chow
2003-05-12 10:32         ` Anton Altaparmakov
2003-05-12 11:33         ` Phillip Lougher [this message]
2003-05-12 17:46           ` David Chow
2003-05-07  0:48 ` Phillip Lougher
2003-05-11 17:12   ` David Chow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EBF8672.9060706@lougher.demon.co.uk \
    --to=phillip@lougher.demon.co.uk \
    --cc=davidchow@shaolinmicro.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox