Skip to content

RFC Variable Order Page Cache Patchset V2

[email protected] linux-mm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest16 patches 0 repliesNew

RFC V1->V2 from the cover letter

- Some ext2 support
- Some block layer, fs layer support etc.
- Better page cache macros
- Use macros to clean up code.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16Free up page->private for compound pagesarch/ia64/mm/init.c include/linux/mm.h include/linux/page-flags.h +4 more+79 -240 replies
2/16vmstat.c: Support accounting for compound pagesinclude/linux/mm_inline.h mm/vmstat.c+9 -110 replies
3/16Variable Order Page Cache: Add order field in mappingfs/inode.c include/linux/fs.h+2 -00 replies
4/16Variable Order Page Cache: Add basic allocation functionsinclude/linux/pagemap.h mm/filemap.c+35 -110 replies
5/16Variable Order Page Cache: Add functions to establish sizesinclude/linux/pagemap.h+42 -00 replies
6/16Variable Page Cache: Add VM_BUG_ONs to check for correct page ordermm/filemap.c+16 -30 replies
7/16Variable Order Page Cache: Add clearing and flushing functioninclude/linux/pagemap.h+25 -00 replies
8/16Variable Order Page Cache: Fixup fallback functionsfs/libfs.c+12 -70 replies
9/16Variable Order Page Cache: Fix up mm/filemap.cmm/filemap.c+31 -310 replies
10/16Variable Order Page Cache: Readahead fixupsinclude/linux/mm.h mm/fadvise.c mm/filemap.c +2 more+23 -130 replies
11/16Variable Page Cache Size: Fix up reclaim countersmm/vmscan.c+8 -70 replies
12/16Variable Order Page Cache: Fix up the writeback logicfs/sync.c mm/fadvise.c mm/page-writeback.c +1 more+22 -210 replies
13/16Variable Order Page Cache: Fixed to block layerfs/block_dev.c fs/buffer.c fs/inode.c +2 more+100 -710 replies
14/16Variable Order Page Cache: Add support to ramfsfs/ramfs/file-mmu.c fs/ramfs/inode.c include/linux/ramfs.h+24 -30 replies
15/16ext2: Add variable page size supportfs/ext2/dir.c fs/ext2/ext2.h fs/ext2/file.c +2 more+58 -210 replies
16/16Variable Order Page Cache: Alternate implementation of page cache macrosinclude/linux/fs.h include/linux/pagemap.h+10 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/16] Variable Order Page Cache Patchset V2

RFC V1->V2
- Some ext2 support
- Some block layer, fs layer support etc.
- Better page cache macros
- Use macros to clean up code.

This patchset modifies the Linujx kernel so that higher order page cache pages become possible. The higher order page cache pages are compound pages and can be handled in the same way as regular pages.

Rationales:

1. We have problems supporting devices with a higher blocksize than page size. This is for example important to support CD and DVDs that can only read and write 32k or 64k blocks. We currently have a shim layer in there to deal with this situation which limits the speed of I/O. The developers are currently looking for ways to completely bypass the page cache because of this deficiency.

2. 32/64k blocksize is also used in flash devices. Same issues.

3. Future harddisks will support bigger block sizes

4. Performace. If we look at IA64 vs. x86_64 then it seems that the faster interrupt handling on x86_64 compensate for the speed loss due to a smaller page size (4k vs 16k on IA64). Having higher page sizes on all platform allows a significant reduction in I/O overhead and increases the size of I/O that can be performed by hardware in a single request since the number of scatter gather entries are typically limited for one request. This is going to become increasingly important to support the ever growing memory sizes since we may have to handle excessively large amounts of 4k requests for data sizes that may become common soon. For example to write a 1 terabyte file the kernel would have to handle 256 million 4k chunks.

5. Cross arch compatibility: It is currently not possible to mount an 16k blocksize ext2 filesystem created on IA64 on an x86_64 system.

The support here is currently only for buffered I/O and only for two filesystems ramfs and ext2.

Note that the higher order pages are subject to reclaim. This works in general since we are always operating on a single page struct. Reclaim is fooled to think that it is touching page sized objects (there are likely issues to be fixed there if we want to go down this road).

What is currently not supported:
- Mmapping higher order pages
- Direct I/O (there are some fundamental issues with direct I/O putting compound pages that have to be treated as single pages on the pagevecs and the variable order page cache putting higher order compound pages that hjave to be treated as a single large page onto pagevecs.

Breakage:
- Reclaim does not work for some reasons. Compound pages on the active list get lost somehow.
- Disk data is corrupted when writing ext2fs data. There is likely still a lot of work to do in the block layer.
- There is a lot of incomplete work. There are numerous places where the kernel can no longer assume that the page cache consists of PAGE_SIZE pages that have not been fixed yet.

Future:
- Expect several more RFCs
- We hope for XFS support soon
- There are filesystem layer and lower layer issues here that I am not that familiar with. If you can then please enhance my patches.
- Mmap support could be done in a way that makes the mmap page size independent from the page cache order. There is no problem of mapping a 4k section of a larger page cache page. This should leave mmap as is.
- Lets try to keep scope as small as possible.

--