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 C48E1C5B543 for ; Thu, 5 Jun 2025 14:23:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D60F6B0596; Thu, 5 Jun 2025 10:23:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AC4F6B0599; Thu, 5 Jun 2025 10:23:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C3036B059A; Thu, 5 Jun 2025 10:23:19 -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 2E9F46B0596 for ; Thu, 5 Jun 2025 10:23:19 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A317A140B62 for ; Thu, 5 Jun 2025 14:23:18 +0000 (UTC) X-FDA: 83521564476.21.A629FCF Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf22.hostedemail.com (Postfix) with ESMTP id 7D25DC0019 for ; Thu, 5 Jun 2025 14:23:16 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=GoG3zOdO; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ghfYnGrY; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nqHwVfsA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="k/V2TP1O"; spf=pass (imf22.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=1749133396; 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=VGtxkIaHJWSGAzQZ7XrRv13ifuUrPYST8Fb6BTobMyk=; b=A48GilxhwCkikm4fd+/NaAf4xxiLfvzQn8pafM3t6z1aZWAHQyIWVgG1dIy5RtDFHdGQC/ PDpBSMKZOFboj40py8wbEANqDQ6uElptWG49ywhD3uVASLLiMVibuLShLpM3xenJBe5VlP AC1Vq5nYJXp5Ljy3gKTB2Vipyqbg/Ak= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=GoG3zOdO; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ghfYnGrY; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nqHwVfsA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="k/V2TP1O"; spf=pass (imf22.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=1749133396; a=rsa-sha256; cv=none; b=BgpPJ5AtNMoTe1x6o1DCvDfzvS7LLyAdCScFBjsBcmGBZYXTGp5weynTn7pcHRKZPm7w+I +LVL7qY2RHJoPJEZqJtgNACyTu65/nEogVAKLdTqNB2/b+cimngE3NRjFs4Kpy59l7yfbw LEcBvE/n6uiAY+QmTmP8NsTqmcK4/84= 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 F14F21F78B; Thu, 5 Jun 2025 14:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1749133395; 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=VGtxkIaHJWSGAzQZ7XrRv13ifuUrPYST8Fb6BTobMyk=; b=GoG3zOdOLCwA5kUzZDKLy6zfW/X5CfuFCrdHUq2Q63tc0onmUlVps9dFdmiFcKgwac4v2i YeKM7y7P7ayFmB6m+x1bOXH3hL/BbzI4su6UcYe3xW3/YnIMfvMiCsBG2gke+Z+FuNmFp+ QHod5c9F9OkwEnaAGqD+yPQRK6XnBGA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1749133395; 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=VGtxkIaHJWSGAzQZ7XrRv13ifuUrPYST8Fb6BTobMyk=; b=ghfYnGrY7MbqeK8JLfpVe93QV3+xDiGdDcHhnf7hNqImAZbiqsAvpdsqT3Y850h9FQyFfZ IVOPrtyEnhIcA3Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1749133394; 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=VGtxkIaHJWSGAzQZ7XrRv13ifuUrPYST8Fb6BTobMyk=; b=nqHwVfsADekQQemLGP480X+Wm/i1jHgCq8KtJka8xqb9boQp2JlgZY4ALaH9IDgf4D2OK0 h6iOi3NHmSotWFQCD81SjwNcmbxkDe478N98W/SCARUdU+cm1R6Ux2r2rbb94urYu8JaGJ d88LyZ+wkYiea81UJrcqgac7eTTE8xQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1749133394; 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=VGtxkIaHJWSGAzQZ7XrRv13ifuUrPYST8Fb6BTobMyk=; b=k/V2TP1Okkx4dc3x1idqdGt5OiDRCJDfV7PhJEGe1/xLunDSoI8tInJlHMvg8z6MtTPVSA 5+Goq6CigpS8UMAQ== 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 61F1D137FE; Thu, 5 Jun 2025 14:23:14 +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 bQ7sFFKoQWipRwAAD6G6ig (envelope-from ); Thu, 05 Jun 2025 14:23:14 +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 v5 00/10] Date: Thu, 5 Jun 2025 16:22:51 +0200 Message-ID: <20250605142305.244465-1-osalvador@suse.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Stat-Signature: 4pi5dw1tw9xyaqyr8xkc4ahxco1cx1pq X-Rspamd-Queue-Id: 7D25DC0019 X-Rspamd-Server: rspam11 X-HE-Tag: 1749133396-181197 X-HE-Meta: U2FsdGVkX18TeTlZNctpm+UOSdKSNtKR68HliYLFEHY7XksZA9uYT5bwzTj449KLv1pXl2+kUyEVGqQGRJBUlgCMX3KI3MARcn2ZmA+xWBJ6VMlhJsabyVq9iie0KUwbjbjrG3D6MTK+Tn7rOS57Au4JpIqEwQy2+phgDoeCMzM07VEFhV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hCry2VTSVma/6VzEnE9FL5Ky8+Lr/OaEWJPwowbmnhrklUhlJT94Pl04FrV15CmKv3r4Z9Rg2GR3ZvT946oYrbznK85lfO75TWT9ZrCDbYmQ== 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: 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 (10): 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,memory_hotplug: Rename status_change_nid parameter in memory_notify Documentation/core-api/memory-hotplug.rst | 78 ++++++-- .../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 | 3 +- include/linux/node.h | 42 +++++ kernel/cgroup/cpuset.c | 2 +- mm/memory-tiers.c | 14 +- mm/memory_hotplug.c | 167 ++++++++---------- mm/mempolicy.c | 10 +- mm/page_ext.c | 12 +- mm/slub.c | 45 +---- 14 files changed, 240 insertions(+), 185 deletions(-) -- 2.49.0