linux-yocto/tools
Qiuxu Zhuo 33f046d7c8 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:44:37 +02:00
..
accounting
arch tools/x86/kcpuid: Protect against faulty "max subleaf" values 2024-10-17 15:11:28 +02:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-03-13 12:50:10 +01:00
bpf bpftool: fix potential NULL pointer dereferencing in prog_dump() 2024-12-14 19:51:29 +01:00
build perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2024-02-23 08:54:50 +01:00
cgroup
debugging
edid
firewire
firmware
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 15:59:12 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-19 12:22:28 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:11:52 +02:00
include tools: move alignment-related macros to new <linux/align.h> 2024-09-04 13:23:37 +02:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop
leds
lib libbpf: Fix hypothetical STT_SECTION extern NULL deref case 2025-04-10 14:31:59 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-19 05:45:15 +02:00
objtool objtool: Stop UNRET validation on UD2 2025-05-02 07:44:37 +02:00
pci
pcmcia
perf perf python: Check if there is space to copy all the event 2025-04-10 14:32:02 +02:00
power pm: cpupower: bench: Prevent NULL dereference on malloc failure 2025-05-02 07:43:53 +02:00
rcu
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:51:30 +01:00
spi
testing selftests/mincore: Allow read-ahead pages to reach the end of the file 2025-05-02 07:44:37 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time
tracing tools/latency-collector: Fix -Wformat-security compile warns 2024-06-16 13:39:12 +02:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-11-08 16:25:54 +01:00
virtio tools/virtio: fix build 2024-03-01 13:21:52 +01:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:28:42 +01:00
wmi
Makefile