Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6901182rdb; Tue, 2 Jan 2024 19:01:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGBZteDFKAf9j9fWKbUbFKE/CkxElTEFWCG1ohKFqedJx6+WyyW89NdowRE4QiCiwODmQZ X-Received: by 2002:a17:90b:4001:b0:28b:33f7:7aee with SMTP id ie1-20020a17090b400100b0028b33f77aeemr5782245pjb.32.1704250906609; Tue, 02 Jan 2024 19:01:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704250906; cv=pass; d=google.com; s=arc-20160816; b=WcrBlXZHxefzJQDjVqCO/OychLp+HOqj1oRK8P95bukAIdJFo359tQ2LtNN08DNAqg UqmjSbWl1SlZHTQUnA6yGy6J/C5PzKERQeo2axbwV96wneSYFSYOsPl1N2nKog75jO43 WW0HuTcGbH6vWSK3GFG7qFoQ95yPEzTGYFQ9pPJT6UlZajjd1ISZirVN3rEgZZOENLkf RNs3RvKjzfIxzj4Uu6b+OvB5ebtJiRG3jI1xpZWTrf3dKjLNuEzafpFfmCzHAgoeTPI2 VAyNsMBK3HNhknELucoHgVk/dWbu0HXgXWwLuvy/2kutSI8Gf3hpZU7Q3hHCyqEVnB6o wlIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:content-disposition:references:message-id:subject:cc:to :from:date:dkim-signature; bh=W5t6X1FBHMniySVIsTvf0TzQld9lbtdwuvMQ/RpBzDQ=; fh=krMUuVBSnc+bMgzKcPdnQf/ITHAV0cxjzn6h/7t5tdA=; b=cloRR35CnfyKqn9wV05vt4gMManwdVdcCeO3uYDex48l64f4vkF4YjCOLNhvF1NXUj LP7olmjuWJCYmo4/P8qY8Gz/SyTBE7YakXuj1PPrwovmvn/iRdUPSe48Z90UWFUYaUlS oKhnfII91VGV3bldiJZAw5j2QmqP4SJvzNPwq/eivxiqJ2cKMFJsndQGsCRGFZba3Tgf PK1nYe0FiDzj7q5fAXsrGkKtNSv1loy06NMWonQHAVVAW74M/Hc5QshukVOTtqZSlFal x8rtsCBuVjgYuhSshMArtTIMhb6eZ1n0OHXVaeZ4ktQ1r8jLjNrvSdeBPLy+ffdSL2uk k+ag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b=Sqb1xVjS; 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+bounces-15108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c14-20020a170903234e00b001d4cea91cedsi599791plh.285.2024.01.02.19.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 19:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b=Sqb1xVjS; 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+bounces-15108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2680BB22FCC for ; Wed, 3 Jan 2024 03:00:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DAB1563B7; Wed, 3 Jan 2024 02:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b="Sqb1xVjS" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2076.outbound.protection.outlook.com [40.107.96.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95DC81798A; Wed, 3 Jan 2024 02:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=memverge.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WpIrYzvIOG/xZMaPJRgnfKlgZj+PvJ/G17f2+viQxHiI7ARlaHEU94GfKMGYLw3mhWGqzmhRPV4yBNyDXUaFaEYgztDW2ifOtShHkYCFC7250EnPdIfckguUyihSxU7E+V0rn2tKd/9nuq6yclJJVCcj8LXAEPo0sRoMLa0dowNirTnpzlbOBJtiPgg0Fw7h6NXRTbsnRT/c2lu08A8kiuzEIcKFb353Ry1EEntNh1fWCD8VAYqK9LH6ACi27d0bhr7RQhuYi1sE/+y7So2lPwTqU4cwE810XWxQlWHUBd2nMrRikz92gGrmBAT9bYPtZ4Ky2ID5D5NKmreufKMvLw== 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=W5t6X1FBHMniySVIsTvf0TzQld9lbtdwuvMQ/RpBzDQ=; b=a2PwNv2sNCEfUypCdsHxtMLdE4qiWOar83GqUnDoCfX1y2dlVFa8vv4K9dPz40NVWsP2PAULGXxomK3a0+vS3w+SEsN/KuVz5T1j0nhw3TjMJbkuFaQLgGr+FQfzkjtmoQF7bBU6fa7Gy9GKIPrNeSMADA7pjqKub2ndFpRiBzp6tWtbwauImd14t65DYn5536gUaCXAPSoDbo4HWRbyq8UuOLwyviwVitxMusUBCbvPyi9tvbhYV2t9DVCDy/jpKrScQ9kWSeVqmwyhjsi1ZC+mr/VBMurFHUMmSKUhTkkW4yor+wR8Fpfpl3NUnJHlApxTgUZHKlxYt76AXYO04g== 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=W5t6X1FBHMniySVIsTvf0TzQld9lbtdwuvMQ/RpBzDQ=; b=Sqb1xVjS8gqA5a8dsNt+LtHvAd3/V9IQGv3utHOzWa6bcl9wMICZCVwtb85rsmZvyfHpu9+VENOvr4kBKq4woS08t3unQTTmTL5/uzPHoJv3f3yoa885YLxXfcIVTwR0TwIUziZ5tk/K9YWFRFl8Q6kf4dBr3JYz4ySWJ0FVwkI= 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 DM6PR17MB3897.namprd17.prod.outlook.com (2603:10b6:5:254::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 02:59:53 +0000 Received: from SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::7a04:dc86:2799:2f15]) by SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::7a04:dc86:2799:2f15%4]) with mapi id 15.20.7135.023; Wed, 3 Jan 2024 02:59:53 +0000 Date: Tue, 2 Jan 2024 21:59:48 -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-kernel@vger.kernel.org, linux-api@vger.kernel.org, x86@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, 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 Subject: Re: [PATCH v5 01/11] mm/mempolicy: implement the sysfs-based weighted_interleave interface Message-ID: References: <20231223181101.1954-1-gregory.price@memverge.com> <20231223181101.1954-2-gregory.price@memverge.com> <877cl0f8oo.fsf@yhuang6-desk2.ccr.corp.intel.com> <87h6jwdvxn.fsf@yhuang6-desk2.ccr.corp.intel.com> <87wmsrcexq.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wmsrcexq.fsf@yhuang6-desk2.ccr.corp.intel.com> X-ClientProxiedBy: SJ0PR03CA0342.namprd03.prod.outlook.com (2603:10b6:a03:39c::17) To SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR17MB5512:EE_|DM6PR17MB3897:EE_ X-MS-Office365-Filtering-Correlation-Id: e5d75169-714c-47d9-5802-08dc0c080efb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T1Dp7DK90B0WQRl3RK+isZ78jSCHs2RWta4ZyB0J3dtaK99Hcnhb2+rxII6uFUI8jk2Hc3nHm38DqBQnyKMItruCtjg+RQ9tQNh5SXwqmc+8tb6pUEquUTgf3neRxO3hajuJoqnYpjfqyRfeAe/qkVow133DhpFvGclqiImKy8Y+kCtuA/iZdR3J7VNZHeQ7RrNseMLWD0If5ucZVb9tyPrc8Ack/hHkcw31WJnt5vt3ho7JVph9vP7ImndBGru1fnTyeVUsKrynto0SUMHuIImmizQJ0qLuo9dA0RYPAbZ6/oBhuNyvlia2eTJo6tDqxuopTqKYoQM7QGwp0wTrMyhHcR4VpP2UUvyvaIV3EWTxIMY9aRu7b0Uskmgz9O0k+9HNfMnCDe847bQSq749eIaKc+GG1LbhYecA4Uulp1HeekUiBvoZZEZGd3xlm0tzN4oBjru48en7nq5pgjnbzO+Zh2PS2S9SrM0MB0J5XknYhKMIGwJznPhr82YQpRZugJFKgSNviqsCzU6vjW2RwqftTO+m22Zq3Bq9zlLdTohj8Ko2s2PM4eWoRTYrkLVGdopJfukD7a6re9ZB7cH6qeIVP5o1XKZ30w1aCLLuQcyNOVUZ01t7ylG75SUIRIG7 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)(376002)(366004)(39840400004)(346002)(396003)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(6506007)(26005)(2616005)(83380400001)(6666004)(6512007)(7406005)(7416002)(5660300002)(4326008)(44832011)(41300700001)(478600001)(6486002)(66946007)(2906002)(316002)(8676002)(8936002)(6916009)(66476007)(66556008)(86362001)(38100700002)(36756003)(16393002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QKw+WFjAFpyK1hRao2bU7qLCFyeuykkOLEWiqAIl4FmS1YY9CT6rgPV6BnbC?= =?us-ascii?Q?8+Svg2diQY6tegiIe96mqUItqeQWvmDMAUrCyGubrv15CIpP+zP0wbidalNh?= =?us-ascii?Q?LmhdHXgCv2Q2e1eNwe5tD0zDRIWueA1oJSApPuvfP74myE/nIrNUZgTsm/91?= =?us-ascii?Q?5Z7bi3bKOpxL/qncwc/L6q2uChTeB54vYem91ABI6RJILKGRTYhzXAswq0md?= =?us-ascii?Q?woSMRTIu6TU7dKk/zUaUH2M0bIh/Lv3yW9S98cdde5POuykbSVlg8yJS58lB?= =?us-ascii?Q?82va6SfFs4eW/7fZxkwlCzKB7Fc+//dvW9wVbmdPZ+qY44gjojMgpyLXa6Rk?= =?us-ascii?Q?/mows8Yp2FFWpEZF+8urxJj5Yqn/QRqJ+FmlK6XVai46qnRnWoG6NDCNxDdI?= =?us-ascii?Q?jjyvpFefo6HN0vsaxDemx47NqqE07zN9T6Z++B61iMfiRG6gA4bTv2g0wGwJ?= =?us-ascii?Q?u5PKp7NoQkznmA5ADyU2rDnhXn1wHB36jHJQGcN5xgdRBAks6pQqW0iaUKRL?= =?us-ascii?Q?q/kjcszdbnzE+MF8WAUsIcWwlq4/AxFERE3LvB5P/B6vXTl5e1COPULYpKqf?= =?us-ascii?Q?GcetfD6+QmCBiO81/I1PFijHmCGDTye8QVeUDIvnKdRJthZZlrwjjRT2alND?= =?us-ascii?Q?QCiYEcTI+GynuPVJAjyHyAj84jEFSRJncocpBmoF+MbiDCxObGbAKH4eNnfg?= =?us-ascii?Q?YKnH7fszvEqMPmk+h8LY252M4wMgJpnJ2OTsG83tN9+NTwM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g: memverge.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5d75169-714c-47d9-5802-08dc0c080efb X-MS-Exchange-CrossTenant-AuthSource: SJ0PR17MB5512.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 02:59:53.2291 (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: OdahE+vEOs+gKvb3qy1g9sPXaZX1pczML38BBKwqDppmmCD9WPSRTo9itTp01gnbStEKMvSYgg25mHwkmdR7YIbFrhnzEO9I5jkKsvMjQ/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR17MB3897 On Wed, Jan 03, 2024 at 10:45:53AM +0800, Huang, Ying wrote: > > > The minimum functionality is everything receiving a default weight of 1, > > such that weighted interleave's behavior defaults to round-robin > > interleave. This gets the system off the ground. > > I don't think that we need to implement all functionalities now. But, > we may need to consider more especially if it may impact the user space > interface. The default base weight is something like that. If we > change the default base weight from "1" to "16" later, users may be > surprised. So, I think it's better to discuss it now. > This is a hill I don't particularly care to die on. I think the weights are likely to end up being set at boot and rebalanced as (rare) hotplug events occur. So if people think the default weight should be 3,16,24 or 123, i don't think it's going to matter. > > We can use a wrapper function to hide the logic. > Done. I'll push a new set tomorrow. > > I think it also allows MPOL_F_GWEIGHT to be eliminated. > > Do we need a way to distinguish whether to copy the global weights to > local weights when the memory policy is created? That is, when the > global weights are changed later, will the changes be used? One > possible solution is > > - If no weights are specified in set_mempolicy2(), the global weights > will be used always. > > - If at least one weight is specified in set_mempolicy2(), it will be > used, and the other weights in global weights will be copied to the > local weights. That is, changes to the global weights will not be > used. > What's confusing about that is that if a user sets a weight to 0, they'll get a non-0 weight - always. In my opinion, if we want to make '0' mean 'use system default', then it should mean 'ALWAYS use system default for this node'. "Use the system default at the time the syscall was called, and do not update to use a new system default if that default is changed" is confusing. If you say use a global value, use the global value. Simple. > -- > Best Regards, > Huang, Ying