From patchwork Fri Dec 1 09:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 13475551 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 4BAEDC10F04 for ; Fri, 1 Dec 2023 09:47:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E77366B043E; Fri, 1 Dec 2023 04:47:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E27876B0441; Fri, 1 Dec 2023 04:47:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF0656B0442; Fri, 1 Dec 2023 04:47:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B1CCD6B0441 for ; Fri, 1 Dec 2023 04:47:10 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8D6061A011C for ; Fri, 1 Dec 2023 09:47:10 +0000 (UTC) X-FDA: 81517771020.05.B65F78F Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by imf19.hostedemail.com (Postfix) with ESMTP id C8A701A0029 for ; Fri, 1 Dec 2023 09:47:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=C7rYB5PY; spf=pass (imf19.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.215.169 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=1701424028; 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=mmx346GI6fqI6wzgBEPg9Fgvbs5eLVjahXLFcCzrycE=; b=FutRQxl2vGMYKV2GALoeaCqj1obkKUBx6Pww2P+FWMYDWmHfBQEcfJuL0dBIAW5dEebegP fNtWPMI48VmjHZnitoRq7izLMWfH04fVQLVW3aFa0ecyjzhiKCLca60o17jOFOLTq8RL79 //tqW5P+RolNpsSgHsds+DLxHu8YIFM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=C7rYB5PY; spf=pass (imf19.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701424028; a=rsa-sha256; cv=none; b=MJbziOsbq3Qf3QKRoacMgR+VtB2gjGCipQ03dIQwF1q2Mcvr14CCMeFujMsPT0t7y9xfz3 73g1TWiFdmkkynYrxNf06CoTDm3hxuC01J01myl+Qpju4LODOW//hykMdIoYUTWjJf9EOS EyXDNmV1Eaz4ikW83iU9d0DO/YycEsQ= Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5c1f8b0c149so243756a12.3 for ; Fri, 01 Dec 2023 01:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701424027; x=1702028827; 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=mmx346GI6fqI6wzgBEPg9Fgvbs5eLVjahXLFcCzrycE=; b=C7rYB5PY6h0MOzNy6316JIk88wbgoKPoTAgygPr/GXhRK1nOUpxIis8WvkZDrELfWv dEjqE0UFxeAtpHOV6ZtPlifr4fZbKKBEenp2Anxzm5bfRGpJ8Q93iWS/MDW8JE8Qs6v0 ksG/EWrUXbcpTEK+suIMhHX9xR1s8t+9Gd84FZ1owlt5ZDQ+GsKyRFBxX6kpDZNe39D3 mjndem2tAG65PmYMx7yYjuuFjewrHKS29JSKffE1/oMW5IJ7JHnELA/rr4kgfIlxpmX/ UzqYDoUM4Y40vsGzBlqqOy/mIXY6QCj/gaw2rWk3ibqIEhoD9DKUNHCBM254HIgTAELr XT7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701424027; x=1702028827; 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=mmx346GI6fqI6wzgBEPg9Fgvbs5eLVjahXLFcCzrycE=; b=LxYzDRyL+vGtXzb7bMgre3KrqQ93McnpntanvPsG0Q2pRikVZERbSt/5HU0dZJGA7I TqHcHgDBSbb4a5BADcvFlj5uM+B+VbPq3IEh0aCE0Y1AOBHoc5GWiC3jQ6I5nsYFJaU0 NdWGkuL7VaYsjlNobivIxewmAlD+36l8n2yfycvPhzSMGTMVlsYN6fZ1VvgiP3zpjwLY 6qX5E9lhVTydjwRikOTFIFl+03nMz2f01ORqEM/WpiIP0ckoZ/jWuyDZ91IyuYlayK8K NGja9+ftvXfsIKzvnQ2MQ2nQioG94zLfSUcnSVi88968zyaFJHaStsTcC9udOLJH1f9h 3mdA== X-Gm-Message-State: AOJu0YxX2AagjORiRa7t2ahX6o4O7Bq/LoebC7B42ZZdIhksaRaRYoiW wuDrfq1N5Kb1YZFBFAO0xz8= X-Google-Smtp-Source: AGHT+IFigdK8sQwXucIFYeMm2TxPUV3X4nzFGv3uOLyaN6ywOAWNYbjC0TurnvUFhtxnQN/TgABwqA== X-Received: by 2002:a05:6a20:5521:b0:187:f7ac:b8d5 with SMTP id ko33-20020a056a20552100b00187f7acb8d5mr20361920pzb.25.1701424027584; Fri, 01 Dec 2023 01:47:07 -0800 (PST) Received: from vultr.guest ([149.28.194.201]) by smtp.gmail.com with ESMTPSA id e6-20020a170902b78600b001bdd7579b5dsm2875534pls.240.2023.12.01.01.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:47:07 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, omosnace@redhat.com, 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 v3 1/7] mm, doc: Add doc for MPOL_F_NUMA_BALANCING Date: Fri, 1 Dec 2023 09:46:30 +0000 Message-Id: <20231201094636.19770-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231201094636.19770-1-laoar.shao@gmail.com> References: <20231201094636.19770-1-laoar.shao@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C8A701A0029 X-Rspam-User: X-Stat-Signature: 4u5omqsbikqd16bn69hno6ofhe8i88mp X-Rspamd-Server: rspam01 X-HE-Tag: 1701424028-590434 X-HE-Meta: U2FsdGVkX1+02HbU5WypDHdracdK7a0Dhg1q/rAKOtrvXjJrxB0IDndFWtwodEzqMRtNKfO6YfAw8ExPUzgjUTFSW+zzR+KJ4uaFWrBrOhTCrtwQfGiI9WXCwVnK7z+8iDOSi+OnPOhXLGAd2hkaGr8R+hSqAIcswEXOMl93DWrWciObgYb6jwnYMnplzVhbiR2MY5uCqnH7DxrQzFeUWxioeBez9U85usrugz/voFpn6aLKP8qup66RDpF4I5RQ/mFNQljpkh0EhG6rDCvCSjHzWtgyslJGEZmaMsg7xSxqRgslNFv8ACh3bcxLLCbWXn7WKA4BDKOmJEj8vDGXW4SBcC3rfnZVGHcB/8jPaAYcH+wBSVC7SGKhlTS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sA5I56sSl5XKjzGnemdCgZ8tgq885Ul1iWTnMbm42DDsnnfGhQ/KjD8/63HefzfwFGHPizBKELnpc6dqX/ahu6t0IrSCF0qWEvbV7MtFf0Rji194gvoYffTYsGB7TR1BxG5JNww4LatsPvBQB+J2eW9rb93YCxX+UVgTdh8yIal5iC78= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, 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 eca38fa81e0f..19071b71979c 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 ================================