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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31350C47422 for ; Thu, 18 Jan 2024 21:28:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F1626B0072; Thu, 18 Jan 2024 16:28:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A19A6B0075; Thu, 18 Jan 2024 16:28:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 769A56B0082; Thu, 18 Jan 2024 16:28:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 673906B0072 for ; Thu, 18 Jan 2024 16:28:12 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D5DC6C06D9 for ; Thu, 18 Jan 2024 21:28:11 +0000 (UTC) X-FDA: 81693719982.03.041CD43 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf30.hostedemail.com (Postfix) with ESMTP id DCF3B8000D for ; Thu, 18 Jan 2024 21:28:09 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=TAsdPOjZ; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf30.hostedemail.com: domain of david@fromorbit.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705613290; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VfXI7DlSW6ALh9PfIlcP8DqohnuHMAHGyRd4yKfEq38=; b=s5LfPXK1tfbjvfo10FuUC+F9nuKlEy2emZGsV4qvqe7XLGev6w5X+2YImolqh/mHy7RqYY i/rsy613QB0AHfeDWOvTFOYG4dU2wPu6M1sbrvHijxKp0maxcSZpx+OyizqjxmIJZAksBj MAARMnp2KeO+VE6eCvPD4KpZqJ1vDk8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=TAsdPOjZ; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf30.hostedemail.com: domain of david@fromorbit.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705613290; a=rsa-sha256; cv=none; b=T49CodiiN6IaI2OgYufrZ7DYSbYJ0A6sWF3CmtGcC9XDUnS9vOcqzfngDzk8kgj3aBux7g KQ/gKJEI8H46R6hC2ITlU7rOb2TxLXg2U6cOcWdwsBZL1Tmb9AVU4jOI4vMEqOWLUUTtPf /rjoBsYykU2G8nsOX4mje+NQQ+pwntw= Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d70b0e521eso542435ad.1 for ; Thu, 18 Jan 2024 13:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1705613288; x=1706218088; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VfXI7DlSW6ALh9PfIlcP8DqohnuHMAHGyRd4yKfEq38=; b=TAsdPOjZrZhgphnMHnEipym9IK3YsuYwrSDgE5ExPCDFosuibx2/fv2FBt7V3aBPLB cuWhCctRlIcYVPa+V3xI3OCSvIJKTX0YJLoWobsaK1ZhIaGVMdDCIY9g/gOgBHgQyiAE QMzLEtjwCGVj2ZTUhjG7WVR1UJqUzBNOIOzJ/IGwp9j5Nz66dfk+IyzpuorPw281XMk1 K9wuQW7zEaAgeDYMCJMt4QSLkepmOubtSzcC63/h+NQv6Wp4ZMmS0WnU2k3vgE7yBFDk OrCc93JRB1cB7gVDZC6dPaisaEUwPhofI9bbNa2RHaJkL5M3KPfJxR7FqDuIP/JuRhQ4 aM2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705613288; x=1706218088; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VfXI7DlSW6ALh9PfIlcP8DqohnuHMAHGyRd4yKfEq38=; b=BcbJxTFizvvdjCGHB6zZ8qYHI0VIBTv8J5lbblYfN70AT8IBK1XvHR2AzlF3e1lzSq H3y4itQmtornGupLUmeyTjzN48f8CpRMlnI4MDTe0U+IY/7IB3aHiW7q2HmobWePcVQc m402NduRMfIHr2O9eQSp3IjE28ElRLRvpHLc/ZACUI4kLqUbpr4vrJT6oNSakSLhxrl/ 1xU41wOzdhBNy/1jXdHqFSJMk/WC1dELByXOEt4f/MDbsLYPWFAn5+F86Iw98/qHWkOM mRUFoN2uw8b3O4xhbGYRbQ73hJvqujjcUmnaSdWOa+BBWatxPhb8I19e7SKuxyvXSydO Qbfg== X-Gm-Message-State: AOJu0Yy4fgl141LwyBV1UASQpYlMPvRrzdAQS1uBFhCSLWMI4mUgzgHN nx0JdQYkLefn/hwS9IM2rQepBOPha0PkgBoneUpT52bo0dLlqifTuR88jh7VL1ugU/UpTJCBW5V E X-Google-Smtp-Source: AGHT+IEWphQifugTG5YpeZETo0xSFCI4jAza+OoIp4jZGWuGSdeybTelL15MNkAXe88QcyIPFXB/JA== X-Received: by 2002:a17:902:db03:b0:1d4:e308:d70b with SMTP id m3-20020a170902db0300b001d4e308d70bmr1649884plx.92.1705613288623; Thu, 18 Jan 2024 13:28:08 -0800 (PST) Received: from dread.disaster.area (pa49-180-249-6.pa.nsw.optusnet.com.au. [49.180.249.6]) by smtp.gmail.com with ESMTPSA id h4-20020a170902f7c400b001d70953f166sm1448711plw.155.2024.01.18.13.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 13:28:08 -0800 (PST) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1rQZvh-00CBNk-1c; Fri, 19 Jan 2024 08:28:05 +1100 Date: Fri, 19 Jan 2024 08:28:05 +1100 From: Dave Chinner To: Uladzislau Rezki Cc: linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Lorenzo Stoakes , Christoph Hellwig , Matthew Wilcox , "Liam R . Howlett" , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko Subject: Re: [PATCH v3 10/11] mm: vmalloc: Set nr_nodes based on CPUs in a system Message-ID: References: <20240102184633.748113-1-urezki@gmail.com> <20240102184633.748113-11-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: DCF3B8000D X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 65aggudzfsscjkaj99kt3o3arp9cohjx X-HE-Tag: 1705613289-648272 X-HE-Meta: U2FsdGVkX1/Y1bafWjQICzNvN7oZhN+n1M18ld+8sFa71Fjg3+SaJXRPsT7am9sePKiwnx5W+ENeIhV7CiX8P+PWbqcnE1KW3KsoLcMYxPSstJhHOXAT+cVPE/hrSDh1KhYGQGVa5IgAq9AYPZS5BZobVaVSi83U9j1NmXLo2RjUXU81NE1TO9lU6bYHiV24cYHMKJnMSjuQq/bZG23ERPFkxaTZVKoCf0L621rUEQEWe3WUbvDlWV79sq0Hdci+7mrKBDtbG+YSVIqRkMQGcvValypJitsvuXCnUklI9xC/7FBlpx5VAuM9O3+i1ux+hvvzl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9JNmwbJaCujJ6OuVfdBm7+BXZqTAymeXlTMgoMsB5BKTYtMRXGHu49+EDEa/k+wEkkMhZthmmtIjxGUp+iwv9ra1m5C3yEULU1inh7CZ8dohxsUGa/2BF1iCukfL51YQoZqiJnwYpiK2V+0KQ8CProLSOMXpGgSTtVqSA3nmCW92Ql1356DuwJWQ6JMntVK94osa4AYXjsKkP2hGpxdQ8a5ZBxs3ttQOT7A== 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: On Thu, Jan 18, 2024 at 07:23:47PM +0100, Uladzislau Rezki wrote: > On Wed, Jan 17, 2024 at 09:06:02AM +1100, Dave Chinner wrote: > > On Mon, Jan 15, 2024 at 08:09:29PM +0100, Uladzislau Rezki wrote: > > > We can easily set nr_nodes to num_possible_cpus() and let it scale for > > > anyone. But before doing this, i would like to give it a try as a first > > > step because i have not tested it well on really big NUMA systems. > > > > I don't think you need to have large NUMA systems to test it. We > > have the "fakenuma" feature for a reason. Essentially, once you > > have enough CPU cores that catastrophic lock contention can be > > generated in a fast path (can take as few as 4-5 CPU cores), then > > you can effectively test NUMA scalability with fakenuma by creating > > nodes with >=8 CPUs each. > > > > This is how I've done testing of numa aware algorithms (like > > shrinkers!) for the past decade - I haven't had direct access to a > > big NUMA machine since 2008, yet it's relatively trivial to test > > NUMA based scalability algorithms without them these days. > > > I see your point. NUMA-aware scalability require reworking adding extra > layer that allows such scaling. > > If the socket has 256 CPUs, how do scale VAs inside that node among > those CPUs? It's called "sub-numa clustering" and is a bios option that presents large core count CPU packages as multiple NUMA nodes. See: https://www.intel.com/content/www/us/en/developer/articles/technical/fourth-generation-xeon-scalable-family-overview.html Essentially, large core count CPUs are a cluster of smaller core groups with their own resources and memory controllers. This is how they are laid out either on a single die (intel) or as a collection of smaller dies (AMD compute complexes) that are tied together by the interconnect between the LLCs and memory controllers. They only appear as a "unified" CPU because they are configured that way by the bios, but can also be configured to actually expose their inner non-uniform memory access topology for operating systems and application stacks that are NUMA aware (like Linux). This means a "256 core" CPU would probably present as 16 smaller 16 core CPUs each with their own L1/2/3 caches and memory controllers. IOWs, a single socket appears to the kernel as a 16 node NUMA system with 16 cores per node. Most NUMA aware scalability algorithms will work just fine with this sort setup - it's just another set of numbers in the NUMA distance table... Cheers, Dave. -- Dave Chinner david@fromorbit.com