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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 7EEACC433DF for ; Mon, 22 Jun 2020 21:02:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 45CFF2073E for ; Mon, 22 Jun 2020 21:02:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45CFF2073E 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 9FCE96B0002; Mon, 22 Jun 2020 17:02:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95F2D6B0005; Mon, 22 Jun 2020 17:02:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FF166B0006; Mon, 22 Jun 2020 17:02:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 61A616B0002 for ; Mon, 22 Jun 2020 17:02:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C2A1C92B2A for ; Mon, 22 Jun 2020 21:02:15 +0000 (UTC) X-FDA: 76958070630.22.dad27_3d1836626e35 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 2BB23181740DC for ; Mon, 22 Jun 2020 21:02:15 +0000 (UTC) X-HE-Tag: dad27_3d1836626e35 X-Filterd-Recvd-Size: 5260 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 21:02:13 +0000 (UTC) IronPort-SDR: fweQdxs+HjthTeIx/WfoSpov7H/vN4B8K3o2AI2HDlJbPgHFXYzR6Nq0ecBCKITniwjPEHFify +X+jqUCwpvpQ== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="161950184" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="161950184" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 14:02:10 -0700 IronPort-SDR: XPrh94uemSEdCHHMyiuw14mEaIAFSqqGA8gHyi06EF/F4Xob/EpIxehNC2aXVn63Xo3g3Uqx9w Fg/oh34C09IA== X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="318889924" Received: from unknown (HELO intel.com) ([10.252.132.84]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 14:02:09 -0700 Date: Mon, 22 Jun 2020 14:02:07 -0700 From: Ben Widawsky To: Andi Kleen Cc: linux-mm , Andrew Morton , Christoph Lameter , Dan Williams , Dave Hansen , David Hildenbrand , David Rientjes , Jason Gunthorpe , Johannes Weiner , Jonathan Corbet , Kuppuswamy Sathyanarayanan , Lee Schermerhorn , Li Xinhai , Mel Gorman , Michal Hocko , Mike Kravetz , Mina Almasry , Tejun Heo , Vlastimil Babka Subject: Re: [PATCH 00/18] multiple preferred nodes Message-ID: <20200622210207.pzh3olgudod77e3q@intel.com> Mail-Followup-To: Andi Kleen , linux-mm , Andrew Morton , Christoph Lameter , Dan Williams , Dave Hansen , David Hildenbrand , David Rientjes , Jason Gunthorpe , Johannes Weiner , Jonathan Corbet , Kuppuswamy Sathyanarayanan , Lee Schermerhorn , Li Xinhai , Mel Gorman , Michal Hocko , Mike Kravetz , Mina Almasry , Tejun Heo , Vlastimil Babka References: <20200619162425.1052382-1-ben.widawsky@intel.com> <20200622205430.GA818054@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200622205430.GA818054@tassilo.jf.intel.com> X-Rspamd-Queue-Id: 2BB23181740DC X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: On 20-06-22 13:54:30, Andi Kleen wrote: > On Fri, Jun 19, 2020 at 09:24:07AM -0700, Ben Widawsky wrote: > > This patch series introduces the concept of the MPOL_PREFERRED_MANY mempolicy. > > So the reason for having a new policy is that you're worried some legacy > application passes multiple nodes to MPOL_PREFERRED, where all but the > first would be currently ignored. Is that right? > > Is there any indication that this is actually the case? > > If not I would prefer to just extend the semantics of the existing MPOL_PREFERRED. > > Even if there was such an legacy application any legacy behavior changes > are likely not fatal, because preferred is only a hint anyways. Anybody > who really requires the right nodes would use _BIND. > > -Andi > It does break ABI in a sense as the existing MPOL_PREFERRED does in fact specify it should fail if more than one node is specified. A decent compromise might be to add a new flag to be used with MPOL_PREFERRED, hinting you want like a v2 version of the interface. Honestly, I don't care either way. I inherited it from Dave Hansen, and I can only guess at his motivation. Perhaps more valuable to consider was #3 alternative in the snipped part of the cover letter: > 3. Create flags or new modes that helps with some ordering. This offers both a > friendlier API as well as a solution for more customized usage. It's unknown > if it's worth the complexity to support this. Here is sample code for how > this might work: > > // Default > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_SOCKET, NULL, 0); > // which is the same as > set_mempolicy(MPOL_DEFAULT, NULL, 0); > > // The Hare > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE, NULL, 0); > > // The Tortoise > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE_REV, NULL, 0); > > // Prefer the fast memory of the first two sockets > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE, -1, 2); > > // Prefer specific nodes for some something wacky > set_mempolicy(MPOL_PREFER_MANY | MPOL_F_PREFER_ORDER_TYPE_CUSTOM, 0x17c, 1024);