From patchwork Sat Nov 16 04:23:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13895553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D132E7716D for ; Thu, 5 Dec 2024 15:23:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDFB46B00F9; Thu, 5 Dec 2024 10:19:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BA4A6B0130; Thu, 5 Dec 2024 10:19:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3838B6B00E2; Thu, 5 Dec 2024 10:19:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 79B796B00A3 for ; Fri, 15 Nov 2024 23:23:28 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F04861210B0 for ; Sat, 16 Nov 2024 04:23:27 +0000 (UTC) X-FDA: 82790663088.18.140481E Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf26.hostedemail.com (Postfix) with ESMTP id 3026F140018 for ; Sat, 16 Nov 2024 04:22:50 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="BB/o8QvW"; spf=pass (imf26.hostedemail.com: domain of yunshenglin0825@gmail.com designates 209.85.210.196 as permitted sender) smtp.mailfrom=yunshenglin0825@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731730809; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=0tlot2yyxrWqW9V2Ak2ioTy4DOmvr1gmx7I7YMSC6PA=; b=cYKDq4btEYBp4miuhlX/byyIuVfIWsPx/C9mz7iVQFWwvGAtfBcrgjAG/6QM7bTQJk46LG FK1SB6pMOu8Ngs7Iy1OaIyKei4VHAEKkL73xk3m2xV8EfiakUXnMhaOgPEu3c/ecy5Rdu5 Boz7DcZ2acAgYWsDVWvOD/WV0ndplIw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="BB/o8QvW"; spf=pass (imf26.hostedemail.com: domain of yunshenglin0825@gmail.com designates 209.85.210.196 as permitted sender) smtp.mailfrom=yunshenglin0825@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731730809; a=rsa-sha256; cv=none; b=dbj2/0WKb92tl03oy/btbZ28DUbMHs1XLfCtFqlWwkY6WilCbJMZIAar6+rf8lG6TcqI+F +Cshua+HXqhR8fbfKJ02lENhgRUS0SzQUcXRl+ROyce2frNjmBwtH3KROpGvMFWzHcnc6I MMIkwks40xS0RxRoUZBwGxQrA6RPPuo= Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-7240fa50694so1206351b3a.1 for ; Fri, 15 Nov 2024 20:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731731005; x=1732335805; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0tlot2yyxrWqW9V2Ak2ioTy4DOmvr1gmx7I7YMSC6PA=; b=BB/o8QvWxjbCEJX1UxTcp7Vy5NEm7V5Nb8IiR/CUP2M7dq4pJZJNOJDA6TN2MtSn+o MDgFheXAfx9tA2t0r8JMQ5PQ1bQGs0HMVYPkeSs3Ux84K7GAMVpKNMA+XdLAUMg6ZMSv 4Fasd44Xg46NsJd4opFWpFbkkJIkbi+YmY/wUEFU16qfRvLAmnfmsqLUUMaF6u5gLkBW 52NyjBjZFo78PcfIvtr7ESUebcIZLyhQIhVMCh97V2MeMmspxQEhKmEx0QFs/YrOi1K1 OHqmEfIQRmCk424AtFGJgehFubFpE3cWRFa//6NYhHgnpQhpomGERZoO2KmbEZGTL8Vj SJmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731731005; x=1732335805; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0tlot2yyxrWqW9V2Ak2ioTy4DOmvr1gmx7I7YMSC6PA=; b=Bf3jLdl9GNVZc2GV+sicFCxqoMGeRcYyb4tqLpzt7/sVTm83pOMOeey4TKNC+cPqgt B9umvUlN4gecQRXLjkZAj6zYtD5cWtAe7F+5Q9jQudCQg8k99DTjCi9X+UeNiRoGs02L NR0GQwPbWRRnVInyrSMiKIlOwatPtzd5UoSqDnbH8Jp6SAM4i1u35NgUawFawPCpXHOg u0mi60Jqbe0eWNL6Z3/bEC3a7Y/jKc5Iml9qsJixtECcs55CajaEgQUI6tVcR16NjtQZ X2Y3arxBdU1XcW//OYhxd4PUmrCuz8OUDEDjBpN2aLJgBDy1kpzEbrmQqLInBl5PIoa1 R9CA== X-Forwarded-Encrypted: i=1; AJvYcCXCqxOyopLEm8dMlK0JippuSTQSRs1g71bfb7enFiTWl3RkjoErGU3BuhePY4seu7VoXLuZjfLMPw==@kvack.org X-Gm-Message-State: AOJu0YyX8AHH/fteyA8SIpQXCpisC7Ec+hEDJF+sQB0K3+sWY/eUR1n7 YFnQG0XUxUQfMAfx493eQ6vkPq5EEK6QK7fQAkY9QkDHL+EZUYup X-Google-Smtp-Source: AGHT+IFqmHhJ4EFwbN79Fl4Ln4i3wfDKo61jt/nCvg3uspSgZWP+RUb2V1i0kq5UvFV7azfzpJRs0Q== X-Received: by 2002:a05:6a00:140f:b0:71e:795f:92f0 with SMTP id d2e1a72fcca58-72476b672dfmr6851952b3a.3.1731731004607; Fri, 15 Nov 2024 20:23:24 -0800 (PST) Received: from yunshenglin-MS-7549.. ([2409:8a55:301b:e120:69f1:c187:3b69:acf9]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724770eefe7sm2175394b3a.31.2024.11.15.20.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 20:23:24 -0800 (PST) From: Yunsheng Lin To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com Cc: linyunsheng@huawei.com, Yunsheng Lin , Andrew Morton , Alexander Duyck , Linux-MM , Mark Brown , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] mm: page_frag: fix a compile error when kernel is not compiled Date: Sat, 16 Nov 2024 12:23:13 +0800 Message-Id: <20241116042314.100400-1-yunshenglin0825@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3026F140018 X-Stat-Signature: giewmi1yg6cqmfrztrc1j5xhx44ybfif X-Rspam-User: X-HE-Tag: 1731730970-743221 X-HE-Meta: U2FsdGVkX19Lm+E47gk1JbGWUjg9Dn4PYmDFUvRA3dUI0lLn85Lof8+os2SXcpUYvKyZyGoq7s9N/9UiQWplh0o6JBdvDJqAAodGqzt7Tq1auQSxensQyxpa2CgRzzaF7yu4rCqurb1TaLs8SzijjmzWrXPudP5j+3zfRi4RfSPe2MHL87HlXg/uO7+mir+mAjCLF7m/e8FSCKZqEaPY69HRkrK29o0wX3kQeHAptUW4cXGNQiiAfMzTQtvLD+CsN8Ov6NnHCIemFpDwbHEN3dvCVIvbz6kHX0da9hNY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LR2KHlEzPKjEWW7QghmRs5JjjhxnBbRnQ39ENaUXWnEkym1O722epTp7oTq4P6wOescWogWs/59HNzt7YS2MC/FDZE1QV3lRP8RO9FRR/QZqiLKLPU7iLOJ1ys9LF+lKkUqCD9RC1gl/lYMSDBFQElnx+00ZklSlccD35qmYD38HMG6xSn8oapySfhha829syVNxiz6fDx2GEKoBL934Q2MgAMv57rBjJ5i1ZF+afvxv0oA0HTGiWHvzcJCyfXMtxs5BRwnMO3ljC9JsEoADlK8D0wbzgf5eonXUfssp0ALMl0GC0g3aKjjiRe3/SF/sb9g9wIZoSwHX0vUwdnNFLdnUEiiIgBi1zgEAm2/qYMEs8fWUASsUt9EdoC3auQSuOhuOSQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: page_frag test module is an out of tree module, but built using KDIR as the main kernel tree, the mm test suite is just getting skipped if newly added page_frag test module fails to compile due to kernel not yet compiled. Fix the above problem by ensuring both kernel is built first and a newer kernel which has page_frag_cache.h is used. CC: Andrew Morton CC: Alexander Duyck CC: Linux-MM Fixes: 7fef0dec415c ("mm: page_frag: add a test module for page_frag") Fixes: 65941f10caf2 ("mm: move the page fragment allocator from page_alloc into its own file") Reported-by: Mark Brown Signed-off-by: Yunsheng Lin --- Mote, page_frag test module is only in the net-next tree for now, so target the net-next tree. --- tools/testing/selftests/mm/Makefile | 18 ++++++++++++++++++ tools/testing/selftests/mm/page_frag/Makefile | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index acec529baaca..04e04733fc8a 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -36,7 +36,16 @@ MAKEFLAGS += --no-builtin-rules CFLAGS = -Wall -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) $(TOOLS_INCLUDES) LDLIBS = -lrt -lpthread -lm +KDIR ?= /lib/modules/$(shell uname -r)/build +ifneq (,$(wildcard $(KDIR)/Module.symvers)) +ifneq (,$(wildcard $(KDIR)/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" +endif +else +PAGE_FRAG_WARNING = "missing Module.symvers, please have the kernel built first" +endif TEST_GEN_FILES = cow TEST_GEN_FILES += compaction_test @@ -214,3 +223,12 @@ warn_missing_liburing: echo "Warning: missing liburing support. Some tests will be skipped." ; \ echo endif + +ifneq ($(PAGE_FRAG_WARNING),) +all: warn_missing_page_frag + +warn_missing_page_frag: + @echo ; \ + echo "Warning: $(PAGE_FRAG_WARNING). page_frag test will be skipped." ; \ + echo +endif diff --git a/tools/testing/selftests/mm/page_frag/Makefile b/tools/testing/selftests/mm/page_frag/Makefile index 58dda74d50a3..8c8bb39ffa28 100644 --- a/tools/testing/selftests/mm/page_frag/Makefile +++ b/tools/testing/selftests/mm/page_frag/Makefile @@ -1,5 +1,5 @@ PAGE_FRAG_TEST_DIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))) -KDIR ?= $(abspath $(PAGE_FRAG_TEST_DIR)/../../../../..) +KDIR ?= /lib/modules/$(shell uname -r)/build ifeq ($(V),1) Q =