From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AB063112CB for ; Tue, 19 Aug 2025 09:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755595116; cv=none; b=pTP35t/IPePoWY2FM9Guuuens/Y6wx39gH6VtNbUySR/G04rHS4hO0V1PZBMLSgd2auBNv6H/cFBfW/GlnmjlkrFkxj432eXZDImL0rnjWDbUB656jGeqOso6oi95hqfVrmPDhYWIoNpdvBZUYYm4l0BcnV+saYlXwwpXGt7CwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755595116; c=relaxed/simple; bh=k9u/zkUOxHsMWxFUfXyf/12KxWsh8vlLwOU5SPjsuCc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rBSRo8x7Cw8qFCO7CUx4gLOC2VVyn7QgI/q2xAEjDppJInhfMZhwr8O4hjRU07sAGGoivpmeFA++arRJdso7h+UnOxwAqZ2sm0zlNwKqREhJb62sgNYtprasTpfj72U9HC1yllrC1YYLYo2+qs6fKktMH40P+pa5n1fxk2h/PpA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KfMchSV7; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KfMchSV7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755595114; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=9bXM2P/MhqSpumKlbQzkTNlQ0naxdYHG4yQEwZLp1fE=; b=KfMchSV7FJueVhGUD16TUbRWr1gWNa6vBEG0cKJNUxE7E+IZXSrlNnHke38CEum70C74Oe rdMnIVJwA0VYsBeLsOujqvFSIjWvu/Rk0/Q9pkMBIfcn9XGDVNYmWGSuolTInDuyXKgmJJ XnbGRpcqWE2UwwwECgISDT0OaUT5Ljw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-2e4Fm2_1N9SYZdCabm4PhQ-1; Tue, 19 Aug 2025 05:18:32 -0400 X-MC-Unique: 2e4Fm2_1N9SYZdCabm4PhQ-1 X-Mimecast-MFC-AGG-ID: 2e4Fm2_1N9SYZdCabm4PhQ_1755595112 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3b9e418aab7so2199090f8f.3 for ; Tue, 19 Aug 2025 02:18:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755595111; x=1756199911; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9bXM2P/MhqSpumKlbQzkTNlQ0naxdYHG4yQEwZLp1fE=; b=Hgyjck5q/9VKi0ttP6tUk3+9L/mwj5cj7qJmbRLRzo5UGZtdMBlGCQoMF1GQUhc1A5 vf3KSzAsLX/nqJkQkRvsAGA11e4BFo28z3RbnasbH2Wo40d379yGeyS3n+se4dLFwPCZ zGr7ygzMSl287RHuQ1G3YDJ1Nmlbqmy4Lngh97hNCcAwbqZ+NY+byFEM+A9GxETxql5o weHBoaOcs8e3q8xHddy2j/siM5F8Qgqw3B4xgnKnGoAlN2PKkPlf888LxNWbkIo8rb9R ekvzTR7VWYxYnGDa8owh3j5eSTgX6VwNXEOhS4I0V+D2fiaKkoDUfu7YQbZMiXQknASu c7lQ== X-Forwarded-Encrypted: i=1; AJvYcCWcWdItDGOsGC/P14xGj9BwgtrZgXpnNjGyXrJ8Yb/0AGFN0+Aveae4bU6y7rz5CeAMQmp0RT5wdls2Ykg=@vger.kernel.org X-Gm-Message-State: AOJu0YzaSHXwvb3Smclj1pn1Rt1OHESVYvE5PHXjo01Zi02WaTuaRk7g mrXWlbdyTLXHwNBg53vv7z4Z/jVilQx1fAwuAc78WbEYz5gGMgljetawjbf97yMN4j2TFHz1COp hiKKuyALCQH0Q2h7cvDt272EBuOplzkiLYwgUeDjx3SrGJwg3zyBojTk4krwovYpg4w== X-Gm-Gg: ASbGncuHGhuGOpfMVMdQBbvDzBbenxS9JVJqAkL8iNaViUu1qV2QavqT2+3gr82XKQZ qKaZ3FtKlTUhbJecHqD7fddtbf5kMOZ0/gPUkOeqmkDZ2govP897Pr25gaLywv9yiu1oln5UkgC SaK5OqZhti9JhcD9zTn4M7UtQILbcWYX/EgjwKDQzkT9IBRcT6D78gKf5pX8KmhbCek1RfM2aqX Ar4zIPS+AyF15jUfEGzJ55eviLLa/lMizon3ihBPG6FUlS5a/ymSYmGSUXYEZ35NQ1MA5Q+FH4D bnXU4n4o0h4LxsVreCdF11Bah8YCt+qPoPAmrhSqA+JKkVIJh5VMt3cqb9x/gBeVm9uagezN31v OialHpOpvKAIxz/hRRa6PigWY97df3EWidExVy2VeEjoRs9OaHINbjrmVr9iVmh20G4w= X-Received: by 2002:a05:6000:290e:b0:3b6:c88:7b74 with SMTP id ffacd0b85a97d-3c0ed1f3189mr1465594f8f.59.1755595111483; Tue, 19 Aug 2025 02:18:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+e52xc90Bvrvbc2U770mGOtK5WPpRon5NOHeKyrTke8cTDgsW6CbDrMjBRN9/VTMir3rqZA== X-Received: by 2002:a05:6000:290e:b0:3b6:c88:7b74 with SMTP id ffacd0b85a97d-3c0ed1f3189mr1465574f8f.59.1755595111066; Tue, 19 Aug 2025 02:18:31 -0700 (PDT) Received: from ?IPV6:2003:d8:2f07:8700:71be:5385:87b8:5a98? (p200300d82f07870071be538587b85a98.dip0.t-ipconnect.de. [2003:d8:2f07:8700:71be:5385:87b8:5a98]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c0771c16eesm3019775f8f.37.2025.08.19.02.18.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Aug 2025 02:18:30 -0700 (PDT) Message-ID: <83a930e5-660e-49ed-8c34-66c4edf93665@redhat.com> Date: Tue, 19 Aug 2025 11:18:29 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] mm/memory_hotplug: Update comment for hotplug memory callback priorities To: Marc Herbert , Dave Jiang , linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org, dave@stgolabs.net, jonathan.cameron@huawei.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, dan.j.williams@intel.com, akpm@linux-foundation.org References: <20250814171650.3002930-1-dave.jiang@intel.com> <20250814171650.3002930-2-dave.jiang@intel.com> <3e48429a-b52d-43a1-b48a-06fb46f0a37c@linux.intel.com> From: David Hildenbrand Content-Language: en-US Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5E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ZMCQWcwRuj1m73D sq8DEFBdZ5eEkj1dCyx+t/ga6x2rHyc8Sl86oK1tvAkwBNsfKou3v+jP/l14a7DGBvrmlYjO 59o3t6inu6H7pt7OL6u6BQj7DoMAEQEAAcLBfAQYAQgAJgIbDBYhBBvZyq1zXEw6Rg38yk3e EPcA/4NaBQJonNqrBQkmWAihAAoJEE3eEPcA/4NaKtMQALAJ8PzprBEXbXcEXwDKQu+P/vts IfUb1UNMfMV76BicGa5NCZnJNQASDP/+bFg6O3gx5NbhHHPeaWz/VxlOmYHokHodOvtL0WCC 8A5PEP8tOk6029Z+J+xUcMrJClNVFpzVvOpb1lCbhjwAV465Hy+NUSbbUiRxdzNQtLtgZzOV Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY qIws/H2t In-Reply-To: <3e48429a-b52d-43a1-b48a-06fb46f0a37c@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19.08.25 05:14, Marc Herbert wrote: > > > On 2025-08-18 07:08, Dave Jiang wrote: >> >> >> On 8/16/25 12:29 AM, David Hildenbrand wrote: >>> On 14.08.25 19:16, Dave Jiang wrote: >>>> Add clarification to comment for memory hotplug callback ordering as the >>>> current comment does not provide clear language on which callback happens >>>> first. >>>> >>>> Signed-off-by: Dave Jiang >>>> --- >>>> include/linux/memory.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/include/linux/memory.h b/include/linux/memory.h >>>> index 40eb70ccb09d..02314723e5bd 100644 >>>> --- a/include/linux/memory.h >>>> +++ b/include/linux/memory.h >>>> @@ -116,7 +116,7 @@ struct mem_section; >>>> /* >>>> * Priorities for the hotplug memory callback routines (stored in decreasing >>>> - * order in the callback chain) >>>> + * order in the callback chain). The callback ordering happens from high to low. >>>> */ >>>> #define DEFAULT_CALLBACK_PRI 0 >>>> #define SLAB_CALLBACK_PRI 1 >>> >>> "stored in decreasing order in the callback chain" >>> >>> is pretty clear? It's a chain after all that gets called. >> >> I can drop the patch. For some reason when I read it I'm thinking the opposite, and when Marc was also confused I started questioning things. >> > > I think we both found the current comment confusing (even together!) > because: > > - It very briefly alludes to an implementation detail (the chain) > without really getting into detail. A "chain" could be bi-directional; > why not? This one is... "most likely" not. Doubt. > Please note that the memory notifier is really just using the generic *notifier chain* mechanism as documented in include/linux/notifier.h. Here is a good summary of that mechanism. I don't quite agree with the "implementation detail" part, but that information might indeed not be required here. https://0xax.gitbooks.io/linux-insides/content/Concepts/linux-cpu-4.html > - Higher priorities can have lower numbers, example: "P1 bugs". Not the > case here, but this "double standards" situation makes _all_ > priorities suspicious and confusing. > Yes, "priorities" are handled differently in different context. > - Constants that come first in the file are called last. Yes, but that part makes perfect sense to me. > I would go further than Dave and also drop the "chain" implementation > detail because it makes the reader to think too much. Not needed and > distracting at this particular point in the file. > /* > * Priorities for the hotplug memory callback routines. > * Invoked from high to low. > */ > > => Hopefully zero cognitive load. Still confusion about how a high priority translates to a number, maybe? /* * Priorities for the hotplug memory callback routines. Invoked from * high to low. Higher priorities corresponds to higher numbers. */ -- Cheers David / dhildenb