[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f87565f-46e5-4281-a3af-64c6a8235848@huawei.com>
Date: Thu, 18 Dec 2025 15:21:37 +0800
From: Yunsheng Lin <linyunsheng@...wei.com>
To: Kevin Brodsky <kevin.brodsky@....com>, <linux-mm@...ck.org>,
<linux-kselftest@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, Mark Brown <broonie@...nel.org>, Ryan Roberts
<ryan.roberts@....com>, Shuah Khan <shuah@...nel.org>, Paolo Abeni
<pabeni@...hat.com>
Subject: Re: [PATCH 1/4] selftests/mm: remove flaky header check
On 2025/12/17 17:58, Kevin Brodsky wrote:
> On 17/12/2025 04:18, Yunsheng Lin wrote:
>> On 2025/12/16 22:26, 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.
>> As some commercial OS still uses v6.6, I am wondering if we need that
>
> Fair point, I hadn't considered that kselftests are supposed to be
> buildable against older stable kernels.
>
>> check for a little longer, is it possible to do something like below to
>> avoid the flaky check?
>>
>> @@ -46,7 +46,8 @@ CFLAGS += -U_FORTIFY_SOURCE
>>
>> KDIR ?= /lib/modules/$(shell uname -r)/build
>> ifneq (,$(wildcard $(KDIR)/Module.symvers))
>> -ifneq (,$(wildcard $(KDIR)/include/linux/page_frag_cache.h))
>> +KSRC := $(shell readlink -f $(KDIR)/source 2>/dev/null || echo $(KDIR))
>> +ifneq (,$(wildcard $(KSRC)/include/linux/page_frag_cache.h))
>> TEST_GEN_MODS_DIR := page_frag
>> else
>> PAGE_FRAG_WARNING = "missing page_frag_cache.h, please use a newer kernel"
>
> That seems reasonable, and it works for my out-of-tree setup.
>
> Will do that in v2, shall I add your Suggested-by, or maybe Co-developed-by?
Yes if you want to go that direction.
Powered by blists - more mailing lists