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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C292C02182 for ; Wed, 22 Jan 2025 01:24:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94A7B280002; Tue, 21 Jan 2025 20:24:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FB19280001; Tue, 21 Jan 2025 20:24:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C26E280002; Tue, 21 Jan 2025 20:24:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 560CC280001 for ; Tue, 21 Jan 2025 20:24:30 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id EC9EA1611E6 for ; Wed, 22 Jan 2025 01:24:29 +0000 (UTC) X-FDA: 83033342658.10.E74CA1A Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf13.hostedemail.com (Postfix) with ESMTP id D6FE220005 for ; Wed, 22 Jan 2025 01:24:26 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="mi/hGQjT"; spf=pass (imf13.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=ying.huang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737509068; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZPhJcHXO+4qxb/S/ng3urgM4sHYsTOg2Vg9r4Wof2z0=; b=UflAGo1ymtQ86bkxbr/wGa/XLP3zcdcUjVDp7VpblS0vZUi1ILzbx3813DTGbKDmoLk1cT vqfwKX+ur6NLpRm8vChrfBtORAQXGr6AmqTPAkWSIBSBeiFkKD9yRiFNW/pmqud1swWqEW amjKGysYUcPgIYNXZKDAvGwNGaDjIts= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="mi/hGQjT"; spf=pass (imf13.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=ying.huang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737509068; a=rsa-sha256; cv=none; b=BkSMuq5a8kuzil1kQR7OJ5TuQUCYPD69w2tpXua8NRRaQVTvjOfTrmGg91BZCPc3KhUSDC jXu7pCk2qmK8yA1Ai2DhZ0P2LVrBpDp2E0inVNICpF0x4rjasAf2MNj0rAswEkugVDyf3V +Z5JMfq/9GiZ0cX0Qt0eDwwR20qEbx8= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1737509063; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=ZPhJcHXO+4qxb/S/ng3urgM4sHYsTOg2Vg9r4Wof2z0=; b=mi/hGQjTRZRiyCUn5kU654bCxlUYSR9egZKQA/SnGiCkF9eEXpheCLBUwQIgsm5PEEENzZTXbr89Vf2a/QaYf3ieZU04XOLGOXUW8wVgdHBthdGURwnt5mVwhR+EEjER25iZAa8idKBL+6M8itEXocgZdUhiZdAnm0j1GLlzYjI= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WO6fYz._1737509047 cluster:ay36) by smtp.aliyun-inc.com; Wed, 22 Jan 2025 09:24:22 +0800 From: "Huang, Ying" To: Honggyu Kim Cc: Joshua Hahn , kernel_team@skhynix.com, gourry@gourry.net, hyeonggon.yoo@sk.com, rafael@kernel.org, lenb@kernel.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, rakie.kim@sk.com, dan.j.williams@intel.com, Jonathan.Cameron@huawei.com, dave.jiang@intel.com, horen.chuang@linux.dev, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com Subject: Re: [PATCH v3] Weighted interleave auto-tuning In-Reply-To: <147aba6e-7e23-4ad1-9bd2-1ceac0f3d55b@sk.com> (Honggyu Kim's message of "Tue, 21 Jan 2025 20:27:17 +0900") References: <20250115185854.1991771-1-joshua.hahnjy@gmail.com> <87ikq8h0w4.fsf@DESKTOP-5N7EMDA> <147aba6e-7e23-4ad1-9bd2-1ceac0f3d55b@sk.com> Date: Wed, 22 Jan 2025 09:24:07 +0800 Message-ID: <87a5bjiqtk.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: D6FE220005 X-Stat-Signature: e9t7wg9ruhkc59ian3hcrcc5m5yu1tit X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1737509066-901949 X-HE-Meta: U2FsdGVkX1/5jDVQ6ARgf7BqnqN6kbfINx5TUWDT64Z5LGVOaR7nj6v/oljAAAJ/9oInyKwpYifM8tvotMNX1L3KL2hRA/1lIP/xkbKy+WXARviA6RZMYCqXRKubeG9aLxPhoWaCNG9Y0z6KN09nCESE+bg1zYfjbJL3aAtFbiAXUjrnt0O9S7x55hcY68C2kb3r8zoHgQFmc7GCHBJoH+6MKp43dJ7j/rMk+/pr6TEbXzM1ThtC/9pj9V6MKSVVGLUYPw7VH0JSut0ScDLuDTbnkS7S0S0R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Z8q4zkiT+QMFtBs0tiNd6XdlByVB6+d3g/YJGtkyiZ8+Xrgenw6GMS7QEnzOsngM= 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: List-Subscribe: List-Unsubscribe: Hi, Honggyu, Honggyu Kim writes: > Hi Ying and Joshua, > > On 1/21/2025 8:17 PM, Huang, Ying wrote: >> Joshua Hahn writes: >> [snip] >>> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-mempolicy-weighted-interleave b/Documentation/ABI/testing/sysfs-kernel-mm-mempolicy-weighted-interleave >>> index 0b7972de04e9..d30dc29c53ff 100644 >>> --- a/Documentation/ABI/testing/sysfs-kernel-mm-mempolicy-weighted-interleave >>> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-mempolicy-weighted-interleave >>> @@ -20,6 +20,30 @@ Description: Weight configuration interface for nodeN >>> Minimum weight: 1 >>> Maximum weight: 255 >>> - Writing an empty string or `0` will reset the weight >>> to the >>> - system default. The system default may be set by the kernel >>> - or drivers at boot or during hotplug events. >>> + Writing invalid values (i.e. any values not in [1,255], >>> + empty string, ...) will return -EINVAL. >>> + >>> +What: /sys/kernel/mm/mempolicy/weighted_interleave/mode >>> +Date: January 2025 >>> +Contact: Linux memory management mailing list >>> +Description: Auto-weighting configuration interface >>> + >>> + Configuration modes for weighted interleave. Can take one of >>> + two options: "manual" and "auto". Default is "auto". >>> + >>> + In auto mode, all node weights are re-calculated and overwritten >>> + (visible via the nodeN interfaces) whenever new bandwidth data >>> + is made available either during boot or hotplug events. >>> + >>> + In manual mode, node weights can only be updated by the user. >>> + If a node is hotplugged while the user is in manual mode, >>> + the node will have a default weight of 1. >>> + >>> + Modes can be changed by writing either "auto" or "manual" to the >>> + interface. All other strings will be ignored, and -EINVAL will >>> + be returned. If "auto" is written to the interface but the >>> + recalculation / updates fail at any point (-ENOMEM or -ENODEV) >>> + then the mode will remain in manual mode. >>> + >>> + Writing a new weight to a node directly via the nodeN interface >>> + will also automatically update the system to manual mode. >> IMHO, this interface is somewhat hard to be used. Users need to >> know >> which value is legal. So, this will become something like, >> $ cat mode >> auto [manual] >> $ echo auto > mode >> $ cat mode >> [auto] manual > > This is exactly I internally proposed to Hyeonggon, but couldn't share > the idea directly here. > >> Unless it's possible we will add more modes in the future, this is >> kind >> of overkill for me. How about something simpler as below? >> $ cat auto >> true >> $ echo 0 > auto >> $ cat auto >> false > > That also makes sense, but I feel like somewhat vague what "auto" false > means. The "auto" might be better to be "use_hmat" instead and this > makes "use_hmat" false more meaningful. "use_hmat_weight" or > "use_hmat_info" might be another candidates. As Gregory pointed out in another email. hmat isn't good because it's platform dependent. We may use something else to get default weights on another platform. I'm open to other platform independent naming. For example, use_default. [snip] --- Best Regards, Huang, Ying