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 2474AC71135 for ; Mon, 16 Jun 2025 08:30:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62F6C6B008C; Mon, 16 Jun 2025 04:30:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E0116B0092; Mon, 16 Jun 2025 04:30:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CEEA6B0095; Mon, 16 Jun 2025 04:30:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3D8EC6B008C for ; Mon, 16 Jun 2025 04:30:26 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E5B98BD838 for ; Mon, 16 Jun 2025 08:30:25 +0000 (UTC) X-FDA: 83560592010.19.02B2DA8 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf24.hostedemail.com (Postfix) with ESMTP id AA550180011 for ; Mon, 16 Jun 2025 08:30:23 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1hz2n+Jx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tWOMfBkx; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1hz2n+Jx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tWOMfBkx; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 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=1750062624; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3aX0NRoJxcW3u/fu9obhKehgI7vwsQ+JsjDf2wKCRV0=; b=3smOejbn6C1e7iHv0cO5XyFuspU+uzE84/akg0hLB1ZGOe34TrZJVX0UyUlSqqPloyDAhr DLoKUPAATG6v5whdkXv1T/s0KARO0B9iZnoCqCsOQJKMdgmxTuakKHnUoVVSpywvtgrsSU 6k5BUaMEYj/0y7aANKgeMsJooSZnldo= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1hz2n+Jx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tWOMfBkx; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1hz2n+Jx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=tWOMfBkx; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 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=1750062624; a=rsa-sha256; cv=none; b=NUQHmTGZVLoaNrgT12uQ2StGyD5sB/PdLbXgEbOLlgkHeoPOGqExsAFdtv0x9/njjxqoEJ oEKmLHjlKa6jN89qyMDjEAwi6Pzphrq0IvPijYn2ftHu/rovMDxMbNceeJi1nX519IFcLO qbQJil8PZA/qJNtmAQF9FmxiMP3YZK4= 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-out1.suse.de (Postfix) with ESMTPS id 16140211F7; Mon, 16 Jun 2025 08:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1750062622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3aX0NRoJxcW3u/fu9obhKehgI7vwsQ+JsjDf2wKCRV0=; b=1hz2n+JxBvGkv8bj7q++Zv4/XgkyDe9nVZ1B++XURNscZRaePu/8vuTLQ2HnVyctKEkd+H lT42M3U69v9A5BUHUGJrpMXpNUA8aSP48s1ORonhdmSzBgf29jrkv/7qE0wyn6rUuVlCyT h0Zfxug4SJTYZo2M470H3K2KUNJiKq0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1750062622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3aX0NRoJxcW3u/fu9obhKehgI7vwsQ+JsjDf2wKCRV0=; b=tWOMfBkxSbBlJ1SHucZE4sNz8IRn55vhIMXIkxXLjwgRjX+KddebWcsJUHUd0Qb9J/cum1 TbEasZXWE5ERYsBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1750062622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3aX0NRoJxcW3u/fu9obhKehgI7vwsQ+JsjDf2wKCRV0=; b=1hz2n+JxBvGkv8bj7q++Zv4/XgkyDe9nVZ1B++XURNscZRaePu/8vuTLQ2HnVyctKEkd+H lT42M3U69v9A5BUHUGJrpMXpNUA8aSP48s1ORonhdmSzBgf29jrkv/7qE0wyn6rUuVlCyT h0Zfxug4SJTYZo2M470H3K2KUNJiKq0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1750062622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3aX0NRoJxcW3u/fu9obhKehgI7vwsQ+JsjDf2wKCRV0=; b=tWOMfBkxSbBlJ1SHucZE4sNz8IRn55vhIMXIkxXLjwgRjX+KddebWcsJUHUd0Qb9J/cum1 TbEasZXWE5ERYsBQ== 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 817A8139E2; Mon, 16 Jun 2025 08:30:21 +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 K5otHR3WT2j8OQAAD6G6ig (envelope-from ); Mon, 16 Jun 2025 08:30:21 +0000 Date: Mon, 16 Jun 2025 10:30:19 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Andrew Morton , Vlastimil Babka , Jonathan Cameron , Harry Yoo , Rakie Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joshua Hahn , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 03/10] mm,memory_hotplug: Implement numa node notifier Message-ID: References: <20250609092149.312114-1-osalvador@suse.de> <20250609092149.312114-4-osalvador@suse.de> <2bec8b53-f788-493e-a76e-1f804ed3aa0c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bec8b53-f788-493e-a76e-1f804ed3aa0c@redhat.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: AA550180011 X-Stat-Signature: 5fp3zkj8t6mjs7odddabe1r3ny3nrrbt X-Rspam-User: X-HE-Tag: 1750062623-82444 X-HE-Meta: U2FsdGVkX18u6LgDK1DXUH/FQDR3195g4U/onTNJy8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nhgCImOG2sKirYeKcs2XvdRbiP41z+ezx88tvM32dbcb8AOuisdj0TwBeSrT6L8wUx7F48LJI874i6hWIrBsLy7k6jBw46ZMfc+YSMRHudN0AZIyTypGryUaKvzvF6YsgraYAOUe0lHi/C+BRbMyPSVFnB9Rgh5U03EAN3741gioATDArPPMUsr1MBvZZKQZo3f33xl3hzUPjgQbLaRt+2pnByJUF 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 Tue, Jun 10, 2025 at 10:10:21AM +0200, David Hildenbrand wrote: > On 09.06.25 11:21, Oscar Salvador wrote: > > +The first argument of the callback function (self) is a pointer to the block > > +of the notifier chain that points to the callback function itself. > > +The second argument (action) is one of the event types described above. > > +The third argument (arg) passes a pointer of struct node_notify:: > > + > > + struct node_notify { > > + int nid; > > + } > > + > > +- nid is the node we are adding or removing memory to. > > + > > + If nid >= 0, callback should create/discard structures for the > > + node if necessary. > > Likely that should be removed? Yes, indeed. > > It' probably worth mentioning that one might get notified about > NODE_CANCEL_ADDING_FIRST_MEMORY even though never notified for > NODE_ADDING_FIRST_MEMORY. (same for removing) > > I recall this can happen if one of the NODE_ADDING_FIRST_MEMORY notifiers > fails. > > (same applies to MEM_CANCEL_*) > > Consequently, we might simplify the cancel_mem_notifier_on_err etc stuff, > simply unconditionally calling the cancel counterparts. So, I managed to do another respin with all feedback included, but I left this one for the end, and here I'm. It's true, currently users can get notified about e.g: MEM_CANCE_ONLINE without going through MEM_GOING_ONLINE if another user fails for the latter, but I'm trying to workaround the fact why that's not a problem. Because assume you have a user of MEM_CANCEL_ONLINE, who thinks it got called for MEM_GOING_ONLINE, while in fact it didn't because some other user fail on it, and it tries to free some memory it thinks it initialized during MEM_GOING_ONLINE. Isn't this a bit shaky? I mean, yes, I guess we can put the burden on the users of the notifiers to not assume anything, but then yes, I think we should document this as it can lead to potential misbeliefs. -- Oscar Salvador SUSE Labs