From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCA8233FE for ; Sat, 21 Dec 2024 14:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734793094; cv=none; b=bBM2FRKiC/LkZE9jUhRt+sTGGAMEuUbfp7w6IAymLQvykTgv1qL7+kYX8/Cl6sT+6XOfeD25cLoOw+rYIatjNJqWTfYFHZxgRjrHaK7lnaBDTLj5NCpjyONww27iodUoQij+9nWXXAjUvvyE8EOlmo6xfDLUoJQaj9/ze/GC/iA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734793094; c=relaxed/simple; bh=bLJFJgUuUGa4aQRH9jlb2YXHP9UMyaPtaWlZTZQ5RLU=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XShI6Hqj9HIG1G4FGUJNONEUAeP5ckJSyhwNJoeZfXZMcnaud63Ay5edOxEGJMJIKNUlQDUk4owSkQEAMpxeFEXgJEltct75wtVYxU3XvNSJSZHrOVFIkc5D9kdqNTKFLmkT10sxo0ZyezbUNBIEFsDtrG4BkXDEwDMBmDz1OOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=kZ+weGHr; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="kZ+weGHr" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-7b7041273ddso216529685a.3 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=vger.kernel.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=kZ+weGHrbTfSXVWHp2eXTDCUaM5CnQteqMkQ4BW5K7yKdEzCh2t7p2cHwOMWfoWGYs W61lStpXLMBLpaRZov3xSnHs4191xDvorZcdFvnPvuUIYwxPcRM5uD6n8FhhSLg67LV3 gSaVlllBTIveoVc2Siv9ezn4yaKj1A765UC/JE6ay1AFnTLCnc6wTOvJkYa/iDkkMJI1 rqm2RlhMkXFCfv6pmzNqSKi4cFusztRL6i9k+v4WjiM6rgcdY1H0NnuQaPl7K8ogjsKI RBK+D3Vx5kIsxkk60+MNbQA/9Ulrb8XOGQtenKSUDelhfCBFHQVc5/9isQo2IcfR/qR/ o+og== 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=U/n1brhC5Ixfwcp84REm3hHUEPoejXGbDEfbx065/0EsTnBTEa69ERvbUsxEx1v/QX p3RRoWIo1KlEEeLHkjj4DOwXrgM3cbJ/FrkIoql6yzPK+EX5T6Oje6HMxv1mphIpVlLN T6WWs7Ctg5OhkUnZIGxdOIT0EdXqqoCpjHMGGup0FR4zhV0LspesFiKrWWeopO7S8EUv J5MckL4ZOC9329W8NKBCDukws7UimRJQajSVezNLvSnbtx+dcxtAEy50Kh5k7HswHf+q lHpHMOjgu+p5JLtI5yHBD5sQtUTmivjN65VFelO1wHFq7Jh7SmRCe29Si1714t4rWdtb Y3BA== X-Forwarded-Encrypted: i=1; AJvYcCWv7c4C++i329V+uSlQab/J2L82lbrqNF/1L/NPkfrMyzn2e0IhRmE6Q9WHoRi8XzbJ6CcAKGVTLClqvDs=@vger.kernel.org X-Gm-Message-State: AOJu0YzXkMwsL4pCI+VPBtt93R4C4+/5cWYF7vtaun/dchYH1MlotKUd xnGuqgUtVjh/TyLSHIc2Afi+WZHNiMZMXL6oyRxTIOxd3CU/jmsWlk5hpcTmAzU= X-Gm-Gg: ASbGncvImWsZw7gHx6I9tkCOBRKr8w5LgRlz1oK4HzmwtmDYIILNlXS0D99suR4Khsy t22cRS5sAdAmLYYJqXeDc6+34IainfnqfcVPrQLpH805ryujqnVaCriQuRVvX7ep2cBjeKkAZcH 4QAl2je5u4docWv4XZCpVcplCTz6vRB57s4PeZ+N3S+mnO3MRE7R4ATXLaOZAIZl77AiirdZi7T YzodVcWLrIGeSwPmSwApX2teEGV0mLvUMwkirwero5+AkOmv08mGL0g77CjULZUeuPBfA/X5Kgh sbjvD9ZFxFOaqKjpVlYMjOl3dVIksNWpySU2VKdYrvio/pPhthYSYOE= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87jzbtr315.fsf@DESKTOP-5N7EMDA> 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