On Tue, Dec 16, 2025 at 02:26:30PM +0000, Kevin Brodsky wrote:
Commit 96ed62ea0298 ("mm: page_frag: fix a compile error when kernel is not compiled") introduced a check to avoid attempting to build the page_frag module if <linux/page_frag_cache.h> is missing.
Unfortunately this check only works if KDIR points to /lib/modules/... or an in-tree kernel build. It always fails if KDIR points to an out-of-tree build (i.e. when the kernel was built with O=$KDIR make) because only generated headers are present under $KDIR/include/ in that case.
<linux/page_frag_cache.h> was added more than a year ago (v6.13) so we can probably live without that check.
More generally building selftests with random older kernel versions isn't really something that's expected to be robust:
Reviewed-by: Mark Brown broonie@kernel.org