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 80163E7717F for ; Mon, 16 Dec 2024 15:46:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1092C6B00B7; Mon, 16 Dec 2024 10:46:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B92D6B00B8; Mon, 16 Dec 2024 10:46:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC2C08D0001; Mon, 16 Dec 2024 10:46:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CA0436B00B7 for ; Mon, 16 Dec 2024 10:46:51 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 76C81120EF5 for ; Mon, 16 Dec 2024 15:46:51 +0000 (UTC) X-FDA: 82901249634.04.F98E4A3 Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by imf01.hostedemail.com (Postfix) with ESMTP id 3398940007 for ; Mon, 16 Dec 2024 15:46:26 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FI1rrrUz; spf=pass (imf01.hostedemail.com: domain of joshua.hahnjy@gmail.com designates 209.85.219.170 as permitted sender) smtp.mailfrom=joshua.hahnjy@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734363996; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4/L24M77KEHgjRD2S/cq3ONFt+aksrwaxpiJzcqZqpE=; b=TZLDSECNhuE1RLsB5H0yXi7egNvdLQn70VLcHvnynTLGCT6Tb5AOMtthCxUNYL8OL8cMWY r2zn/5xzCJlXjh2e1+znoJs15Lpo2WXkgF7f+/9jeJzaU6QRA4Wx+t3USwNZ20L9/T7gTS wRm3jeryd8IGV5ktuyqQFfagubczUK8= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FI1rrrUz; spf=pass (imf01.hostedemail.com: domain of joshua.hahnjy@gmail.com designates 209.85.219.170 as permitted sender) smtp.mailfrom=joshua.hahnjy@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734363996; a=rsa-sha256; cv=none; b=HNwQiMCW3zvndSeUXDm4dHXueMJWXDsXyFJncbYVFxC2qILpgKZbLmsslRN8ekSBqxWqQ4 WSMpDrCgHqydzgOls2tlRwHixRsjqLh2/yKsBT+QErfemD18YQQhMewJHtfuj7advQlUCK f2eg0+ClCaQNw8bzzV99sLqcLZ5UxX4= Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-e3fd6cd9ef7so3066640276.1 for ; Mon, 16 Dec 2024 07:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734364008; x=1734968808; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4/L24M77KEHgjRD2S/cq3ONFt+aksrwaxpiJzcqZqpE=; b=FI1rrrUz6lHKc+UjecWEiWu35kKzFY70uu4gmULaWx8ebjb0pKavxsf1PJr4xOr4Hg S3pbx2r+qIVD9pqnlPavDA30urJQg8WemSQzBG/thbjxa1DASV3a76nXmpPP3uxYSTSQ AsIc2lGCAn1OsqhC12wP2MDtDNI3Fr/haX+eqaNT2bGFWxUT8B9HfmiAhlCY9bV8WLsg MIVpw1nIZeUQRJFaHPFffsi+zF89S/eVBbNa7KAX6doaAocZg+esJYmN29HvBy0TcxFy rxmIarWlxATU8Avz4bVy4Vjrv62hOsbc6G9EIA+6mwJDyCSVDKPViPNOzD9bM/F7nyyG oFpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734364008; x=1734968808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4/L24M77KEHgjRD2S/cq3ONFt+aksrwaxpiJzcqZqpE=; b=g5uMyACGEHaTtdT8sIdvfggxea+TQn0xwy6UTUWkUqgyWVOkCxYxZH8in//SpbHCEe tfDPFKDNtP160PmsWRRwnRQp7gC2TE+BI/jynjQOTvKR4OALA1qCLOToQ5W72A4QPnH6 +6wqKRvxfxkVg+ORoYWEf8I3h1PzSnuIcJNLX1NoVRnZRy3s7pV1KPPQ5nVf0b0h72q5 JZqLo7q93nhpJ8Z5WgqHQpQoIPAEnGX5XbDARPOwKCOBabv8SSBYot5BdZ7VknU+cxsS G5FfCEOm8iyhrC7OAgGH6gTZ2ghU7nyoEUwbsfeJXbYESY+fAecw9ma6tCzV6xgaZVCu C0fw== X-Forwarded-Encrypted: i=1; AJvYcCWG454tv6Iuk2g7WtfKFtkuesCeZ3K7oGw0fncLLsmbLxR0aAjOgcH+NiRoGWYpdS9cWTxxrYXUJg==@kvack.org X-Gm-Message-State: AOJu0YyLUBPg9LGk0LiwsEbwkzWVaeagwpIxIHXTP4IEkvl7fm96QcR5 K443nl/vKaIRi+b+XMQgPekc/1ODnXWnUmoO5RfxjATtPHND6aLl X-Gm-Gg: ASbGncvEXs2UGPvdMCQc3A/AQ55gkZEeTgqzwBTXFFuTA/hQiE2eFRz9YzQR/9R2UlB 8HeMSKrq9c+cTsF7Kv6a9xnaRpo/lyp/xZeoqns4AUy5pT8sxuEMY0wkZUOvctpU8EhZdnylcsh JIwyjyyOE7/sdd8Nzuz9FbGsfRmnjeORkmP5GSXqfEBkjlXyqbmDCwhoqvrF6Q8M3PQjBEFoaku sHgYm9+mE6H4m3gr9D9+y+kyq6zcL/m+AS/HDPgTagf2rH/Y6AHBiMmWaLiBQVgYrsqhkOzjwys R5Ym8NUH0WA9rQ2cLw== X-Google-Smtp-Source: AGHT+IE03JmeV99mfjBTG2bTimbuUBUR2MDJ2a7PMRUxwdPG69gs36EkqipuHIrHqvnQVAvu+4KPpQ== X-Received: by 2002:a25:86cf:0:b0:e38:259e:bddb with SMTP id 3f1490d57ef6-e41ecf8143emr11678223276.11.1734364008390; Mon, 16 Dec 2024 07:46:48 -0800 (PST) Received: from localhost (fwdproxy-nha-115.fbsv.net. [2a03:2880:25ff:73::face:b00c]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e470e54d912sm1404678276.60.2024.12.16.07.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 07:46:47 -0800 (PST) From: Joshua Hahn To: hyeonggon.yoo@sk.com Cc: kernel_team@skhynix.com, 42.hyeyoo@gmail.com, "gourry@gourry.net" , "rafael@kernel.org" , "lenb@kernel.org" , "gregkh@linuxfoundation.org" , "akpm@linux-foundation.org" , =?UTF-8?q?=EA=B9=80=ED=99=8D=EA=B7=9C=20System=20SW?= , "ying.huang@linux.alibaba.com" , =?UTF-8?q?=EA=B9=80=EB=9D=BD=EA=B8=B0=20System=20SW?= , "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: Re: [External Mail] [RFC PATCH] mm/mempolicy: Weighted interleave auto-tuning Date: Mon, 16 Dec 2024 07:46:31 -0800 Message-ID: <20241216154646.1499268-1-joshua.hahnjy@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <7ed89f33-6ba0-44c7-b4ea-0c72029fa33b@sk.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3398940007 X-Stat-Signature: haqe9xxa614gf1mfxuxitese53neut9k X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734363986-263274 X-HE-Meta: U2FsdGVkX1/Wdi6cYdkgJ5bYJRIKEs0cQZQuCkrWxTZFivxD80C+Lk90T0w7bWQNsD580S2dpoM7cDhMp1Ghq3QgCD0c0ksWwfbLy540krhMr85xaZPlzOVeb1nvpQLa+MEa+HZgsOrgtcMxVNumhtQCvJ6AVp6FFNSZ/WF9RfKOYrdB4QFDj2VMi9n4VvxOX73EmFdWC545ZiJd18NGEmYstykgSKl0xjh9uZFSQ9pLJ9//yroA7QVoALAGgQFtBru1WjdvfkCYruGadfnZdZEeX4wKD8+CnX5OMAerCpLWuYmWssQkby9YJeWrK0PZDbp+EebmDqlEEBNiYZmLwZYOhIPEzL9aRFaNps/s0NrUFDZ784IyCiO7mwe/xGo1Q50CZNn7vy5LHH86pToM6kd5OTHbS1C3A4hNtNEnqwDOmmsr7IQATYLhsM9N3EI7xNMmv/fHDp+HcWfXYScCy0f7mm95aAUhhEzMP49R07BXxI+bh5QViDXmP5XXOjDMyvpAormFaKUn8WjaaBNe2OoI16zloZ7yvhrQnEA+8jVkTveDOR19UN+unL1b78IZjEI4vUdXZJinQwQK1A6/To1Lxgmew/dhzAQsB9UETBWpTDJOMsPfJShwZDGBMKhPrwSTVZ4kid8AKsFwri6i1ZlFBkMPlEtKL5VDGuIRISX+U7d/CkjjacNfvvnUZFnHqToivV19YVHwe3X9MILN9iEs5uBlEXcdH29HONCu0MEblw+tD+nMmUNUgxFunGWBDlfixRX/89OoVo/MFSBIB7dctJVCr3XszI5TUonrkGW7cv/Zy7Z8/BmEJG9QNVu/A3INpzv7Rx+qoON2i4rUjOcXuI19LBD1nte8Obqk5mpZU3rJOzbHJV67V6DI0eX11dCje4z7jJ3nilSwbrRPBJNEDScfZKJpe8/C/64dMKwmT3tkxwPRpPZaug3kBHbTolLhhFzUodjs6jRCWnn Jyl95aZr shj+CmZIutdgBhOX45K1DgHaeUuXzigOYjkNOiWw4IyyNBBKQPhLT0267A+hBvGWgmuImguBzRaaU34v9PlGzprnP2UNii0zqWQwycjIgtBtx1+2sM5FmcMSZDapCOFxBXKOCuaymhH9ESTWS6Ay8sq39RR0kkyH7PANL3T0x+ou4hjTmRCM3q0PnYOLs8LhMabZ+tLyHcewjQn3gQDAb2dRheGHuE2jiAcGpRELztunEUw6yqPw5g51jOJS5zUNrXPQmFN3YgAytsaTfgZKUEI7DSXGJGV5Qpl87uOu9mmxkHaArUAZqLZowoUNGWM+liGrRTKsd7Nvnniga1QZMfIlfglf2Gxv616v5uNCkmrwk+i7W3bl0XWgtBwf4gTPCOoPR+2NdOJyMJViTH9qSNK8mR+zCAAq/pmK0tIPPXmSl6rCkyfsyLPcn0dlmZrnSw5W2DYk5j4cQIAxHf+TDnfVsoU0BxEYRTKaU3o9Q3m+KmcK5/7F/BpR13AyUjYtXmsdJhYXaT8DwOfSCYDO6znUaiRokkdadjukuVOBeXOM4C4TVyw+8epWqfQNFM4iropi66KI5DDWhmKEnpAJoiZ2vi9qugw2xSglO X-Bogosity: Ham, tests=bogofilter, spamicity=0.025172, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, 16 Dec 2024 16:53:47 +0900 Hyeonggon Yoo wrote: > > On 2024-12-14 4:57 AM, Joshua Hahn wrote: > > On Fri, 13 Dec 2024 15:19:20 +0900 Hyeonggon Yoo wrote: > > > >> On 2024-12-11 06:54 AM, Joshua Hahn wrote: [-----8<-----] > > Hi Hyeonggon, > > > > Thank you for reviewing my patch! > > No problem :) > > > As Gregory showed in his reply, I think it would be possible to get host bandwidth information > > using the ACPI HMAT. > > You're right. I was wrong. I checked on our server, and its bandwidth > information was valid for both local memory and CXL memory. Sorry for > the noise. No worries, thank you for verifying from your end as well! > > [-----8<-----] > > > >>> +What: /sys/kernel/mm/mempolicy/weighted_interleave/max_node_weight > >>> +Date: December 2024 > >>> +Contact: Linux memory management mailing list > >>> +Description: Weight limiting / scaling interface > >>> + > >>> + The maximum interleave weight for a memory node. When it is > >>> + updated, any previous changes to interleave weights (i.e. via > >>> + the nodeN sysfs interfaces) are ignored, and new weights are > >>> + calculated using ACPI-reported bandwidths and scaled. > >>> + > >> > >> At first this paragraph sounded like "previously stored weights are > >> discarded after setting max_node_weight", but I think you mean > >> "User can override the default values, but defaults values are > >> calculated regardless of the values set by the user". Right? > > > > In the implementation, the first way you interpreted is the correct > > description. That is, if a user manually changes a ndoe weight, > > then updates the max_node_weight, the previous manual change will > > be overwritten by the newly scaled values. > > > > Does this behavior make sense? > > Ok. then current implementation overwrites the node weights > previously set by the user. > > I think it makes sense to re-scale all nodes and overwrite manually set > node weights, because it's what the knob is meant to do, and the user > still can override the weight by setting node weight after updating > max_node_weight. Thank you for your feedback. There is a slight concern, however, where there is a semantic mismatch between the name "max_node_weight" and its value. Like the description suggests, it is possible for individual nodes to have weights greater than the "max node weight". However, the alternative would be to re-scale all weights whenever an individual node's weight is manually overwritten to be greater than the max, which I think makes even less sense since users probably don't expect changing one weight to influence other nodes as well. > By the way, could you please explain which part of this patch implements > this rule? IIUC it does not invalidate iw_table after updating these > default values, which makes get_il_weight() to use manully set node > weights even after updating max_node_weight. (Or probably I just > misunderstood the code?) Ah, I am sorry for this mistake. It seems like I didn't update the actual iw table, updating the default instead. Thank you for the catch, this will be updated in the v2. Actually, there are a few more changes that I would like to make in the v2, the biggest of which is to lay down the intended behavior more explicitly in the documentation so that there is no ambiguity from the user perspective, and make sure that the code actually does reflect the intention as well. > > Have a great day! > > Have a great day too :) > > -- > Hyeonggon Thank you again for your feedback, happy holidays! Joshua