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 3BB37E77197 for ; Thu, 9 Jan 2025 15:56:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C16F86B008C; Thu, 9 Jan 2025 10:56:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC7616B0092; Thu, 9 Jan 2025 10:56:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A697E6B0093; Thu, 9 Jan 2025 10:56:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 852526B008C for ; Thu, 9 Jan 2025 10:56:26 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 33A29A01DA for ; Thu, 9 Jan 2025 15:56:26 +0000 (UTC) X-FDA: 82988365572.17.F077750 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by imf22.hostedemail.com (Postfix) with ESMTP id 42EC5C0011 for ; Thu, 9 Jan 2025 15:56:24 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=T8dBEzp4; dmarc=none; spf=pass (imf22.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.41 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736438184; a=rsa-sha256; cv=none; b=IXXudDV3TGb2edL5jYIkl4JL2HGhj4yyrgoeP6LFSdKGU3EXzLwTe8JJyOJ1Eq93HLSpct Dku+IsDIdB/ViMwEAbtx04GU1zvLQEvod1fmM+Lw97d3zbP5lvY8935Lqjtt3Y+qfUs62s Crv9Enc7Ucod1zsb1TUChmtI3QQD9jk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=T8dBEzp4; dmarc=none; spf=pass (imf22.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.41 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736438184; 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=njGbwrLBenkbPUY93SRaaO4DmnW4npNEqO6tdBDTIK4=; b=0r1kVxPCuvlleKor1174oTJk2ecdE6JUDOBwym45yqHtmxHdr2ypsWNN41oPwImLKNXuSY lEPaSfYhaljvciSjkEAe4hpwNm2XqhRSuScODj2YlYORxBQnDLfuHrQ2uMskrTHGuLcCGY TZROUJEncNOiKbuLPt//iS1d6rqvrRk= Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6d8fd060e27so8359006d6.1 for ; Thu, 09 Jan 2025 07:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736438183; x=1737042983; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=njGbwrLBenkbPUY93SRaaO4DmnW4npNEqO6tdBDTIK4=; b=T8dBEzp4PZ6GO5Z8jqHUFySfY2CEcYQ5zlMd8tf0eiuZ5xTJPDwua/Utmi83vXPdAj B9x82PrBAmcXhQfcvWs5Qio8RcgXILB9dc0Ezjq5zJ8cqnez3YeUIb1PP2J77yqCAFxv FbtkMtbYDj9o2rq9pzQ5lmGziH91LhU/P5SlK3ywmDI7jNyTSyHNxR2wZZTJXTqLivBR HuxLyYedcpneuA2tX/83jIa+U0+qzmJrnVIsKF6J+nJj6nRKCzERxewBORSJAoJM7sJA 9ryTLphKwo6LaKZXsExFbEyYhR6kp91ynEgfGEUNKfmDJVEAM/9HNNCJITO6XXi8zZg6 UgFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736438183; x=1737042983; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=njGbwrLBenkbPUY93SRaaO4DmnW4npNEqO6tdBDTIK4=; b=n2KpPk39SWPhifkMoh6mLhNCDaHjXa/SZ6WWjOiHoVqTKkTTaoy/Qsd9bxrWlbSJye h3+g+mqjCE0J9aCgXC4pLGR6YetT3xzLrmkE049YgW7iNieU7X+pChJb+JTrM44twhYh 7FfzFRE7HdRH3B3wxS4O/KfSL0FjwIRimtycTbnYID1c841KsggMf/oDghzM+Gl+cOLh oBi1b7Vulr2MUrmUS3YSDDql9CTSNEbqr8DP7xTBd/sb3hwJBY19nztrjSWfW4of08Y1 GfHiIY2E7U/m7xjfhpOz26tFOAgny6WORwguhKxHT9jN4pfkQB+3GGvkRQl9z9hBdzD2 HRTA== X-Forwarded-Encrypted: i=1; AJvYcCV3n58TcqiqYBmCP01iHk+rmzr25yUpGqd9Rou2YB2dHWflXr86GgREKt9qTRyNxdk62WcUvmQwDw==@kvack.org X-Gm-Message-State: AOJu0Yxi6Y9TLBsa2sBiBzc2CPRcGvmmbfJNjfngKNU64YQA80OSY03l 8ntF0gho97ySLpoxhMlx6lh4PvFoEyMBFq18rmIYtpGW5uvx5ggZHQwLSucK538= X-Gm-Gg: ASbGncuzg/SWtRzP6BkuCffPU3bwLGMqDDCzMhs3UZiPLqmIEgsUdvmsVjOKbP3ACWd 0GiHXBNyEBudpdRp9P38dtCIqsyg0tPA10LbyHx4j4MKKGwoIBeXB/p2DYkaN21yLFM3vrtyXhr XoBuXUCWuL2i693e8Gco/TUQRHPoD6WHt4F+agDIx28zs5xIRYANiiut5kOuVmcNcQzde7IJ/d1 8BWjVP6UGuc3jZxEWaXlKRZJA8Oi7Rp+xdfoY7kN3hjc5cGRWsCDa9NGhJ560uj3wAE/87sQ63h glep2QZ5Lg1AifI+UZ+Via9sEodl+lJGlyK6RJ0= X-Google-Smtp-Source: AGHT+IFez9D+XlV+Dk3FYn6oJiRh6f1LxjuTL/0cjlz8YykT4uZIk0cd8uPDFKcv8Yq+uZvqm94bBg== X-Received: by 2002:a05:6214:23c5:b0:6d8:890c:1f08 with SMTP id 6a1803df08f44-6df9b2348a7mr117716776d6.26.1736438183258; Thu, 09 Jan 2025 07:56:23 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dd181bba3fsm202468036d6.71.2025.01.09.07.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 07:56:22 -0800 (PST) Date: Thu, 9 Jan 2025 10:56:20 -0500 From: Gregory Price To: Hyeonggon Yoo Cc: "Huang, Ying" , Joshua Hahn , kernel_team@skhynix.com, 42.hyeyoo@gmail.com, "rafael@kernel.org" , "lenb@kernel.org" , "gregkh@linuxfoundation.org" , "akpm@linux-foundation.org" , =?utf-8?B?6rmA7ZmN6recKEtJTSBIT05HR1lVKQ==?= System SW , =?utf-8?B?6rmA65296riwKEtJTSBSQUtJRSk=?= System SW , "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: [External Mail] Re: [External Mail] [RFC PATCH] mm/mempolicy: Weighted interleave auto-tuning Message-ID: References: <20241225093042.7710-1-joshua.hahnjy@gmail.com> <874j2rp6or.fsf@DESKTOP-5N7EMDA> <87cyhdhon1.fsf@DESKTOP-5N7EMDA> <874j2lll91.fsf@DESKTOP-5N7EMDA> <769f98b3-f5e5-448c-966e-4dd5468e5041@sk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <769f98b3-f5e5-448c-966e-4dd5468e5041@sk.com> X-Stat-Signature: euu1zz47upptwfxupuaj8updhxcaxatn X-Rspam-User: X-Rspamd-Queue-Id: 42EC5C0011 X-Rspamd-Server: rspam08 X-HE-Tag: 1736438184-507218 X-HE-Meta: U2FsdGVkX19D9YEAdWmwEAIsgmi7A3gspd1NjCfV39w7qLQcz/1XNJio/6T5RMew/sRLYmHJ7Adpje7JAHrXY3Gjr82GhnddzvOlGg05kmtUYZkKtk3cBNHCUQDlL7ew24KBYPuXTNJ7mYP+AKdfxYh2NP8dCIqMKqYejCik52X+owconI8IS4Al+0eoEPZA7IsedkBvFQEu8572uMYJmcloqTWX6T/ni7CSr07H6uIymU7O9Fl1rjcDO0TChXqd932M8wTtnHWSrmBjC0vfTn+LRDflAQfDCtrdABg3R9e+E4Z9FNaWttnEPKxFWMCHvbEcX7qCyDcUrnztfIDHgyjxBiH+WxVk1dTbXYvnx9ggFaW1deYYysh9+/Sofhc0B+EnXZp/4Fx0goNiWyjTvu/IaFyOx9hlEkMtdnb5I4/U5wZEoTOJSpEwGrsFuSwL0RczJi0j5hoYLWC89zFRypJNwrFfbUv16F91trYVL3HCklNJe0AhcDPxd8EQqkAT/mXDhEIJp1uX8rTgNJyn84XuvCyMyycoOuV91CMpiMFibiaW/5tXInRrFWqAXfxeB6j+XmDU9Fq7NSeP0CDlzDzpRimp2MzNsKNrONUpZ5y/F7EtRK5ll0vpwVJbBllaEBA7y5cfxHo8vtdh2wqm0NPHLWrxCXe0mIPAJRfWiLSuuJKgKPgD776kxqgrizOmRbbuduSITn1dSWvJWXd1XZY+k6usoPgdo3VXEtIzQFgf/CdChIPzog3lkzZNVzxpgijSfyL/zfqx4ip16pEf5V2s1o2czGjPnWiIdFF+u/XoN0keZxuKrwa+s4MLHs8Y1nF9aCgzr75CeX+RtwThuATMgYtbNAQkwYWzbFgoMz3htwDL9QvhzHmse67sTN6ywgale9v/HCDxDy/ZcwdW8+/sQY383liiDzBAD/pxc65yRVmrahzjtP3EYKnW5xlqJGebTM2vsaB1tB1UYe4 wJBS2E9q w8eJhqO+njnsfQ+gHQUlYxQN4IJkZLDT3rHym8BENdiKHfjpw7JoBUAOHNMDvrUX1IRZEMZMN4fJItctuCpzUt4FisQAFcqZVoTh8Xe44iryD4U70HmM3tIk3HUerxoRVFEyL0d+zlUBlQo4de9YldfowKJTMknX5Hyky0A/MBgqKDVGTxsZ2AFLbJBx9eExjo9r992vSaCIZntOn034ffjrzBchcJnNf0ISmzEsBqkyJw6PZSQdd6b4i7MGT9rGGbM0aLsHRWnhXPDLlTOzME1AwhKQV7oOdsikOYvizXhFZbQGkorSmeH3lw5em+lhgmmL7R/1Leo6yDJm1sg2s+8bBhzs45tLKVjSYk3TRBJ+P7cTSUjSLzPfIUZvMYGjU+OQDNoZmSZ3hP8WV1VHLjH/g9ofqXqDwHx9xh8GS9W3ptUq57OczRzkx7zZzi/l8CQay 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: On Wed, Jan 08, 2025 at 10:19:19AM +0900, Hyeonggon Yoo wrote: > Hi, hope you all had a nice year-end holiday :) > ... snip ... > Please let me know if there's any point we discussed that I am missing. > > Additionally I would like to mention that within an internal discussion > my colleague Honggyu suggested introducing 'mode' parameter which can be > either 'manual' or 'auto' instead of 'use_defaults' to be provide more > intuitive interface. > > With Honggyu's suggestion and the points we've discussed, > I think the interface could be: > > # At booting, the mode is 'auto' where the kernel can automatically > # update any weights. > > mode auto # User hasn't specified any weight yet. > effective [2, 1, -, -] # Using system defaults for node 0-1, > # and node 2-3 not populated yet. > > # When a new NUMA node is added (e.g. via hotplug) in the 'auto' mode, > # all weights are re-calculated based on ACPI HMAT table, including the > # weight of the new node. > > mode auto # User hasn't specified weights yet. > effective [2, 1, 1, -] # Using system defaults for node 0-2, > # and node 3 not populated yet. > > # When user set at least one weight value, change the mode to 'manual' > # where the kernel does not update any weights automatically without > # user's consent. > > mode manual # User changed the weight of node 0 to 4, > # changing the mode to manual config mode. > effective [4, 1, 1, -] > > > # When a new NUMA node is added (e.g. via hotplug) in the manual mode, > # the new node's weight is zero because it's in manual mode and user > # did not specify the weight for the new node yet. > > mode manual > effective [4, 1, 1, 0] > 0's cannot show up in the effective list - the allocators can never percieve a 0 as there are (race) conditions where that may cause a div0. The actual content of the list may be 0, but the allocator will see '1'. IIRC this was due to lock/sleep limitations in the allocator paths and accessing this RCU protected memory. If someone wants to take another look at the allocator paths and characterize the risk more explicitly, this would be helpful. > # When user changes the mode to 'auto', all weights are changed to > # system defaults based on the ACPI HMAT table. > > mode auto > effective [2, 1, 1, 1] # system defaults > > In the example I did not distinguish 'default weights' and 'user > weights' because it's not important where the weight values came from -- > but it's important to know 1) what's the effective weights now and 2) if > the kernel can update them. > > Any thoughts? > > --- > Best, > Hyeonggon