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 17DBBE7718B for ; Sat, 21 Dec 2024 14:58:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43CBE6B0083; Sat, 21 Dec 2024 09:58:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3ECFD6B0088; Sat, 21 Dec 2024 09:58:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28D2E6B0089; Sat, 21 Dec 2024 09:58:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 06BE96B0083 for ; Sat, 21 Dec 2024 09:58:15 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9A72B140FDF for ; Sat, 21 Dec 2024 14:58:14 +0000 (UTC) X-FDA: 82919270070.08.B865B52 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf19.hostedemail.com (Postfix) with ESMTP id 7D5C41A0007 for ; Sat, 21 Dec 2024 14:57:35 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=lBuNi7kb; spf=pass (imf19.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.178 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734793052; 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=pBgdCj8qzQbjXPZyDo9umjvbz0FQ++8ByuLBpWSlyEY=; b=PF4KHaqj48pn1y+wSafSwEG2T3QZQOv7gCbpIxLomcC6BEKPdrLJdxa6AlktEXA/1PetFy 7BLBrM3vpfZRJ+sdCl+UXu9U8bIlrBdqjTsXA2to84cSPc6V1SisY0rr0xMiHBEWyVH705 yZjGYQAxUeZe4d3JwDsZkDvobkEHjD8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734793052; a=rsa-sha256; cv=none; b=pe+zElK+tZfhdlIHvyOR2a2Zbo527Aiiu03XLBvE1Fa58ToJInkumWEhjgFA89siEiQ+cV fXCejbW2jQ0iq+yWV4jCWGulaUFRhpJQEysssZI0LukqKz9NV9ncNmhmt/TmIEXEaCUCbB zLChe000eUWIaNL/esym7CcTOiimy3g= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=lBuNi7kb; spf=pass (imf19.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.178 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-7b6eeff1fdfso233268085a.2 for ; Sat, 21 Dec 2024 06:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1734793092; x=1735397892; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=pBgdCj8qzQbjXPZyDo9umjvbz0FQ++8ByuLBpWSlyEY=; b=lBuNi7kb+Lqb4JbrAllp6ZHsQqLuxnd+xnwD6dvmAAQFUUef8V5Ziwra2l5SQT/Iv5 NiEbp9PQMG5uZVSvS6xW46mr+h1Zg4WdXsboNOf9siTt4pI4C7jfytDbdgu6AaZ66YSu VGB5K1u9ouRDQXgoQRd3AL7+d45R4O+yE72M6I4ZnuY9bt80mfbcJiDu73/D+pqxXWSa vmCBZY2At0B9KZ3YFbp3nT/lt52BMfv8tSGhCGhL+q6/mtBthcXpXCQfPizyckt0UX3H UeFoJgPsvcWCTB1v1iBo70ANjJrtCdkvUvvEVIHxhOFKV5ONscNMMRifzzF+h9ExEwwg S+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734793092; x=1735397892; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pBgdCj8qzQbjXPZyDo9umjvbz0FQ++8ByuLBpWSlyEY=; b=uZfo0NOnVJivanSqn16p4IWZRG5f+xjwi57upgxMsF45v2jmXIKnaOaK1CGaCpjN82 oADaF43awhsmmVtkKnSJloKcoNrB9ffxYq2U8W6HDLk+9wy0aPn0OnnG2Tx9kJQuNKZw RZjKDicMhPGxOjwVVnyAl7KJVTJJABJNQ+NE4xNsS0wZY3r7dKmVXos4Uiob2IH+PD2s PDzWR80wDkrIj7aIMzC7qcXm3ZGzS8U4Hdv1xc0kaTr6qY3/OzVuyjT6VpdaflAJwr8D 7sfN9sdTH5Dwg13Qtx13nLM0AzX+hhTk3+uYAC/bFmA02LhVTmb7lU/b5krlM0qLESa9 cK8Q== X-Forwarded-Encrypted: i=1; AJvYcCW+r+FIjbPqYDU583Gjq4m4lNLN6AiDP9Nx1K6EgnP+HzABZt5BQdHTlE7awl41kVJ96uVoL371Cw==@kvack.org X-Gm-Message-State: AOJu0Yxh+wQ0cuOpQfBZNDKnLdasEn1jUYgWRTHbwH3GxX99vhqSPMWm NsEdbiqjLCodnED89cJb4QUbhieu+vE+pcpxSig3FUuzqEjaiWB++2rd16Smfk0= X-Gm-Gg: ASbGnctUht6e8NA9+DfRFcBvfRctaCSTC2a+LRtGxNiTunvFQkSrYi+kLQXQgTyjLxc CNrpiW+y0413VC156XnZhZqzR0BbWjVXkw5H2mVx7FBv3VKJtbCXbirjdSGPyY36rWr6q9vwPsH MFq3xN5Ltl9yuZca/QySUJz4t011RmiXhAiiPSdL7lqdyxB/A9e8U7vLgoj9u+EJOGlvrQ5QHTM hVuWaXRDCrOANEBaZuLDHt4TAF+M5/Lz8dM9ye4Xmbsg5ZOYHs2K9jl5nO9PKjOfyZ93p4MtyKg bVCfE5COnXjfd7I2IuD34AsVdL0qfMOEo5Nzr9TlmRoZEPu/ja4Marw= X-Google-Smtp-Source: AGHT+IEgen1JW0Sf/lyCSUkaoVFMrNI48GAZq54w9vfNDCg0KyyfP72OZmixkjresa0McFobW6rDgA== X-Received: by 2002:a05:620a:318c:b0:7b6:de65:9ee7 with SMTP id af79cd13be357-7b9ba7ee78dmr1161952785a.43.1734793091760; Sat, 21 Dec 2024 06:58:11 -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 af79cd13be357-7b9ac4be70bsm227827985a.96.2024.12.21.06.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 06:58:10 -0800 (PST) From: Gregory Price X-Google-Original-From: Gregory Price Date: Sat, 21 Dec 2024 09:58:08 -0500 To: "Huang, Ying" Cc: Joshua Hahn , hyeonggon.yoo@sk.com, "gourry@gourry.net" , kernel_team@skhynix.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] [RFC PATCH] mm/mempolicy: Weighted interleave auto-tuning Message-ID: References: <4ddfa283-eb64-4032-880b-c19b07e407e1@sk.com> <20241213195754.2676135-1-joshua.hahnjy@gmail.com> <87jzbtr315.fsf@DESKTOP-5N7EMDA> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87jzbtr315.fsf@DESKTOP-5N7EMDA> X-Rspamd-Queue-Id: 7D5C41A0007 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: q6ijapjhgspg39ykf41hurwnk1y65rhz X-HE-Tag: 1734793055-287082 X-HE-Meta: U2FsdGVkX19Hfv76vom1oxE+K0kthIJR7Mp4UC0VdtkRCGPb6L4F/NSHF1+Y1h+Z/0SiZkJ2bqpN7y7KKZSFVYW1gfxrBenbAb2DLY68xnykHcZkNx+mYfDLHuEy5FWZI2+MuI8fNEMjvPoqIjwMed1hIf7WLPk/zmL/EksLRg3pAy2LdwM7SY/bRXdaXmbEEO/2ertOrxHN439k/wGifFR9whlQuUfane8QmfMXAR0WYKn4VcqqXq8nX6FhoIKQfmSrciR7MyZQDmk5Lp1WlNL+i6gFd66HwSNxHkpqqBL/yCKj58Td7u6ULz1GQHGDQSs1FLM3ocHtkURcznyCXYIEh1h22Gj6N0qWjMeu5m+R2OKRisG5BwNHCTNyt3+Q2lCmrdapJDSEbAbWk34qJA5VdTBZCpNCb+aYJ9eF6hzgtyGNbcb6T4p+VUOcHObR3fDrfmQC05Mix7EUkqxloOjTjwbd6EacIEfDtuVmxCjupq47lMfLfKgKmNOHJ71r+YfDbZ29Dz+bFdQ0EcsV6PaobgLJKbWA1JTcj0Gfb2bAHR7v9eaJhziSkO6OSOLU89Uu1Ol8v6aTOOCR1hxdHl6ooUxZsE4Iw1ogT2ghdrCeT4IyZgthl7ovXnHBvxhz5AHjngKBiGf+b/SiNtLyTPQlwHdlw6K/hR0H4xkSQ+aWa+wEuAleyv9rwkxSJq312ARd2heANUkgqxfKsTd2FARoaZ+cmaF+OXPyycW9xkUfPLNP8RnrLKz3tv1JhTukhGfOI+ZHRDxW0MiS1EJ+z+bVHyPXVMw/+YP0TJFL1N/PtGYBDt2YLqsvcWnUp9IROznwDUF2b0YrrzSfqHogUKhqmV4CuT9LTZnZPVc6WhsBkKXH0i+TF1Y5axpMjZ3g16LPbggyA+i3oFs2oqBwMeg+xdm4GvUds2MlBbO/iICiewF6pRY/VGujzlIQwXJ1yrXMHzEZ7D3GVjGc514 /9cDfBVJ JCi00yjng1knGoFKmAxso/a8EdcbFtIM8yBh3YCvaN4VhfjojhNHVSqi+CHOpVGnxB1EF4qOYPcjKsUJfcVNsKuVGDv20zJjIOf1EVKtpSgXGdrIsjgQ4gWrqEHy29SvpDJO40xO9/ozkEeX19H/VYO30va+dlL2lGZ2w71zIlaiTtk+EZ4ZBv00cfwjnL+uDBFDtiCJ42anICcBpo8f1pn3fsMLBamVHx0ZcNXT+4f/UQeV2T+y+h8os7ab5eLhKGtaI9KgfznvIzHhRp4V5gyIgBK1KUUFSwYxJsLLo9vL1ed5VQl/Eq9uawwEicAFtkZOJ1R0NlON7k65REXrB5B21HqoeZFvNzoj4rekqVeD/AJm/XMWRgAmmlrNqkYpuiMpvewUIo9DP+Cm14XKQaBMQWpC33wl/zPaSv9rQEdLAiS5KS/m1Jsj03uVgPnBizy2xBJYVFtiIXEXreD92nZgdpWtwfnGuW0YMGhEDumdbtqfFlAVVqKxG3uVEyGtbXnPCCs+BPOuDFZBPzFj0+uWACg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.125869, 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 Sat, Dec 21, 2024 at 01:57:58PM +0800, Huang, Ying wrote: > Hi, Joshua, > > Joshua Hahn writes: > > > On Fri, 13 Dec 2024 15:19:20 +0900 Hyeonggon Yoo wrote: > > > >> On 2024-12-11 06:54 AM, Joshua Hahn wrote: > > [snip] > > > > > [-----8<-----] > > > >> > +What: /sys/kernel/mm/mempolicy/weighted_interleave/max_node_weight > > I don't think that we need a new knob for this. Just use a reasonable > default value, for example, 32 or 16. If it turns out that a knob will > be really helpful, we can add it at that time. For now, I don't think > the requirements are clear. And, this is a new ABI and we need to > maintain it almost for ever. We must be careful about new knob. > This is fair. We spent a good amount of time modeling the best effective maximum weight and basically came to the conclusion that 32 has a good balance of minimizing error and being somewhat aggressive. Ripping out the sysfs is easy enough. > > > > Regardless of what implementation makes sense, I can re-write the > > description so that there is no ambiguity when it comes to the > > expected behavior of the code. Thank you for pointing this out! > > I don't think that it's a good idea to override the user supplied > configuration values. User configurations always have higher priority > than system default configurations. IIUC, this is the general rule of > Linux kernel user space interface. > We discussed this and decided it was confusing no matter what we did. If new data comes in (CDAT data from a hotplug event), then the weights are now wrong for the new global state - regardless of whether the user set a weight manually or not. This also allowed us to simplify the implementation a bit. But if generally we need to preserve user settings, then I think the best we can do to provide a sane system is ignore the user setting when re-weighting on a hotplug event. e.g. user has not set a value default_values [5,2,-] <- 1 node not set, expected to be hotplugged user_values [-,-,-] <- user has not set values effective [5,2,-] hotplug event default_values [2,1,1] - reweight has occurred user_values [-,-,-] effective [2,1,1] e.g. user has set a value default_values [5,2,-] <- 1 node not set, expected to be hotplugged user_values [4,-,-] <- user has only set one value effective [4,2,-] hotplug event default_values [2,1,1] - reweight has occurred user_values [4,-,-] effective [4,1,1] So default values get updated, but user values get left alone. If that's sane we'll fix it up. > --- > Best Regards, > Huang, Ying