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 6A7E9C36010 for ; Fri, 4 Apr 2025 08:50:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8BD96B000C; Fri, 4 Apr 2025 04:50:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B7E6B000D; Fri, 4 Apr 2025 04:50:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDAED6B000E; Fri, 4 Apr 2025 04:50:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B16586B000C for ; Fri, 4 Apr 2025 04:50:55 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 27E111225AA for ; Fri, 4 Apr 2025 08:50:56 +0000 (UTC) X-FDA: 83295741312.15.12F3DA7 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf24.hostedemail.com (Postfix) with ESMTP id 444BC180005 for ; Fri, 4 Apr 2025 08:50:52 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dqyFuZ0o; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=w2rQ9U7L; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dqyFuZ0o; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=w2rQ9U7L; dmarc=none; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743756654; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=al/KGWINhLbwxqwLgfJXN1NKo8O3SXov2ubbI/5HcV0=; b=JvbtzPa6WBBsQ2yrztg/Ko0Vmc+iOBUDlgRDs0lOtcM/dggiMolOXtxPCOZG8x/FUtuO8b e5anpgA4cNElOqB3wmSp+dI1xN8/lJ87VTB8CZlifK5h5PflWxUxhg402yt5tQ7/gE3s7D Hl5QlKYs5k5o94e4mM7KnanZsGnZ6N8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dqyFuZ0o; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=w2rQ9U7L; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dqyFuZ0o; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=w2rQ9U7L; dmarc=none; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743756654; a=rsa-sha256; cv=none; b=y1MSwQ0KXRZ2DCxTusgh62UwNkyxEYfjsk3u9+MIG7xShIqlOq2MpxoLGFK2LY9rUWzlea QBWlYCFS1pYmACTvfQFDRbRtthEdGHkPb4td/CEwSh/2+9aMnTEwc6UuQcCRakmfqe2Tkm 23QXFuXZZviBHmwV9QA9JsRffnp8pRw= 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 3E2B91F385; Fri, 4 Apr 2025 08:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1743756650; h=from:from:reply-to: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; bh=al/KGWINhLbwxqwLgfJXN1NKo8O3SXov2ubbI/5HcV0=; b=dqyFuZ0ob8nMFh7+OXygQwnQW9glQvatYrHsslYiRlROrasnbhZ0BWKjWxaYq8p51LR/vQ g7g/0oxMNffTiV2iskcqX5KPHIiZ1I890R2rArzAV3nB4iydliqEifnVoEnZd7KnqmOEZN DYOa2W9r21ZA6DVgMooiOqcWEBIHhx4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1743756650; h=from:from:reply-to: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; bh=al/KGWINhLbwxqwLgfJXN1NKo8O3SXov2ubbI/5HcV0=; b=w2rQ9U7LYdkpPj3ZKH/JhXoEWGn0sZFt5ZR5xdamz3gCPFm0yYFGCUBpythm0KSThUXriG dUiKRnthkKSa8yAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1743756650; h=from:from:reply-to: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; bh=al/KGWINhLbwxqwLgfJXN1NKo8O3SXov2ubbI/5HcV0=; b=dqyFuZ0ob8nMFh7+OXygQwnQW9glQvatYrHsslYiRlROrasnbhZ0BWKjWxaYq8p51LR/vQ g7g/0oxMNffTiV2iskcqX5KPHIiZ1I890R2rArzAV3nB4iydliqEifnVoEnZd7KnqmOEZN DYOa2W9r21ZA6DVgMooiOqcWEBIHhx4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1743756650; h=from:from:reply-to: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; bh=al/KGWINhLbwxqwLgfJXN1NKo8O3SXov2ubbI/5HcV0=; b=w2rQ9U7LYdkpPj3ZKH/JhXoEWGn0sZFt5ZR5xdamz3gCPFm0yYFGCUBpythm0KSThUXriG dUiKRnthkKSa8yAA== 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 0EC3113691; Fri, 4 Apr 2025 08:50:50 +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 QlMaA2qd72evAQAAD6G6ig (envelope-from ); Fri, 04 Apr 2025 08:50:50 +0000 Message-ID: Date: Fri, 4 Apr 2025 10:50:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] Implement numa node notifier Content-Language: en-US To: Harry Yoo , David Hildenbrand Cc: Oscar Salvador , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hyeonggon Yoo <42.hyeyoo@gmail.com>, mkoutny@suse.com, Dan Williams , Jonathan Cameron References: <20250401092716.537512-1-osalvador@suse.de> <78c976ba-1eaf-47b7-a310-b8a99a3882e2@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 444BC180005 X-Stat-Signature: cjtfh77cdojt6ufj4a9izukotdhtf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T3EbGru4LnYBAOmghHBUa2iImKpzq80NOu5QnXv4eJI9YuZatlOyzrNWFwZcoI9hOl1YvgeJhHGEhAo0nw+GNT7zmPJ4tqL2w4gOiQWjdBKTFO/wRVWzndJt8K6ubGr4T2fcom1ZtuhfAgOwBBIfRuGuPTX9iHxfM9hpuH5yVuKaT8aGfLxCUi4UaeT4HkKKDkPBItaZg87BmW6JoZAQUuVpzyErrD71+8jZ0ul5pckLMp9rcYHYyZW08VVxiZw39PqocVJ8k7YwjMHFI5eOW6Ht7aYU+HmNYORPOEzh99GHmmzAtis3QO+3cUGdg7/ycegEr6WrW22VBq4NGJ8oiYgkS+iU8e6Ac 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: On 4/4/25 00:06, Harry Yoo wrote: > On Thu, Apr 03, 2025 at 03:02:25PM +0200, David Hildenbrand wrote: >> On 02.04.25 19:03, Oscar Salvador wrote: >> > On Wed, Apr 02, 2025 at 06:06:51PM +0200, Vlastimil Babka wrote: >> > > What if we had two chains: >> > > >> > > register_node_notifier() >> > > register_node_normal_notifier() >> > > >> > > I think they could have shared the state #defines and struct node_notify >> > > would have just one nid and be always >= 0. >> > > >> > > Or would it add too much extra boilerplate and only slab cares? >> > >> > We could indeed go on that direction to try to decouple >> > status_change_nid from status_change_nid_normal. >> > >> > Although as you said, slub is the only user of status_change_nid_normal >> > for the time beign, so I am not sure of adding a second chain for only >> > one user. >> > >> > Might look cleaner though, and the advantatge is that slub would not get >> > notified for nodes adquiring only ZONE_MOVABLE. >> > >> > Let us see what David thinks about it. >> >> I'd hope we'd be able to get rid of the _normal stuff completely, it's seems >> way to specialized. > > Hmm, perhaps we can remove it with as part of this patch series? > > status_change_nid_normal has been used to indicate both 'There is a > status change' AND 'The node id when the NUMA node has normal memory'. > > But since NUMA node notifier triggers only when there is a state change, > it can simply pass nid, like patch 2 does. SLUB can then check whether the > node has normal memory. Well the state change could be adding movable memory, SLUB checks that there's no normal memory and thus does nothing. Then normal memory is added to the node, but there's no new notification and SLUB is left without supporting the node forever. But with David's suggestion we avoid that problem. > Or am I missing something? > >> We added that in >> >> commit b9d5ab2562eceeada5e4837a621b6260574dd11d >> Author: Lai Jiangshan >> Date: Tue Dec 11 16:01:05 2012 -0800 >> >> slub, hotplug: ignore unrelated node's hot-adding and hot-removing >> SLUB only focuses on the nodes which have normal memory and it ignores the >> other node's hot-adding and hot-removing. >> Aka: if some memory of a node which has no onlined memory is online, but >> this new memory onlined is not normal memory (for example, highmem), we >> should not allocate kmem_cache_node for SLUB. >> And if the last normal memory is offlined, but the node still has memory, >> we should remove kmem_cache_node for that node. (The current code delays >> it when all of the memory is offlined) >> So we only do something when marg->status_change_nid_normal > 0. >> marg->status_change_nid is not suitable here. >> The same problem doesn't exist in SLAB, because SLAB allocates kmem_list3 >> for every node even the node don't have normal memory, SLAB tolerates >> kmem_list3 on alien nodes. SLUB only focuses on the nodes which have >> normal memory, it don't tolerate alien kmem_cache_node. The patch makes >> SLUB become self-compatible and avoids WARNs and BUGs in rare conditions. >> >> >> How "bad" would it be if we do the slab_mem_going_online_callback() etc even >> for completely-movable nodes? I assume one kmem_cache_alloc() per slab_caches. >> >> slab_mem_going_offline_callback() only does shrinking, #dontcare >> >> Looking at slab_mem_offline_callback(), we never even free the caches either >> way when offlining. So the implication would be that we would have movable-only nodes >> set in slab_nodes. >> >> >> We don't expect many such nodes, so ... do we care? >> >> -- >> Cheers, >> >> David / dhildenb >> >> >