linux-yocto/tools
Qiuxu Zhuo 6c94a16ba2 selftests/mincore: Allow read-ahead pages to reach the end of the file
[ Upstream commit 197c1eaa7ba633a482ed7588eea6fd4aa57e08d4 ]

When running the mincore_selftest on a system with an XFS file system, it
failed the "check_file_mmap" test case due to the read-ahead pages reaching
the end of the file. The failure log is as below:

   RUN           global.check_file_mmap ...
  mincore_selftest.c:264:check_file_mmap:Expected i (1024) < vec_size (1024)
  mincore_selftest.c:265:check_file_mmap:Read-ahead pages reached the end of the file
  check_file_mmap: Test failed
           FAIL  global.check_file_mmap

This is because the read-ahead window size of the XFS file system on this
machine is 4 MB, which is larger than the size from the #PF address to the
end of the file. As a result, all the pages for this file are populated.

  blockdev --getra /dev/nvme0n1p5
    8192
  blockdev --getbsz /dev/nvme0n1p5
    512

This issue can be fixed by extending the current FILE_SIZE 4MB to a larger
number, but it will still fail if the read-ahead window size of the file
system is larger enough. Additionally, in the real world, read-ahead pages
reaching the end of the file can happen and is an expected behavior.
Therefore, allowing read-ahead pages to reach the end of the file is a
better choice for the "check_file_mmap" test case.

Link: https://lore.kernel.org/r/20250311080940.21413-1-qiuxu.zhuo@intel.com
Reported-by: Yi Lai <yi1.lai@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-02 07:47:06 +02:00
..
accounting delayacct: improve the average delay precision of getdelay tool to microsecond 2024-10-17 15:22:06 +02:00
arch tools/x86/kcpuid: Protect against faulty "max subleaf" values 2024-10-17 15:21:41 +02:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-02-21 13:49:20 +01:00
bpf bpftool: fix potential NULL pointer dereferencing in prog_dump() 2024-12-14 19:54:29 +01:00
build perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2024-02-05 20:12:58 +00:00
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 16:00:52 +02:00
hv tools: hv: rm .*.cmd when make clean 2024-09-30 16:23:50 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:22:17 +02:00
include stddef: make __struct_group() UAPI C++-friendly 2025-01-02 10:30:51 +01:00
io_uring
kvm/kvm_stat tools/kvm_stat: update exit reasons for vmx/svm/aarch64/userspace 2022-11-09 12:26:52 -05:00
laptop
leds
lib libbpf: Fix hypothetical STT_SECTION extern NULL deref case 2025-04-10 14:33:33 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-03 08:49:36 +02:00
objtool objtool: Stop UNRET validation on UD2 2025-05-02 07:47:05 +02:00
pci
pcmcia
perf perf tools: annotate asm_pure_loop.S 2025-04-10 14:33:37 +02:00
power pm: cpupower: bench: Prevent NULL dereference on malloc failure 2025-04-25 10:43:27 +02:00
rcu
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:54:30 +01:00
spi
testing selftests/mincore: Allow read-ahead pages to reach the end of the file 2025-05-02 07:47:06 +02:00
thermal
time
tracing rtla/timerlat_top: Abort event processing on second signal 2025-02-21 13:49:59 +01:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-11-08 16:26:44 +01:00
verification verification/dot2: Improve dot parser robustness 2024-12-14 19:54:47 +01:00
virtio tools/virtio: fix the vringh test for virtio ring changes 2023-02-22 12:59:42 +01:00
vm tools/mm/page_owner_sort.c: fix TGID output when cull=tg is used 2023-04-26 14:28:39 +02:00
wmi
Makefile