From patchwork Tue Apr 1 09:27:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 14034574 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 6C223C36014 for ; Tue, 1 Apr 2025 09:27:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3762A280006; Tue, 1 Apr 2025 05:27:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 326EB280004; Tue, 1 Apr 2025 05:27:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1784B280006; Tue, 1 Apr 2025 05:27:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E9408280004 for ; Tue, 1 Apr 2025 05:27:35 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 944F5C248B for ; Tue, 1 Apr 2025 09:27:37 +0000 (UTC) X-FDA: 83284947354.15.BD9A98C Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf05.hostedemail.com (Postfix) with ESMTP id 7DE87100005 for ; Tue, 1 Apr 2025 09:27:35 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lw9JtLdL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="uU/H3Vl6"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="Enk/N3N5"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=K3+rNllT; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf05.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743499655; 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=840D19WfpFNAZY5QCFfrGDfYI8TO5sKOgbuO23DZ7w4=; b=doOaOr8wsZvM71KAr/EHc5OXW3JQlPlh3zQE1foL8J1XccS369GeXzCuy8PbsTuqv1DR9O mxyU3m0zmXPDMILX4kZkLt4A2o17C2Og44uYLM1X+n61FSkoCTQeJsiA6QTpIyYIEdh+4S iog9KWH5+YPZkxaOoGymRRRNHNY7HOc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743499655; a=rsa-sha256; cv=none; b=TgiwBolkHfonPSBqUv4Eebd/iYhld3kiL2dmw0FR99xJMheih7mnExrPAvrt5sz6jLL1AT 7jX18DXSk14GyHcwkWwQDpl2bDc81deqm51QRXTwMivPsnJlYU6XtnbmPQ6ptoGu+sdEco A02QfH1i70X9uanfjwxvCvUVZsUhPKk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lw9JtLdL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="uU/H3Vl6"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="Enk/N3N5"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=K3+rNllT; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf05.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de 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-out1.suse.de (Postfix) with ESMTPS id C42C121187; Tue, 1 Apr 2025 09:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1743499654; 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=840D19WfpFNAZY5QCFfrGDfYI8TO5sKOgbuO23DZ7w4=; b=lw9JtLdLIdKvu9i0mG91kZ3D7StKyunFDY8mfWxqJFukjfiAfJXK2tL3pbTSbs+nmtFGQc B/Tc7Yi0IySi2ORhjOjKHkUiqsja56d4G3jWGBIg4Z+4gvPS+ijNzflq9+2bHGmwGSLTR1 OQcyOYRKBt5lT16+z+NFOLifpefh4Jw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1743499654; 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=840D19WfpFNAZY5QCFfrGDfYI8TO5sKOgbuO23DZ7w4=; b=uU/H3Vl6kQPAFn8tP5JBQcCtANPYB41uJO/cbHnsGAZcBn0Gtk7Lb/sRSw/GsCicCQrDzE yEUxprmGwGK+0oDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1743499653; 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=840D19WfpFNAZY5QCFfrGDfYI8TO5sKOgbuO23DZ7w4=; b=Enk/N3N5B7L5sgAnWLc2FD5EV7Zlem1E5JuF/R9xdNAcNhDPZt7uvcvGIaqFzmYGVfmy73 gXTScXLcZg5cLXdwNdqtB2CINqslNgTqA4Y39Hlk1fP2S3uNLYsllRsKWXFeWU53xNR2sR q8SVx4yArqSCjnPWcLBawduakp/bu/0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1743499653; 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=840D19WfpFNAZY5QCFfrGDfYI8TO5sKOgbuO23DZ7w4=; b=K3+rNllT+t5vDmbxvkJyU4AmCpQTmTBpsvBZ5HhIy963KKXroSpzeI6cPGBDWRC8lw+1jx anmdAqf6giHDYnBA== 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 36E3C13691; Tue, 1 Apr 2025 09:27:33 +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 Jkm3CoWx62cnfwAAD6G6ig (envelope-from ); Tue, 01 Apr 2025 09:27:33 +0000 From: Oscar Salvador To: Andrew Morton Cc: David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Hyeonggon Yoo <42.hyeyoo@gmail.com>, mkoutny@suse.com, Dan Williams , Jonathan Cameron , Oscar Salvador Subject: [PATCH 0/2] Implement numa node notifier Date: Tue, 1 Apr 2025 11:27:14 +0200 Message-ID: <20250401092716.537512-1-osalvador@suse.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-Rspamd-Action: no action X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7DE87100005 X-Stat-Signature: 554sbjdgwd91j8m55rm1s3fwex77htpm X-Rspam-User: X-HE-Tag: 1743499655-795455 X-HE-Meta: U2FsdGVkX1+ajmbxibBimOFYul251+bbFTv8V0FbLKcyauL/e9b1/UyQaqO9krg1aVfgJmDnHXMAkhrX8JBsQttAcQj5122SCNsi4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aEp62ZukIIjsqBY/2ckfA8AEtZsqFNjVwobqMDjPWNSzibjFgJvchsZs/lZjDcAjNuHiBaBGfQwf9ejl/C1wIllzP6J6KFBikUEsaG38yGPcaSb0h06vxkkI6G/00EguKoqBpmy8BjJvjHD3P4PPs= 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: 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 has changed its 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. The first 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 second patch replaces 'status_change_normal{_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 Oscar Salvador (2): mm,memory_hotplug: Implement numa node notifier mm,memory_hotplug: Replace status_change_nid parameter in memory_notify drivers/acpi/numa/hmat.c | 6 +-- drivers/base/node.c | 19 +++++++++ drivers/cxl/core/region.c | 14 +++---- drivers/cxl/cxl.h | 4 +- include/linux/memory.h | 37 ++++++++++++++++++ kernel/cgroup/cpuset.c | 2 +- mm/memory-tiers.c | 8 ++-- mm/memory_hotplug.c | 82 +++++++++++++++++++++++++++++---------- mm/page_ext.c | 12 +----- mm/slub.c | 22 +++++------ 10 files changed, 146 insertions(+), 60 deletions(-)