Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4095843rdb; Mon, 11 Dec 2023 08:42:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXnyQr/z1BVmjd32iAI7bif4spTNxF1Hn6a7IzBoFDxKEVRDEW7vuEGJ41Be2JK4FzHSag X-Received: by 2002:a05:6a20:560c:b0:18f:a92:9152 with SMTP id ir12-20020a056a20560c00b0018f0a929152mr1966736pzc.103.1702312958726; Mon, 11 Dec 2023 08:42:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702312958; cv=pass; d=google.com; s=arc-20160816; b=02AUSfAB0DtAK6s9R32puTiE60aElBw/lW2iQ8OhrIp6D+zlen6mQfiwEGcoYINP5F MTHERwl5a6b7TS6MTWU5ZE+iddwhJbH+GaWgE0TLfRxX+DNqGqlPpAhtryVla1H1vfYj TzpHpaRYhuXj9MNZhMH8O9VLUDaRoDek84SaZV951ugQkjf3ZfOQY7u08hrG17rgPlkR n5qQrV+xSWESpcpZltQXZjWmc2Pmw11ZeEUSACJ0XPOCWCerCr7erOoFcSNIphvbNnec CCozbC8AqF8HFTIjPKCuPuxPPsY+1EY9JwLSQbz/HjGcwSqKo0tJZiXx3S1SUvrp/Oun VzTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=SbV9N7mUMX45hSh1DHcgLbAg1typCMcIHV7LlMHJabA=; fh=PkR5iJwf+uk+2DHKs9Bq0K3ERRALBgvZ734mv5rirJE=; b=Pm7cInpogaDCqO+x38Ebr/sgZxZ6FNjuCPd1GLutl5NFOUUcI9oOC8kYSu95nWJINw /82nUdnjVBRG2jksWVt18GpL/Aea1Vbeh1qtMwCONWWo62usPM6kJnwLzPhjw21kn+sy bEghC3Y+CAqU6BkA5q1q9cNOEQiba3ByPs8IZoN1P4OrdDi7NG/1QL9CsVdE1BJ7e6BP oxZbyTIJI1/YZDMDIR9HymxVsCTpvK2w45XNXncQ7jTTtj3TG8phdLgdZ5BFJhLf8G10 b15hLyLYVjpHP5WaBdxXPSmajukK+qs3XGKI/UdI5do89ZPdB/EY8W9lbi7CXdIn+0re nMrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b="Ryf8/I7U"; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id 74-20020a63004d000000b005ca1286f8f7si1930143pga.308.2023.12.11.08.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:42:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b="Ryf8/I7U"; arc=pass (i=1 spf=pass spfdomain=memverge.com dkim=pass dkdomain=memverge.com dmarc=pass fromdomain=memverge.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3104E803C476; Mon, 11 Dec 2023 08:42:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234976AbjLKQmW (ORCPT + 99 others); Mon, 11 Dec 2023 11:42:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjLKQmV (ORCPT ); Mon, 11 Dec 2023 11:42:21 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FDB0B3; Mon, 11 Dec 2023 08:42:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7XZUPDtxyB7zcSDA0VLhya8ozo4tnCIEwY/A5KU3QOvLqWV/V2FL7OWhmohqGHllzBupic0N3xm+93OjFGUOLvD1AlXyyJUN4F3206U2J/9dDdtv10SaYL2KOYcJJiHKvZyEstWup0hgUw7z3Qcw1oD5RSDgm8mbDEOGNe0BFdTdzMyIf72nqdX5xR5CbsCK9pUtMndZosfpNLJnC4949Zw0PaDxeLM/sXj3LQyr3Na4u2TzB+Fwmpl3TPa+J0NKzd/DEovpJOzxAQgBJQhokV/eDMZhQtD4IByehHaPbTgYzkJlekWsVJXCy/WsS9mxpZsKRDRgt7c615FyNHUcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SbV9N7mUMX45hSh1DHcgLbAg1typCMcIHV7LlMHJabA=; b=Rkris1wKWotBhk3PKFxS1zKjQAQR2vTNnVlI3S80Vkv1pu2FX8E0bliAzzkEKPjQbPCR6x9tuF4/xBuWoGSNPY3vbknU1g3eqpVEfzumF1NMaBEnoyLzsVKrn6oKku3xftklHMpLwEHhtiNXwep+1dHZJFS2wtNCuBHq2eWVB1tzvyBRFaPUxhK6TryMuZwO5HUoAbLOxZWAJR6IeT+7xGmdnJLn98NhLwSAdCaWSuxKM2Amoyax3u9lW1c4KteWe9qov9l0GEjTLZ4MmpO1Mi7CJFYJSNaR3Dhsg6ay4BdUik5Ist0YsmygQyGYXBumhV3dbgQUwS2JLl0CIbxkVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=memverge.com; dmarc=pass action=none header.from=memverge.com; dkim=pass header.d=memverge.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=memverge.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SbV9N7mUMX45hSh1DHcgLbAg1typCMcIHV7LlMHJabA=; b=Ryf8/I7UHIYN1e6bi6NphGYcxe2n10kBuAADdHSVKn9HHI28xBl2KuKLpsv21s0lHrC32781Hd7V290jlVtsJjm9RzTnfArrHxO7Crja88GxcD43GfJ7aWoTYfd4peHfTFF97qajMmwZxpvYkkTAF5piLUPZ0TFJutoRxwZtYqc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=memverge.com; Received: from SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) by SA1PR17MB5153.namprd17.prod.outlook.com (2603:10b6:806:1c0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 16:42:23 +0000 Received: from SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::381c:7f11:1028:15f4]) by SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::381c:7f11:1028:15f4%5]) with mapi id 15.20.7068.031; Mon, 11 Dec 2023 16:42:23 +0000 Date: Mon, 11 Dec 2023 11:42:11 -0500 From: Gregory Price To: "Huang, Ying" Cc: Gregory Price , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, arnd@arndb.de, tglx@linutronix.de, luto@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, mhocko@kernel.org, tj@kernel.org, corbet@lwn.net, rakie.kim@sk.com, hyeongtak.ji@sk.com, honggyu.kim@sk.com, vtavarespetr@micron.com, peterz@infradead.org, jgroves@micron.com, ravis.opensrc@micron.com, sthanneeru@micron.com, emirakhur@micron.com, Hasan.Maruf@amd.com, seungjun.ha@samsung.com, Johannes Weiner , Hasan Al Maruf , Hao Wang , Dan Williams , Michal Hocko , Zhongkun He , Frank van der Linden , John Groves , Jonathan Cameron Subject: Re: [PATCH v2 00/11] mempolicy2, mbind2, and weighted interleave Message-ID: References: <20231209065931.3458-1-gregory.price@memverge.com> <87r0jtxp23.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r0jtxp23.fsf@yhuang6-desk2.ccr.corp.intel.com> X-ClientProxiedBy: SJ0PR03CA0242.namprd03.prod.outlook.com (2603:10b6:a03:3a0::7) To SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR17MB5512:EE_|SA1PR17MB5153:EE_ X-MS-Office365-Filtering-Correlation-Id: 1595f734-67f7-425f-476d-08dbfa682662 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UZD4ZNW7ig17h0Bqh7Js/AwBYXaghw/Arst05tKYRJNwts31zZYhZZaUl8k6RwrZIAMtmWhMKPOuHXux1C5K5y535l1CriyBGysQ01TlF9GeiNbIbAKkwL1xS/Kc38c+e+r+W0BSh5MTl+FYOe9/Hn2+HiEPo33WNbjRgRVvkIQEXpYGBKe0aYGZ3dLUtJWMeugoE2rOR59M6knm07ASgQhGoOyj4zTbyBWPwHLnwkMwfrSvMlZswQWT/cvWK2b8fNADqS7zlHRPsyvDKTxjovFdqZE07/2pSJDPj7UlLFZDcFVXqmxvnblpFydYKvTYh9tMeeHIrB3uh6cXVjQK93ROtK9fBhjyIsrotN1vPZ8PKaeOPvh9SMus2JC+JJd55fTxksnVvyB7YhDCLvJOWqv8FOufyb2cNgXKOTOIVvbw80WO6I3EPxUsAt5F0O6Zx4p+2eyDClPbvtl1cFwkxLRP4fvl4x57zKFGE3UHQCQAg4lT+4FhPAQlaAC+GEpuTUQD8swqwAleGRnItW5VBxs7pZKe6NWHNBRngFJ2xVCxZo2RXgfoSOYp1Pg3eGnQuejZ0jsIlNzBF4wWqzxgrKkhJtf09+gBFSxs87macNUk9k7zkzER2Dy0tpiuafDYRI7WdDwKcRWZ+Me4+gVMvA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR17MB5512.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39840400004)(376002)(346002)(366004)(396003)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(26005)(2616005)(6666004)(6506007)(6512007)(83380400001)(7416002)(7406005)(5660300002)(44832011)(41300700001)(2906002)(478600001)(6486002)(66556008)(66946007)(8936002)(66476007)(4326008)(8676002)(316002)(6916009)(54906003)(86362001)(38100700002)(36756003)(16393002)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnpjcUdRaElmV2VVMWdOZXZUUEJ2QnRiZ2xnKzhmdXVUTFExWEtPS29HVWxu?= =?utf-8?B?NXdqWXNRWHJ2enFsYXNPS3ROVlU3N0ZjYWpPdHlTQUErU1FqVWNTY2ROd0du?= =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lJ6YTlmWTFpWTRoME9YM3lMQ2YrRko5ZlRtUG1WQktpVTBt?= =?utf-8?B?SkhTWmJJaEhxL0s1TlJoYldENXdmMXdjcEdISnpISkl4Wjl0Nnh6SUZJMDhQ?= =?utf-8?B?bkFtV2J0aXJMcmlJL210TTlzZDZjeEgyb0ljTmxkaDUxeHNFbkNsajlZREx5?= =?utf-8?B?UjA3RWJpWTVnR3hyRnZMKzRqYzUzb2JXVUxwU0JMdlVjU2kwWE5wWE1HOGlV?= =?utf-8?B?MlluTHk3OGRlUnJjWUI0NWRtV1Zob3M0VkRoNTBCYlZzbDJ0MDlyaWJRMzdy?= =?utf-8?B?Wmc9PQ==?= X-OriginatorOrg: memverge.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1595f734-67f7-425f-476d-08dbfa682662 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR17MB5512.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 16:42:23.2960 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5c90cb59-37e7-4c81-9c07-00473d5fb682 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1RzyFn5snwPbSwdiIPqj0NNIVi/btGEysfGydKaKmb78RviGejuIMYOfkFM7tg7PNS57LwrD6wJDQ5hU+AoWA5Ka1bJTXUjUZfG7oVc/V3s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR17MB5153 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 08:42:36 -0800 (PST) On Mon, Dec 11, 2023 at 01:53:40PM +0800, Huang, Ying wrote: > Hi, Gregory, > > Thanks for updated version! > > Gregory Price writes: > > > v2: > > changes / adds: > > - flattened weight matrix to an array at requested of Ying Huang > > - Updated ABI docs per Davidlohr Bueso request > > - change uapi structure to use aligned/fixed-length members as > > Suggested-by: Arnd Bergmann > > - Implemented weight fetch logic in get_mempolicy2 > > - mbind2 was changed to take (iovec,len) as function arguments > > rather than add them to the uapi structure, since they describe > > where to apply the mempolicy - as opposed to being part of it. > > > > The sysfs structure is designed as follows. > > > > $ tree /sys/kernel/mm/mempolicy/ > > /sys/kernel/mm/mempolicy/ > > ├── possible_nodes > > └── weighted_interleave > > ├── nodeN > > │  └── weight > > └── nodeN+X > >   └── weight > > > > 'mempolicy' is added to '/sys/kernel/mm/' as a control group for > > the mempolicy subsystem. > > Is it good to add 'mempolicy' in '/sys/kernel/mm/numa'? The advantage > is that 'mempolicy' here is in fact "NUMA mempolicy". The disadvantage > is one more directory nesting. I have no strong opinion here. > i don't have a strong opinion here. > > 'possible_nodes' is added to 'mm/mempolicy' to help describe the > > expected structures under mempolicy directorys. For example, > > possible_nodes describes what nodeN directories wille exist under > > the weighted_interleave directory. > > We have '/sys/devices/system/node/possible' already. Is this just a > duplication? If so, why? And, the possible nodes can be gotten via > contents of 'weighted_interleave' too. > I'll remove it > And it appears not necessary to make 'weighted_interleave/nodeN' > directory. Why not just make it a file. > Originally I wasn't sure whether there would be more attributes, but this is probably fine. I'll change it. > And, can we add a way to reset weight to the default value? For example > `echo > nodeN/weight` or `echo > nodeN`. > Seems reasonable. > > ===================================================================== > > (Patches 7-10) set_mempolicy2, get_mempolicy2, mbind2 > > > > These interfaces are the 'extended' counterpart to their relatives. > > They use the userland 'struct mpol_args' structure to communicate a > > complete mempolicy configuration to the kernel. This structure > > looks very much like the kernel-internal 'struct mempolicy_args': > > > > struct mpol_args { > > /* Basic mempolicy settings */ > > __u16 mode; > > __u16 mode_flags; > > __s32 home_node; > > __aligned_u64 pol_nodes; > > __u64 pol_maxnodes; > > __u64 addr; > > __s32 policy_node; > > __s32 addr_node; > > __aligned_u64 *il_weights; /* of size pol_maxnodes */ > > }; > > This looks unnecessarily complex. I don't think that it's a good idea > to use exact same parameter for all 3 syscalls. > It is exactly as complex as mempolicy is. Everything here is already described in the existing interfaces (except il_weights). > For example, can we use something as below? > > long set_mempolicy2(int mode, const unsigned long *nodemask, unsigned int *il_weights, > unsigned long maxnode, unsigned long home_node, > unsigned long flags); > > long mbind2(unsigned long start, unsigned long len, > int mode, const unsigned long *nodemask, unsigned int *il_weights, > unsigned long maxnode, unsigned long home_node, > unsigned long flags); > Your definition of mbind2 is impossible. Neither of these interfaces solve the extensibility issue. If a new policy which requires a new format of data arrives, we can look forward to set_mempolicy3 and mbind3. > A struct may be defined to hold mempolicy iteself. > > struct mpol { > int mode; > unsigned int home_node; > const unsigned long *nodemask; > unsigned int *il_weights; > unsigned int maxnode; > }; > addr could be pulled out for get_mempolicy2, so i will do that 'addr_node' and 'policy_node' are warts that came from the original get_mempolicy. Removing them increases the complexity of handling arguments in the common get_mempolicy code. I could probably just drop support for retrieving the addr_node from get_mempolicy2, since it's already possible with get_mempolicy. So I will do that. ~Gregory