Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7103914rdb; Fri, 15 Dec 2023 19:28:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRIAfkq2XROmkn46IISRJ/d7bCI7KpBzm9Jnd+ojWD/rWLTxUD37NDrNDiXipbhn8UyBLV X-Received: by 2002:a05:6808:2f15:b0:3b9:f621:b1f7 with SMTP id gu21-20020a0568082f1500b003b9f621b1f7mr20710041oib.98.1702697295250; Fri, 15 Dec 2023 19:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702697295; cv=none; d=google.com; s=arc-20160816; b=EchPafMyYu3+evuOK6htFs0BsaXVjc1Jeoy7+WOlOCG+eNrJ+qUZrH4ZvWk8DMP2Qb /QRxQNWit/aBJ0OkUGTTDS/p1JCDxfOYUiQHnkKCLlxxPV3y6U1txZCePTJBQCffGVH5 2X1Svj6QlM0BOebT6mn2cR/iTxtO6VyO7i1gbcHoJTkMzj8sGwLziSsq50LpBV94WIr7 CXFrIVgo1tSHvgSYGMffsR5rV1QOylWrTuHr+JnHGEeWGvM3B6MsoL2y+F1Wpe/awqCt smbzrCqgvykb3fadQNs9GcnuKWsKY7ucxzJxsfLTbxpq2nkxLLns4fCyo9CgCS/Cd2lb 1nvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lSEfcPVLSVdGjudbUJ8Sggq3p7WbAaRsO8gXu0Omim0=; fh=vHhjxHftTECn/hRvIWNlq1eDzDsn74Roqz0kmRcPgcE=; b=coZBevZN8OvEaK+jL1r2KEH8EUvHOQjyrZGHydCZxhHUiN82njSWMmzR4A+Ly4+mUx BSZGx46B+XlYB93K9Vy8X9zkmm9A1Hi5j1Q8mm3sPDupHpyjVaLgmy9ICGNgnXJTBe2E JvTt8oqhA3sllFmSUZVAMw/MOxfvZsbLydPTSPdu/W6QTqoDEbSGqZVQpPCbP0zj87T+ qTzcc0bYMQwjWfSIhZklhSqqsa6xHTn8GdIvdZUr9BS6FDSlcdzjiDLQPcs8rqSef8h2 ajUmoOey/eEkUzprRkNvu/dTa+CAEw9jDzyIlu53q+bcL1e64W6ZyRAongmwrm+0SvZb KNNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wEL1M8P7; spf=pass (google.com: domain of linux-kernel+bounces-1990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fm4-20020a056a002f8400b006d2f64c805bsi464545pfb.56.2023.12.15.19.28.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 19:28:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wEL1M8P7; spf=pass (google.com: domain of linux-kernel+bounces-1990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D67302865EF for ; Sat, 16 Dec 2023 03:28:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 632D914292; Sat, 16 Dec 2023 03:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wEL1M8P7" X-Original-To: linux-kernel@vger.kernel.org Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 4EEF012B95 for ; Sat, 16 Dec 2023 03:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702697229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lSEfcPVLSVdGjudbUJ8Sggq3p7WbAaRsO8gXu0Omim0=; b=wEL1M8P7dGXDYkqa7TZ0623+1nRbflZcjURNMTTrfHumsxxvoj66ZAcvpFCSzlBCmznGOS ShvM+xfySrI3hUK03bi1hMOQo88TQq4lz2lpKcqo9kn0Iqn4roIrmWzq8nWh/E7pzm5vVj gHdLwG+8+qW+yBjQLDhmmlyg1zl3eKY= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Kent Overstreet , tglx@linutronix.de, x86@kernel.org, tj@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, paulmck@kernel.org, keescook@chromium.org, dave.hansen@linux.intel.com, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, brauner@kernel.org Subject: [PATCH 15/50] kernel/numa.c: Move logging out of numa.h Date: Fri, 15 Dec 2023 22:26:14 -0500 Message-ID: <20231216032651.3553101-5-kent.overstreet@linux.dev> In-Reply-To: <20231216032651.3553101-1-kent.overstreet@linux.dev> References: <20231216024834.3510073-1-kent.overstreet@linux.dev> <20231216032651.3553101-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Moving these stub functions to a .c file means we can kill a sched.h dependency on printk.h. Signed-off-by: Kent Overstreet --- include/linux/numa.h | 18 +++++------------- kernel/Makefile | 1 + kernel/numa.c | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 kernel/numa.c diff --git a/include/linux/numa.h b/include/linux/numa.h index a904861de800..aeab3d9f57ae 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h @@ -22,34 +22,26 @@ #endif #ifdef CONFIG_NUMA -#include #include /* Generic implementation available */ int numa_nearest_node(int node, unsigned int state); #ifndef memory_add_physaddr_to_nid -static inline int memory_add_physaddr_to_nid(u64 start) -{ - pr_info_once("Unknown online node for memory at 0x%llx, assuming node 0\n", - start); - return 0; -} +int memory_add_physaddr_to_nid(u64 start); #endif + #ifndef phys_to_target_node -static inline int phys_to_target_node(u64 start) -{ - pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n", - start); - return 0; -} +int phys_to_target_node(u64 start); #endif + #ifndef numa_fill_memblks static inline int __init numa_fill_memblks(u64 start, u64 end) { return NUMA_NO_MEMBLK; } #endif + #else /* !CONFIG_NUMA */ static inline int numa_nearest_node(int node, unsigned int state) { diff --git a/kernel/Makefile b/kernel/Makefile index 3947122d618b..ce105a5558fc 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -114,6 +114,7 @@ obj-$(CONFIG_SHADOW_CALL_STACK) += scs.o obj-$(CONFIG_HAVE_STATIC_CALL) += static_call.o obj-$(CONFIG_HAVE_STATIC_CALL_INLINE) += static_call_inline.o obj-$(CONFIG_CFI_CLANG) += cfi.o +obj-$(CONFIG_NUMA) += numa.o obj-$(CONFIG_PERF_EVENTS) += events/ diff --git a/kernel/numa.c b/kernel/numa.c new file mode 100644 index 000000000000..c24c72f45989 --- /dev/null +++ b/kernel/numa.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include + +/* Stub functions: */ + +#ifndef memory_add_physaddr_to_nid +int memory_add_physaddr_to_nid(u64 start) +{ + pr_info_once("Unknown online node for memory at 0x%llx, assuming node 0\n", + start); + return 0; +} +#endif + +#ifndef phys_to_target_node +int phys_to_target_node(u64 start) +{ + pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n", + start); + return 0; +} +#endif -- 2.43.0