From patchwork Thu Dec 14 12:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 13493004 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 AC2D6C4167B for ; Thu, 14 Dec 2023 12:51:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31A908D00AE; Thu, 14 Dec 2023 07:51:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2954B8D00A2; Thu, 14 Dec 2023 07:51:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1359E8D00AE; Thu, 14 Dec 2023 07:51:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EF7308D00A2 for ; Thu, 14 Dec 2023 07:51:45 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D278D40203 for ; Thu, 14 Dec 2023 12:51:45 +0000 (UTC) X-FDA: 81565410570.23.832ED92 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf30.hostedemail.com (Postfix) with ESMTP id 017DD80017 for ; Thu, 14 Dec 2023 12:51:43 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="EkLTR/rt"; spf=pass (imf30.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=laoar.shao@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=1702558304; 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:in-reply-to:references:references:dkim-signature; bh=5FXGf9L1hz/wQQ/jUv0sNTidQzM378s4gfN4y5IQE/M=; b=H/O7i93YSYh82eB/47CkGYTZxmPR9/idbdr7efPZrjsIQ1LSmCJA9LQ4axec/M1/L5Ajpb thctt3OMzG04TFLZQTex/L1HVqR4NgI+nc5KcyRx1vQ3uHM4nJ42CmjkxWyyqYIP7kIDbe ETfsRmgPX8WB6Rx+Ev2YoixQBkHQfS8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702558304; a=rsa-sha256; cv=none; b=gmvaGav0oRJqtD9Ak/iDRWevtgwGiLfpY4D7yqmDA/Pd9/Zxs99qxwMHcwTTGGhNorM0rf zukh5LG2F1MV47WwL3SvjdPLJ9PUE1rifMsLC8OFc/OmW5wonCp1x5EqDfsxPPkFMKiHuW LG36DEHAels2z2RXkNs6HCNHLRQJeq8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="EkLTR/rt"; spf=pass (imf30.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1d04c097e34so4635155ad.0 for ; Thu, 14 Dec 2023 04:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702558303; x=1703163103; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5FXGf9L1hz/wQQ/jUv0sNTidQzM378s4gfN4y5IQE/M=; b=EkLTR/rto/OE6s431A9AUk2yPzCRqxhTuKz1nNEZTxYe+eHpSh5myJKfIpthHsJOy2 uIcEbz3Qte0faCt8Z0b29SddAxlLKCifjIcJXzkBr5oMT3K2q7WVWie6jdSr/pkxk5iC UNlxTbmvPUG7m+mfXz9fIQyB/nBmOR6VDpvZ8tfZEQIEJDJPLGHouPMr+et83BVVDXOq v5+tMjHt6xKbVhI5ZN0dg93Y8s/pj7F91G0SgUN6aSIS+xtG6OGlf5IX7TmD0feouIfT rh2C7QxQWv2yD0cU2+YH0eHR9iRkHDBK1J7/VY6PAYwoCpc0uz/nvW2RmXP/PcO3+FXd ejIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702558303; x=1703163103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5FXGf9L1hz/wQQ/jUv0sNTidQzM378s4gfN4y5IQE/M=; b=ozk3X5J6H3eidnIszsCT5KN0RaXIQl4GmZUypSoOJaPt0GEw8qNwNyYpYeS1ntjJ4q Bv06FvfWT7jrf/LUzbPi/DcJqXA233l574rQFrM+vPusfV/nWA+mwGlga2Op6hCEmzre oda9oAoa/DlrgJ1CjM6g9mFY6NBZzPWZTNdzrI7yy+VnMefXt8NDdT1CmElu8Q3mj7ri dvARCb2uar7QRDkX5XVp86BJnWwkAEURbCr7qHBnZAbp2xlGFwRA5SlciIdp4uIYoDS1 OECRtMvPVX8UQqYL3ON8naiCUuHnty2NvQa81AHm8g+pTRd7fhvCq0e4MZpw5jRQoSzx khXg== X-Gm-Message-State: AOJu0Yy9MV0BBpFIxM7FLBy+cYHsZky6DMv0nzB0NbLeV4hAyIr5bkrr +rkp+eBDxm4LRBHaFW156B0= X-Google-Smtp-Source: AGHT+IGun9zwMBNgulopQ02olJANVXRIqTshnpV14IXmUgWVJbUSdBEHOhQ1kCfxytlwL/jT6XC2+A== X-Received: by 2002:a17:902:c98a:b0:1d3:71dc:b3f with SMTP id g10-20020a170902c98a00b001d371dc0b3fmr434698plc.36.1702558302859; Thu, 14 Dec 2023 04:51:42 -0800 (PST) Received: from vultr.guest ([149.28.194.201]) by smtp.gmail.com with ESMTPSA id jj17-20020a170903049100b001d36b2e3dddsm1184528plb.192.2023.12.14.04.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:51:42 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, omosnace@redhat.com, casey@schaufler-ca.com, kpsingh@kernel.org, mhocko@suse.com, ying.huang@intel.com Cc: linux-mm@kvack.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, ligang.bdlg@bytedance.com, Yafang Shao Subject: [PATCH v5 bpf-next 1/5] mm, doc: Add doc for MPOL_F_NUMA_BALANCING Date: Thu, 14 Dec 2023 12:50:29 +0000 Message-Id: <20231214125033.4158-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231214125033.4158-1-laoar.shao@gmail.com> References: <20231214125033.4158-1-laoar.shao@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 017DD80017 X-Rspam-User: X-Stat-Signature: 6f8ditdgkaow9p17jrtoswhqhybwm9dm X-Rspamd-Server: rspam03 X-HE-Tag: 1702558303-203883 X-HE-Meta: U2FsdGVkX1+o/OagF6ef4b1oHackgFPa3b8ejYiviI4RvY43FuH6SF7St3/F5aLyBGBcqw6gYcsh7FWZGcygkDRlDG9zC+xMnF7qznNUCUPh3ndWOh7jtIRCWnD24mGvJZXG1ytb4zAcFGPcu4IMnW+R/Ylf2zzPldM//q06xcZW2QKOwyOPKc/XqJe+I0roGT2hfvcIPWtZKF2N2493BGC2Umx/5qFWfHMBUJTfSo7QX9X2gA2EzO/lXrXR1+gl6ovJ5kXVoIH1MuciylI6ghkc+phIew8FvfI0TrqTaBEpkyfOg9oHwTud5GAsbV9youNYRSzRGlcLqpKokE2Qwdy3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7OsHREK7RjHTesaMEdQTD9pU1odZwSTPRRBYO8bbmlaTf13SNNhmy01WatjGLKuL2jNUNGFet6oloSV+BY7FNago+q18/+yBtJKavylmD88/ph4RsCgvHjcm/GJCDIAELDOfUb+FVm1dN4qN+cqGxLgg7mz7GU5amnSAallTvUbJJ9t3M= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The document on MPOL_F_NUMA_BALANCING was missed in the initial commit The MPOL_F_NUMA_BALANCING document was inadvertently omitted from the initial commit bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes") Let's ensure its inclusion. Signed-off-by: Yafang Shao Reviewed-by: "Huang, Ying" --- .../admin-guide/mm/numa_memory_policy.rst | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/admin-guide/mm/numa_memory_policy.rst b/Documentation/admin-guide/mm/numa_memory_policy.rst index eca38fa..19071b71 100644 --- a/Documentation/admin-guide/mm/numa_memory_policy.rst +++ b/Documentation/admin-guide/mm/numa_memory_policy.rst @@ -332,6 +332,33 @@ MPOL_F_RELATIVE_NODES MPOL_PREFERRED policies that were created with an empty nodemask (local allocation). +MPOL_F_NUMA_BALANCING (since Linux 5.12) + When operating in MPOL_BIND mode, enables NUMA balancing for tasks, + contingent upon kernel support. This feature optimizes page + placement within the confines of the specified memory binding + policy. The addition of the MPOL_F_NUMA_BALANCING flag augments the + control mechanism for NUMA balancing: + + - The sysctl knob numa_balancing governs global activation or + deactivation of NUMA balancing. + + - Even if sysctl numa_balancing is enabled, NUMA balancing remains + disabled by default for memory areas or applications utilizing + explicit memory policies. + + - The MPOL_F_NUMA_BALANCING flag facilitates NUMA balancing + activation for applications employing explicit memory policies + (MPOL_BIND). + + This flags enables various optimizations for page placement through + NUMA balancing. For instance, when an application's memory is bound + to multiple nodes (MPOL_BIND), the hint page fault handler attempts + to migrate accessed pages to reduce cross-node access if the + accessing node aligns with the policy nodemask. + + If the flag isn't supported by the kernel, or is used with mode + other than MPOL_BIND, -1 is returned and errno is set to EINVAL. + Memory Policy Reference Counting ================================