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 EC27ECD1292 for ; Thu, 11 Apr 2024 07:54:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D2CE6B009D; Thu, 11 Apr 2024 03:54:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 782B16B009F; Thu, 11 Apr 2024 03:54:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62F616B00A2; Thu, 11 Apr 2024 03:54:40 -0400 (EDT) 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 43E756B009D for ; Thu, 11 Apr 2024 03:54:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0390340A67 for ; Thu, 11 Apr 2024 07:54:39 +0000 (UTC) X-FDA: 81996489120.04.94D5228 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id D99C0180011 for ; Thu, 11 Apr 2024 07:54:37 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NIfUs1xS; spf=pass (imf24.hostedemail.com: domain of vbendel@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vbendel@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712822078; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gxDRipmzDDBkSip6m/UVrfqyWqi0BJV7Yyl6Xvbo+6E=; b=KCJVSN9hnQSmzEFfAWo5AwHm2WsPNFkyUPknsYuchTH2hxBQ5Vclj3LpUhYyGHUa7iWBq3 WjcHZssCJbvwpxuF6539tnPSGLE+TEr2mha7hfTKDotS0IiKLaNiesHeXcEJ//0NXb1W40 zIVACC2+mGs01KI0efC8jNLMKkL9EcA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712822078; a=rsa-sha256; cv=none; b=8KvsSDr/v8/t/9fhqpnfjsN4CuFuCXQso3qAgP4VAyyDU8rYkET1IYUdy8wMo0hn2qcWVG a7+nIIZ/nr4pVzo9DrO1hUDIs8XzbIHuryMiV6KMm/2pbwrwvfc1/lAUgDVR+V+DQeMFLu oyoIJL6X1DBTQWtVjSrm30rQk8MFkQk= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NIfUs1xS; spf=pass (imf24.hostedemail.com: domain of vbendel@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=vbendel@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712822077; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gxDRipmzDDBkSip6m/UVrfqyWqi0BJV7Yyl6Xvbo+6E=; b=NIfUs1xSlJNu0kCvawMt43rf+V9HRJmVVzXmoiAJsK8exkQVs1jEIEw4dBzGjvUkaHbZNg tb89vEgpXbTfB41JX5UXFhwny3dD6tySAVet1b2x9f8bB8j+gTmzsAuF07PWePaIaAKRy6 01epJmWSH+kdIKXY4dMsY300+fM9pwQ= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-519-W2wNo4VUMGi8SlQenn_1OQ-1; Thu, 11 Apr 2024 03:54:35 -0400 X-MC-Unique: W2wNo4VUMGi8SlQenn_1OQ-1 Received: by mail-yb1-f197.google.com with SMTP id 3f1490d57ef6-dc691f1f83aso300983276.1 for ; Thu, 11 Apr 2024 00:54:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712822075; x=1713426875; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gxDRipmzDDBkSip6m/UVrfqyWqi0BJV7Yyl6Xvbo+6E=; b=wuTiWq0wNIACbv2s3+pP+Xg9g0UHDnV1zrcByKPpG9N3y8gAlL6tfycxcxzKQKP845 cb2cUJ7SiUj5vWkr9/osyd5Q8wJVDAWtF04ET309WtHTwKS8m34o1idIP8j1293gYN2n JmOzbJ1TIA2f980+jIwTL68pjcOvcbG0a2ZiSA5Aoq6uQIGzWdJX0EL/c/J/vfqLZJSN +5KYYvsYm/gt2zmAa5o5IYNHR6YnH02jTVeCD+pSa/Y9tIAV7yWrEcczMayjGCszryX+ 74ObUlT1Tpz6nPVugJww8LmSbNiwEDUHr50u9qOXfUditqoQLNVrvcSnUg+Z8BzY6AhZ 1ibw== X-Forwarded-Encrypted: i=1; AJvYcCUi8H7U501zyRdAGhAm8RqE2x1kaHDCpp/VZmT14lauoKK80WJmnGC1PBCA02dhkzhgA5v/UcNaBa2B7dLoA/+YHSY= X-Gm-Message-State: AOJu0YxIUOEeg1rsf3J07wQ7VKfRo+YSnhHURuXjrMgWLada4w9kUvRM AEadsr7b3d3aIeQkByRIYNW15eLTX/ViBaLiXbSeWLDuvkM55Pqed09dH74mGc92bzrX3eqcRth cZYScjwLWgZcMOAFEUD7JiGhvB/Bmq6SHA1Wejesd0KlCx1zzVWcA2c/2a3hZs7u6Bh3A1k2aSb y5GuJX7+eU1FKa1B8yJPZggOY= X-Received: by 2002:a25:cd82:0:b0:dc6:ca3a:31da with SMTP id d124-20020a25cd82000000b00dc6ca3a31damr1446416ybf.16.1712822075236; Thu, 11 Apr 2024 00:54:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4/VROz6VRwtxqGZSnsbr8an7LRWsYWB4kGZ99T+tllX8qYXGWqrOEg5CQ+iJUfbEzOcupJtkqlQIST/p0M3k= X-Received: by 2002:a25:cd82:0:b0:dc6:ca3a:31da with SMTP id d124-20020a25cd82000000b00dc6ca3a31damr1446407ybf.16.1712822074917; Thu, 11 Apr 2024 00:54:34 -0700 (PDT) MIME-Version: 1.0 References: <20240405164920.2844-1-mcassell411@gmail.com> In-Reply-To: <20240405164920.2844-1-mcassell411@gmail.com> From: Vratislav Bendel Date: Thu, 11 Apr 2024 09:54:18 +0200 Message-ID: Subject: Re: [PATCH] Documentation/admin-guide/sysctl/vm.rst adding the importance of NUMA-node count to documentation To: Matthew Cassell Cc: corbet@lwn.net, akpm@linux-foundation.org, rppt@kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D99C0180011 X-Rspam-User: X-Stat-Signature: qy8e8rfes5xkp4nqk9tykczf6o3gi4ax X-Rspamd-Server: rspam03 X-HE-Tag: 1712822077-695148 X-HE-Meta: U2FsdGVkX18uT/UlQqFcoaZxGFLw3wZ8cTPWbibvYU9TXq/jJXs/araRvkASrR1BpLe0MWQMFVhmMOIVLmemSdTFDqE/ZOsBac1luDxm/gLxvNDQEiUfFEPVh6Ixi92YLt/vqwhHIoy+QQhTkL6RZzWpJhz+XQs24JUGeyshFwDm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EB55GHwJ/i8= 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 Fri, Apr 5, 2024 at 6:49=E2=80=AFPM Matthew Cassell wrote: > > If any bits are set in node_reclaim_mode (tunable via > /proc/sys/vm/zone_reclaim_mode) within get_pages_from_freelist(), then > page allocations start getting early access to reclaim via the > node_reclaim() code path when memory pressure increases. This behavior > provides the most optimization for multiple NUMA node machines. The above > is mentioned in: > > Commit 9eeff2395e3cfd05c9b2e6 ("[PATCH] Zone reclaim: Reclaim logic") > states "Zone reclaim is of particular importance for NUMA machines. It > can be more beneficial to reclaim a page than taking the performance > penalties that come with allocating a page on a REMOTE zone." > > While the pros/cons of staying on node versus allocating remotely are > mentioned in commit histories and mailing lists. It isn't specifically > mentioned in Documentation/ and isn't possible with a lone node. Imagine = a > situation where CONFIG_NUMA=3Dy (the default on most major distributions) > and only a single NUMA node exists. The latter is an oxymoron > (single-node =3D=3D uniform memory access). Informing the user via vm.rst= that > the most bang for their buck is when multiple nodes exist seems helpful. > I agree that the documentation could be improved to better express the implications and relevance of setting zone_reclaim_mode bits. Though I would suggest to go a step further and also elaborate on those "additional actions", for example something like: "The page allocator will attempt to reclaim memory within the zone, depending on the bits set, before looking for free pages in other zones, namely on remote memory nodes= ." > Signed-off-by: Matthew Cassell > --- > Documentation/admin-guide/sysctl/vm.rst | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admi= n-guide/sysctl/vm.rst > index c59889de122b..10270548af2a 100644 > --- a/Documentation/admin-guide/sysctl/vm.rst > +++ b/Documentation/admin-guide/sysctl/vm.rst > @@ -1031,7 +1031,8 @@ Consider enabling one or more zone_reclaim mode bit= s if it's known that the > workload is partitioned such that each partition fits within a NUMA node > and that accessing remote memory would cause a measurable performance > reduction. The page allocator will take additional actions before > -allocating off node pages. > +allocating off node pages. Keep in mind enabling bits in zone_reclaim_mo= de > +makes the most sense for topologies consisting of multiple NUMA nodes. > > Allowing zone reclaim to write out pages stops processes that are > writing large amounts of data from dirtying pages on other nodes. Zone > -- > 2.34.1 >