From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout09.his.huawei.com (canpmsgout09.his.huawei.com [113.46.200.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4917C33122B; Thu, 18 Dec 2025 07:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.224 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766042510; cv=none; b=i2i+bp/p/0PTscBSx27SSseOEDT3hCuw+OAnRl5VB3/zM/XgHnyyxWowa99UlO0vOXAsOHgcNqEn+S/vPCaW2oKng1NsEjCIAM+kLcUCuSIQ5benAbY6DPOeB2h4v15gGr4xj78YM88NYBHthGMOPSUtnHX8OEgT+4+LIQuYio4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766042510; c=relaxed/simple; bh=9r+LImKUqVvv0Ro2qHalJGpZA5lnIP8XM3IGefcnMnI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=geag1HSDR9C5Qxf9/+VA08DXzRHY7Gpws0xgO5260CBLw8I3YbVGTLBEkdeC0jTqnfMWdUPGZQ5Phxd4T8Hg5dfjOpJ0nY6Ca+A37ri+kaRe6crVHVDcuo5tpHAd1jUQG02QqWWErMXJXrkT+VizGAa+pQXGsfYzyLV2a9jZHtI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=MztbfNo8; arc=none smtp.client-ip=113.46.200.224 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="MztbfNo8" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=U+pWCPz6K3Acb14sjvlVNRJs4ZVun+zx5u6e9fTe4Lk=; b=MztbfNo89mGT3RHiobzc/2N0VthipG6Fjx58mIbkg3d0MLPOkfJTNyTu77XFE4uo0kHEV662v koj9fUNXYKQrmypmkPiiUbNJURj3mR2EJ79mVPm01GtYjv0mHMcziDTJ+Y5FrlMEI+T+l66hXyl 2/NlYTHLGDBkOL2LqrUeWAM= Received: from mail.maildlp.com (unknown [172.19.163.17]) by canpmsgout09.his.huawei.com (SkyGuard) with ESMTPS id 4dX28D0vr2z1cyPb; Thu, 18 Dec 2025 15:18:36 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id D3FF81A0188; Thu, 18 Dec 2025 15:21:38 +0800 (CST) Received: from [10.67.112.40] (10.67.112.40) by dggpemf200006.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 18 Dec 2025 15:21:38 +0800 Message-ID: <1f87565f-46e5-4281-a3af-64c6a8235848@huawei.com> Date: Thu, 18 Dec 2025 15:21:37 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] selftests/mm: remove flaky header check To: Kevin Brodsky , , CC: , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Mark Brown , Ryan Roberts , Shuah Khan , Paolo Abeni References: <20251216142633.2401447-1-kevin.brodsky@arm.com> <20251216142633.2401447-2-kevin.brodsky@arm.com> Content-Language: en-US From: Yunsheng Lin In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To dggpemf200006.china.huawei.com (7.185.36.61) 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 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. >>> >>> 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.