Re: fs block size and PAGE_CACHE_SIZE

Anton Altaparmakov
2003-05-12T10:20:10Z

On Mon, 12 May 2003, 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.

The new ntfs driver reads several (compressed data) pages transparently
and at once using readpage and it works just fine both smp and preemption
both on 2.4 and 2.5. Basically I see it as intelligent readahead. You
can see the 2.5 code in the vanilla kernel and the 2.4 code by downloading
the 2.4 kernel patch from:

http://linux-ntfs.sf.net/downloads.html

Or by pulling from our BK repository:

bk pull bk://linux-ntfs.bkbits.net/ntfs-2.4

You can also view the BK tree with your webbrowser:

http://linux-ntfs.bkbits.net:8080/ntfs-2.4/src?nav=index.html

You want to look at the files:

fs/ntfs/aops.c and fs/ntfs/compress.c.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/