Whamcloud - gitweb
LU-16897 tgt: note 'hole' pages 97/53297/13
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 30 Nov 2023 16:54:34 +0000 (11:54 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:05:36 +0000 (08:05 +0000)
commit4c3ddd1b8634c06579a4f4e77d93584076e1c5e1
tree12fcdf485b1d9e8979beef205e9a2b492e66cb4a
parent33280c46438a03b28add6a00d08167657bc6f990
LU-16897 tgt: note 'hole' pages

In order to do sparse reads, we must know which pages
correspond to holes, so we note this when the page is read
from disk.

Note something unusual: We store the hole information in
the lnb, which is a per-IO struct.  This means the hole
information is not present when a page is reused in cache.

So when a region with a hole is first read from disk, the
hole annotation is available for the transfer code, but if
the page cache is in use, this information is not available
on subsequent reads from the same pages.

This can't be avoided because the server does not have any
per-page private information for page cache pages (and ZFS
would not support this).

This isn't too costly for two reasons:
1. We default page cache to off on flash systems
2. Most data is only read once rather than many times in
quick succession

NB: It's not clear how we can efficiently get hole
information from ZFS so this is only for ldiskfs for now.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I54b1b0abeb6889163f36b315292d8b6e760d6f78
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53297
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/osd-ldiskfs/osd_io.c
lustre/target/tgt_handler.c