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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A1C1C6369E for ; Thu, 3 Dec 2020 01:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29F99206F9 for ; Thu, 3 Dec 2020 01:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729265AbgLCBtt (ORCPT ); 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. 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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB8A1C6369E for ; Thu, 3 Dec 2020 01:49:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 06B47206F9 for ; Thu, 3 Dec 2020 01:49:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06B47206F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 167DD6B005C; Wed, 2 Dec 2020 20:49:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F1B66B005D; Wed, 2 Dec 2020 20:49:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 006EF6B0068; Wed, 2 Dec 2020 20:49:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id DE5626B005C for ; Wed, 2 Dec 2020 20:49:11 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A37C9363B for ; Thu, 3 Dec 2020 01:49:11 +0000 (UTC) X-FDA: 77550288102.25.queen04_090f52d273b8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 8179F1804E3A9 for ; Thu, 3 Dec 2020 01:49:11 +0000 (UTC) X-HE-Tag: queen04_090f52d273b8 X-Filterd-Recvd-Size: 4491 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 01:49:10 +0000 (UTC) IronPort-SDR: wgufFD3ivCBwbVcKQT03ZDF7oShC/52ri96t/0njXMbTgk1kDU6ds3o/LxRw7jUa/z63O603Zr SpT9plvA7Cvg== X-IronPort-AV: E=McAfee;i="6000,8403,9823"; a="152371825" X-IronPort-AV: E=Sophos;i="5.78,388,1599548400"; d="scan'208";a="152371825" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.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 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: 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.