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 17A3BC71155 for ; Mon, 16 Jun 2025 13:52:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF6EF6B00AD; Mon, 16 Jun 2025 09:52:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA78E6B00AE; Mon, 16 Jun 2025 09:52:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BDFE6B00B8; Mon, 16 Jun 2025 09:52:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8C60E6B00AD for ; Mon, 16 Jun 2025 09:52:24 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3BA151008C5 for ; Mon, 16 Jun 2025 13:52:24 +0000 (UTC) X-FDA: 83561403408.18.8429961 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf16.hostedemail.com (Postfix) with ESMTP id 1727D180002 for ; Mon, 16 Jun 2025 13:52:21 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=2SqeeJ2E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Km2htEXh; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=RefMszHG; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=L6gyUo74; spf=pass (imf16.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=1750081942; 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=0H5sJEQTNH6pdHCRC2W0QAK3qcWeEKODSAn2wH3RU9E=; b=0X0HyJKX10Lu4wQS85dcftkcc9isyCG7TiYCUuWDVROnSJ1VlCzZJZ9JKMui599irpwn/p uof+oxGmzK6P6CCitImX0SMuQlDYgfKPjaH/58mbTD7L5ujEXfc2Q87ZO7Cu2S6cnRRBAy OOWiSlN3/f8q14+VroFuE1Z6EgIQivk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=2SqeeJ2E; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Km2htEXh; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=RefMszHG; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=L6gyUo74; spf=pass (imf16.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=1750081942; a=rsa-sha256; cv=none; b=zBAC/5IYK3pc6zKlJhggbklOCoORvx2gxE6jtqcv505mBicK/jO6lUAaIpINgO/RU+mxfC hgeVd/MJ8rniELA/w1rJiN9JgGOJfNhoXV8anKNjwuHU1Yd+1UJyrICa8h2v87dF7Ggu1D a0ezzm/N4EZb7WGo+e94reESSs2/EG4= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 EA1D81F79E; Mon, 16 Jun 2025 13:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1750081940; 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=0H5sJEQTNH6pdHCRC2W0QAK3qcWeEKODSAn2wH3RU9E=; b=2SqeeJ2EgPnER3E56SO5DMf3jGJhX4GHIWrUr5tbCqvK1EJGiaazkziFwKYSbddd+b02hn 1IfyzNkDv71BsuNxAe/00CKptnzx3H9Sh6Upax6MHtRfGL1G/d/g3mS9PBLTSdJ0AuWBz+ TFugFQkNDUsqaHKaDcTqqWOXKItT0Pw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1750081940; 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=0H5sJEQTNH6pdHCRC2W0QAK3qcWeEKODSAn2wH3RU9E=; b=Km2htEXhDoywK6f0n0u/x6/hsR9cygDivSNDKXkpm3i7oxSVPxfUjjMWSfDO2CMWnRUI+c OwHxtI2+VakfAlAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1750081935; 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=0H5sJEQTNH6pdHCRC2W0QAK3qcWeEKODSAn2wH3RU9E=; b=RefMszHGaMUpdON/ea1sHe08UwrQi5I8v7vO0mSYpz1OwPDDY75reMSdm30PWPLS5hrEX/ +EFOrzDrAja2CsgbnPYm8Bsl04ag8vhb2hXT2XckgNVW/Xd972sst9bvi6YNyInfhFRNpy +wKGY1dYMxhJs9uc0zCiGqntNUB9OU8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1750081935; 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=0H5sJEQTNH6pdHCRC2W0QAK3qcWeEKODSAn2wH3RU9E=; b=L6gyUo74f4jDZ6TvNi0XHJVFbtrrqJ6a1W+274fPkWCG0gZDxxteMRk3nozRloobWGJ9CH O6zVJnclZa9a6/Bg== 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 5EE4713A6B; Mon, 16 Jun 2025 13:52:10 +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 kwwZFIohUGhHLwAAD6G6ig (envelope-from ); Mon, 16 Jun 2025 13:52:10 +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 v7 00/11] Implement numa node notifier Date: Mon, 16 Jun 2025 15:51:43 +0200 Message-ID: <20250616135158.450136-1-osalvador@suse.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1727D180002 X-Stat-Signature: 6sfjguxh854du3wykniz9ttqrnqjcti5 X-Rspam-User: X-HE-Tag: 1750081941-9483 X-HE-Meta: U2FsdGVkX186xrXC/HD7M/NWS3azijC+D1fY7lXqIrqa4J2aK9JAwItUMGfPLf3/5Qo0xHX8VUbgIom71ppjiSDyVsX+mMc2uqDb+KXZdX1/Oy4RrlTaEecQbnYg+iIw7MkqD+zsY1wKbMS1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LOh+P3r6+FpC8ad/trnTEE79Ha9EcLzd2q4W4wFGfbaFKhEKVYjJtf6KYWbHKpwnT1pzJsuFIt7f6Ee1FhhGCViUbgjknn5NL+Mutm0xcs= 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: v6 -> v7: - Split previous patch#10 in two, one for page_ext and the other to drop status_change_nid (per David) - Implement feedback on simplifying previous cancel_on_* notifiers and better document the fact that we consumers can get called on _CANCEL_* actions before having been called for previous actions (per David) - Add Acks-by v5 -> v6: - Remove redundant checks (per David) - Fix build failure - Drop 'nid' parameter from memory notify (Per David) - Add RB/ACKs-by v4 -> v5: - Split out conversion for different consumers (per David) - Renamed node-notifier actions (per David) - Added new Documentation for new node-notifier and updated the memory-notifier one to reflect the changes - Make sure we do not trigger anything when !CONFIG_NUMA (per David) 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 (11): mm,slub: Do not special case N_NORMAL nodes for slab_nodes mm,memory_hotplug: Remove status_change_nid_normal and update documentation mm,memory_hotplug: Implement numa node notifier mm,slub: Use node-notifier instead of memory-notifier mm,memory-tiers: Use node-notifier instead of memory-notifier drivers,cxl: Use node-notifier instead of memory-notifier drivers,hmat: Use node-notifier instead of memory-notifier kernel,cpuset: Use node-notifier instead of memory-notifier mm,mempolicy: Use node-notifier instead of memory-notifier mm,page_ext: Derive the node from the pfn mm,memory_hotplug: Drop status_change_nid parameter from memory_notify Documentation/core-api/memory-hotplug.rst | 91 +++++++++-- .../zh_CN/core-api/memory-hotplug.rst | 3 - drivers/acpi/numa/hmat.c | 8 +- drivers/base/node.c | 21 +++ drivers/cxl/core/region.c | 16 +- drivers/cxl/cxl.h | 4 +- include/linux/memory.h | 2 - include/linux/node.h | 40 +++++ kernel/cgroup/cpuset.c | 2 +- mm/memory-tiers.c | 19 +-- mm/memory_hotplug.c | 152 +++++++----------- mm/mempolicy.c | 13 +- mm/page_ext.c | 17 +- mm/slub.c | 60 ++----- 14 files changed, 243 insertions(+), 205 deletions(-) -- 2.49.0