From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0217C27C4F for ; Wed, 26 Jun 2024 07:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D/KmU49bSK2f1dkz3wN9bROIyjbj1ub9oayTFJQUxAk=; b=FvE3JD1pDu4WHAoLXKzssxjG1w MfbVOTxu2CAuTn1F3+nh8qMMVft/12KxjWpd6u1NeGIaOvtwObgk1E3zpAvTj0D56V54s7SEJ8AvX AuQa7ApLKybyiztPiGKPhwh6yfX7dqcOtQd2wedAqid5cfvivfEDgEkzLzmRjlYUXdEBV4dVlHS4N Nxiw55/BhpYL+CU+M/XzOQEsAcMxFMZHOA6nQQhRTEizgQIpt6RIenHAtkbdOsr7/Zn91KWZqTHq8 p1g3Si4VJwY5ymAN1DKjEYH5ZvPcRnf7CvUDiXW5bteBWqA/PszFVZnDPIcNrGLgzbITvDjM4ZZo9 i8VB57KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNFL-00000005lxU-2tib; Wed, 26 Jun 2024 07:39:15 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNFC-00000005ltF-2KS1 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 07:39:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8588760B72; Wed, 26 Jun 2024 07:39:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B218CC4AF07; Wed, 26 Jun 2024 07:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719387545; bh=obMllH7JVqZ5QKsgwKwdcDXXw5cA9IXGchQ3KcBiTrw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UgbXCGIP7kq6Rg3W+N4kyshjEVXDwN6ZmG2QUYwryIh+0cJGYQmKw3hXZe5leu9nI mChltdU0PP7YOSEitwBrlsXtygsMIuokFqeiJqtRJKmg9YUHSE5QiSyjOB+Ylt51dV qMMfyCZxqbBkKCSAZe8n0AAmgxIg6Sm1CFH0RLTE= Date: Wed, 26 Jun 2024 09:39:10 +0200 From: Greg Kroah-Hartman To: Tvrtko Ursulin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, =?iso-8859-1?Q?Ma=EDra?= Canal , Tvrtko Ursulin , Catalin Marinas , Will Deacon Subject: Re: [PATCH 1/2] numa: Add simple generic NUMA emulation Message-ID: <2024062658-unmasked-degree-2f80@gregkh> References: <20240625125803.38038-1-tursulin@igalia.com> <20240625125803.38038-2-tursulin@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240625125803.38038-2-tursulin@igalia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_003906_746762_FA557B6B X-CRM114-Status: GOOD ( 20.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 25, 2024 at 01:58:02PM +0100, Tvrtko Ursulin wrote: > From: Maíra Canal > > Add some common code for splitting the memory into N emulated NUMA memory > nodes. > > Individual architecture can then enable selecting this option and use the > existing numa=fake= kernel argument to enable it. > > Memory is always split into equally sized chunks. > > Signed-off-by: Maíra Canal > Signed-off-by: Tvrtko Ursulin > Co-developed-by: Tvrtko Ursulin > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Greg Kroah-Hartman > Cc: “Rafael J. Wysocki" > --- > drivers/base/Kconfig | 7 ++++ > drivers/base/Makefile | 1 + > drivers/base/arch_numa.c | 6 ++++ > drivers/base/numa_emulation.c | 67 +++++++++++++++++++++++++++++++++++ > drivers/base/numa_emulation.h | 21 +++++++++++ > 5 files changed, 102 insertions(+) > create mode 100644 drivers/base/numa_emulation.c > create mode 100644 drivers/base/numa_emulation.h > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index 2b8fd6bb7da0..1f60cd4dd057 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -230,6 +230,13 @@ config GENERIC_ARCH_NUMA > Enable support for generic NUMA implementation. Currently, RISC-V > and ARM64 use it. > > +config GENERIC_ARCH_NUMA_EMULATION > + bool > + depends on GENERIC_ARCH_NUMA > + help > + Enable NUMA emulation. Note that NUMA emulation will only be used if > + the machine has no NUMA node. > + > config FW_DEVLINK_SYNC_STATE_TIMEOUT > bool "sync_state() behavior defaults to timeout instead of strict" > help > diff --git a/drivers/base/Makefile b/drivers/base/Makefile > index 3079bfe53d04..34fcf5bd7370 100644 > --- a/drivers/base/Makefile > +++ b/drivers/base/Makefile > @@ -25,6 +25,7 @@ obj-$(CONFIG_DEV_COREDUMP) += devcoredump.o > obj-$(CONFIG_GENERIC_MSI_IRQ) += platform-msi.o > obj-$(CONFIG_GENERIC_ARCH_TOPOLOGY) += arch_topology.o > obj-$(CONFIG_GENERIC_ARCH_NUMA) += arch_numa.o > +obj-$(CONFIG_GENERIC_ARCH_NUMA_EMULATION) += numa_emulation.o > obj-$(CONFIG_ACPI) += physical_location.o > > obj-y += test/ > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > index 5b59d133b6af..6ad08f681b3c 100644 > --- a/drivers/base/arch_numa.c > +++ b/drivers/base/arch_numa.c > @@ -15,6 +15,8 @@ > > #include > > +#include "numa_emulation.h" > + > struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; > EXPORT_SYMBOL(node_data); > nodemask_t numa_nodes_parsed __initdata; > @@ -30,6 +32,8 @@ static __init int numa_parse_early_param(char *opt) > return -EINVAL; > if (str_has_prefix(opt, "off")) > numa_off = true; > + if (str_has_prefix(opt, "fake=")) > + return numa_emu_cmdline(opt + 5); You did not document this at all :(