Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp149892pxu; Wed, 2 Dec 2020 17:52:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7dxJuY6KqJkIVP3ZkVU/kIFzNSKnoqRWB6EeHf7yH8cVVpAtVmBcbjrqCjtH1LNiMb/1A X-Received: by 2002:a05:6402:411:: with SMTP id q17mr814985edv.125.1606960364217; Wed, 02 Dec 2020 17:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606960364; cv=none; d=google.com; s=arc-20160816; b=F9GVofmhPAktapMOsXpTEzz3JZKTtiL33Z9oRyeq0iz678acw5CFTPDNqpAJLaw3YE JWZP/FC6VS8N+LwsrJ5fsL+0N10PrN0fknonOTu2qLTWFais316hmBcwCSIk814KA0He 4YIHv/RpH7OKI+f7EkWWRIdJ0OBD8Tit4v50qBXPt1VVDBhp66y9faSx3FSSrW68En86 CKFNeU7yOpuhxa8iWdkIiv9MXzdGilQbBTqrtsjkUZBxsWEosiKWLHQcwIWauM8nblvi 68ZvpvJc7sE4WhfGbOScCkPRVnKFPSm+bamcIIidApl5TEzq91Gl4ciixtV+jndVvN9d fMYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=Q1P90oWx2KjOtItud0RYxhw9aNrLiQ3UwJeSYaaNhnQ=; b=sgPyfrVwGQ8Wqk4DnIet7sp+U2gqv8EVITWYjJ03AHXpt0rYzWVxt0OyPkanGWgHz1 t5ywSUsicZ2oLZWlMSLAA3j+cUU6lDnH5Wkj4H1u4bxO0zhRsFY+kRRY0klz6/YMJt5m WDfnMpVcEcPfgpwWAhVAnI9BGRhcmrAdXcZVmD0G04K59IxjRjGlLaSqd/p7x0/X2y+7 I1TAga/6xVSbZOECY98vHqR659cxYN+7bL9HfgEvfG4F67sk8qKY/424M0uKfWu8HPnr fjtY0KEQ7SytF4fI5lEL8/BDJPEEsoz+G3fwSB6muNtlBo3YwQ2e2WFA3ozwmDBBtIwF IaLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si82992edw.0.2020.12.02.17.52.21; Wed, 02 Dec 2020 17:52:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728151AbgLCBtt (ORCPT + 99 others); Wed, 2 Dec 2020 20:49:49 -0500 Received: from mga09.intel.com ([134.134.136.24]:38060 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbgLCBtt (ORCPT ); Wed, 2 Dec 2020 20:49:49 -0500 IronPort-SDR: JHzJMzBSYKitCcum+CpIzw+BLIiRmV3ZzsZ3wRmeC1t8nAB5KK/R5phMYSOS2Ox2n7ytm1jOi+ nNlSW3r0aNCg== X-IronPort-AV: E=McAfee;i="6000,8403,9823"; a="173278405" X-IronPort-AV: E=Sophos;i="5.78,388,1599548400"; d="scan'208";a="173278405" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 17:49:08 -0800 IronPort-SDR: TclsFD5v6L3iYlOeNDxihWRsbzh4AMtDKM+m8UQNrh6DM7MwonI19dtl4qcqXPijZEN62JNTL3 RvqAqC+phb+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,388,1599548400"; d="scan'208";a="550294491" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.50]) by orsmga005.jf.intel.com with ESMTP; 02 Dec 2020 17:49:03 -0800 From: "Huang\, Ying" To: Mel Gorman Cc: Peter Zijlstra , , , "Matthew Wilcox \(Oracle\)" , Rafael Aquini , Andrew Morton , Ingo Molnar , Rik van Riel , Johannes Weiner , Dave Hansen , Andi Kleen , Michal Hocko , David Rientjes , Subject: Re: [PATCH -V6 RESEND 2/3] NOT kernel/man-pages: man2/set_mempolicy.2: Add mode flag MPOL_F_NUMA_BALANCING References: <20201202084234.15797-1-ying.huang@intel.com> <20201202084234.15797-3-ying.huang@intel.com> <20201202114357.GW3306@suse.de> Date: Thu, 03 Dec 2020 09:49:02 +0800 In-Reply-To: <20201202114357.GW3306@suse.de> (Mel Gorman's message of "Wed, 2 Dec 2020 11:43:57 +0000") Message-ID: <87ft4npskx.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mel Gorman writes: > On Wed, Dec 02, 2020 at 04:42:33PM +0800, Huang Ying wrote: >> Signed-off-by: "Huang, Ying" >> --- >> man2/set_mempolicy.2 | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/man2/set_mempolicy.2 b/man2/set_mempolicy.2 >> index 68011eecb..3754b3e12 100644 >> --- a/man2/set_mempolicy.2 >> +++ b/man2/set_mempolicy.2 >> @@ -113,6 +113,12 @@ A nonempty >> .I nodemask >> specifies node IDs that are relative to the set of >> node IDs allowed by the process's current cpuset. >> +.TP >> +.BR MPOL_F_NUMA_BALANCING " (since Linux 5.11)" >> +Enable the Linux kernel NUMA balancing for the task if it is supported >> +by kernel. >> +If the flag isn't supported by Linux kernel, return -1 and errno is >> +set to EINVAL. >> .PP >> .I nodemask >> points to a bit mask of node IDs that contains up to >> @@ -293,6 +299,9 @@ argument specified both > > Should this be expanded more to clarify it applies to MPOL_BIND > specifically? > > Maybe the first patch should be expanded more and explictly fail if > MPOL_F_NUMA_BALANCING is used with anything other than MPOL_BIND? For MPOL_PREFERRED, why could we not use NUMA balancing to migrate pages to the accessing local node if it is same as the preferred node? We have a way to turn off NUMA balancing already, why could we not provide a way to enable it if that's intended? Even for MPOL_INTERLEAVE, if the target node is the same as the accessing local node, can we use NUMA balancing to migrate pages? So, I prefer to make MPOL_F_NUMA_BALANCING to be Optimizing with NUMA balancing if possible, and we may add more optimization in the future. Do you agree? Best Regards, Huang, Ying >> .B MPOL_F_STATIC_NODES >> and >> .BR MPOL_F_RELATIVE_NODES . >> +Or, the >> +.B MPOL_F_NUMA_BALANCING >> +isn't supported by the Linux kernel. > > This will be difficult for an app to distinguish but we can't go back in > time and make this ENOSYS :( > > The linux-api people might have more guidance but it may go to the > extent of including a small test program in the manual page for a > sequence that tests whether MPOL_F_NUMA_BALANCING works. They might have > a better recommendation on how it should be handled.