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 068F2C5AE59 for ; Tue, 3 Jun 2025 11:09:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D7F06B0095; Tue, 3 Jun 2025 07:09:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B0616B03A6; Tue, 3 Jun 2025 07:09:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89DFD6B03C0; Tue, 3 Jun 2025 07:09:10 -0400 (EDT) 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 6D8036B0095 for ; Tue, 3 Jun 2025 07:09:10 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 237411D30B9 for ; Tue, 3 Jun 2025 11:09:10 +0000 (UTC) X-FDA: 83513817660.18.FA7345B Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf21.hostedemail.com (Postfix) with ESMTP id 0DD071C000C for ; Tue, 3 Jun 2025 11:09:07 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=q00qrUcP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/FRv0yT/"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=q00qrUcP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/FRv0yT/"; spf=pass (imf21.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1748948948; 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:references:dkim-signature; bh=W2PAkAFBMrtlD/VBlqumySTAnFS0VB9Jsjpk3GplglU=; b=VSwel6/h2r78WrfRy61Wpb4BKbgdyhp3t7J7y7V3ULTGgOAQdrT0nkZxPtJkEMT5zNHENP 8mA6gS5kVkNhSdAtBoAhOVThIwMNu1xF7h8/fkrg3d7hF4VLCs56urhSyMHOAIqeDNSyEP Wm6hwdpb/6A66rCToOuCDLmmrahLbe4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=q00qrUcP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/FRv0yT/"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=q00qrUcP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/FRv0yT/"; spf=pass (imf21.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748948948; a=rsa-sha256; cv=none; b=b8lTjI8c0hWdayaRaLFzEcvPFvINHrlVG33/qnI7clM9hlVRh3jZ1A164Xfah+M6WsOdwe LXUs303pKvLCPRHXI/tbzajbslYh4wPPm0g4Jv2Q4uQVZScM91/RDmrCxn70KhTbgZXbO/ OT5T6EZKK60UDU6RVGV+H8rdvETUo0Q= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 641301F390; Tue, 3 Jun 2025 11:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1748948946; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=W2PAkAFBMrtlD/VBlqumySTAnFS0VB9Jsjpk3GplglU=; b=q00qrUcPrSuTERJxwW/vxCjP6XHI71NMOpsNjsZ7ezGTX3q1+Fb6LeCtxL5rIG7vApoweV 0CzAIom9+PnNa98ZWDh38MBzjDu0r+mFNgwApfYNYapZP7R9FZlroa2X3bPbLx81R0XZoL QCZ/xYRgx56nitZzqdw+N4uDlcpsB4s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1748948946; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=W2PAkAFBMrtlD/VBlqumySTAnFS0VB9Jsjpk3GplglU=; b=/FRv0yT/jWujG0dUsPZ0fV54vscg6iyvhxcZ1HKHL7WZ4Oreo2GuzN6X8z3BO/QK/9BQXi QtzQjzOIRXxiSRAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1748948946; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=W2PAkAFBMrtlD/VBlqumySTAnFS0VB9Jsjpk3GplglU=; b=q00qrUcPrSuTERJxwW/vxCjP6XHI71NMOpsNjsZ7ezGTX3q1+Fb6LeCtxL5rIG7vApoweV 0CzAIom9+PnNa98ZWDh38MBzjDu0r+mFNgwApfYNYapZP7R9FZlroa2X3bPbLx81R0XZoL QCZ/xYRgx56nitZzqdw+N4uDlcpsB4s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1748948946; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=W2PAkAFBMrtlD/VBlqumySTAnFS0VB9Jsjpk3GplglU=; b=/FRv0yT/jWujG0dUsPZ0fV54vscg6iyvhxcZ1HKHL7WZ4Oreo2GuzN6X8z3BO/QK/9BQXi QtzQjzOIRXxiSRAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C2A1A13A1D; Tue, 3 Jun 2025 11:09:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id gtqMLNHXPmjfXQAAD6G6ig (envelope-from ); Tue, 03 Jun 2025 11:09:05 +0000 From: Oscar Salvador To: Andrew Morton Cc: David Hildenbrand , Vlastimil Babka , Jonathan Cameron , Harry Yoo , Rakie Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v4 0/3] Implement numa node notifier Date: Tue, 3 Jun 2025 13:08:47 +0200 Message-ID: <20250603110850.192912-1-osalvador@suse.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: 78uwt54bawr7t986917w6iz691gwid8h X-Rspamd-Queue-Id: 0DD071C000C X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1748948947-270842 X-HE-Meta: U2FsdGVkX18rlm+Bt5jpFlvNN57PJDw35V5Yf60W1fr/hXGJBqwJiPIfpyQ7SMVITT9u1UZg9WXy81ujK02wlmasAvvbIHP6wfLuJ3MDp0JkNcbJN5dHE9n/llzLP4SjZ8WCFgbn0bRQKEs0Ex0bE1pa/OKO6TrTGu/HKxFBbNEOHBFO9fYR1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FVEco1TZZ3JVCuHADH8v0elyC9nUDHQ8= 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: A break from hugetlbfs :-) v3 -> v4: - Fix typos pointed out by Alok Tiwari - Further cleanups suggested by Vlastimil - Add RBs-by from Vlastimil v2 -> v3: - Add Suggested-by (David) - Replace last N_NORMAL_MEMORY mention in slub (David) - Replace the notifier for autoweitght-mempolicy - Fix build on !CONFIG_MEMORY_HOTPLUG v1 -> v2: - Remove status_change_nid_normal and the code that deals with it (David & Vlastimil) - Remove slab_mem_offline_callback (David & Vlastimil) - Change the order of canceling the notifiers in {online,offline}_pages (Vlastimil) - Fix up a couple of whitespaces (Jonathan Cameron) - Add RBs-by Memory notifier is a tool that allow consumers to get notified whenever memory gets onlined or offlined in the system. Currently, there are 10 consumers of that, but 5 out of those 10 consumers are only interested in getting notifications when a numa node changes its memory state. That means going from memoryless to memory-aware of vice versa. Which means that for every {online,offline}_pages operation they get notified even though the numa node might not have changed its state. This is suboptimal, and we want to decouple numa node state changes from memory state changes. While we are doing this, remove status_change_nid_normal, as the only current user (slub) does not really need it. This allows us to further simplify and clean up the code. The first patch gets rid of status_change_nid_normal in slub. The second patch implements a numa node notifier that does just that, and have those consumers register in there, so they get notified only when they are interested. The third patch replaces 'status_change_nid{_normal}' fields within memory_notify with a 'nid', as that is only what we need for memory notifer and update the only user of it (page_ext). Consumers that are only interested in numa node states change are: - memory-tier - slub - cpuset - hmat - cxl - autoweight-mempolicy Oscar Salvador (3): mm,slub: Do not special case N_NORMAL nodes for slab_nodes mm,memory_hotplug: Implement numa node notifier mm,memory_hotplug: Rename status_change_nid parameter in memory_notify drivers/acpi/numa/hmat.c | 6 +- drivers/base/node.c | 21 +++++ drivers/cxl/core/region.c | 14 ++-- drivers/cxl/cxl.h | 4 +- include/linux/memory.h | 38 ++++++++- kernel/cgroup/cpuset.c | 2 +- mm/memory-tiers.c | 8 +- mm/memory_hotplug.c | 161 +++++++++++++++++--------------------- mm/mempolicy.c | 8 +- mm/page_ext.c | 12 +-- mm/slub.c | 45 ++--------- 11 files changed, 158 insertions(+), 161 deletions(-) -- 2.49.0