truncate for block size > page size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm currently looking at the truncate path for large pages and I suspect
you have thought about the situation with block size > page size more
than I have.

Let's say you have a fs with 8kB blocks and a CPU with 4kB PAGE_SIZE.
If you have a 32kB file with all its pages in the cache, and the user
truncates it down to 10kB, should we leave three pages in the page cache
or four?

Three pages means (if the last page of the file is dirty) we'd need to
add in either a freshly allocated zero page or the generic zero page to
the bio when writing back the last page.

Four pages mean we'll need to teach the truncate code to use the larger
of page size and block size when deciding the boundary to truncate the
page cache to, and zero the last page(s) of the file if needed.

Depending on your answer, I may have some follow-up questions about how
we handle reading a 10kB file with an 8kB block size on a 4kB PAGE SIZE
machine (whether we allocate 3 or 4 pages, and what we do about the
extra known-to-be-zero bytes that will come from the device).



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux