diff options
| author | Jerome Marchand <jmarchan@redhat.com> | 2026-04-20 16:46:37 +0300 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-04-23 00:07:01 +0300 |
| commit | a20f97791a786203821570e84941ee7a67fd53e9 (patch) | |
| tree | 916cf189411175c97b999f6e84c0c80aa8ef66d6 /include/linux/stackprotector.h | |
| parent | e85115ff37f20d5c64ffbfd911d67f3686e2472d (diff) | |
| download | linux-a20f97791a786203821570e84941ee7a67fd53e9.tar.xz | |
selftests/bpf: Page out as late as possible in file_reader
The file_reader/on_open_expect_fault fails consistently on my system.
It expects a page fault on first dynptr read of some range the exe
file of the current process because it has paged out that page range
earlier. However a lot can happen to that range (which depending on
the actual memory layout could contain text section, data section,
sections )related to dynamic linking...) between the moment it was
paged out and the moment the bpf program expected to hit a pagefault
actually run.
A bit of instrumentation with mincore() shows that pages from that
range were accessed several times before the program is run. In
particular the call of file_reader__load() seems to fault all the
range in.
Move the call to madvise(MADV_PAGEOUT) to just before attaching the
program to minimize the risk of having those page pulled back in from
under our feet.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20260420134637.2513867-1-jmarchan@redhat.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'include/linux/stackprotector.h')
0 files changed, 0 insertions, 0 deletions
