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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0277C27C5E for ; Mon, 10 Jun 2024 04:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cRGsHovc78HqPwpkZF4S2lrpWeJv3W6RzlKnpFk9zl4=; b=ElbTq/x8dwKzIO j4UC3Sqd4kIqD+4u8iaUI2GPILEBS7rNAjPl3G3q4TddZbNXRAye4Sv8by8mArEU0qsjKeS9bP4+M C6ksFPSuXLf5ekN2YLbkgxPR7pQKkqAk007JiV/QD/j8F5VZWBEp6BFbwHeLu0iRXRiMD7gqP3oX9 Mwty56o7DiaQv4BH5XZduawXanxy8XgsIrAVyv0ntSRDzSQO301EgF+X7/dYz21L0ejGmHj/S61RZ eP41xne8LEcncJG1vf7aabA9dHtOtNe9f7fu6/Myio0+RX+3bpPyEEKc/jDo60IYNgyxjJy9D0w6r Pqw7d/pnzsXQKWeYPXfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGX52-00000003ovV-06oe; Mon, 10 Jun 2024 04:56:28 +0000 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGX4v-00000003otz-1P8m for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 04:56:26 +0000 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 0BAB31F795; Mon, 10 Jun 2024 04:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1717995377; 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=knffddWOyCW0QDl1xKKOijWG3nsccOYGG8rNkmXpwNU=; b=C3X+cyDriMjyqlC6Xi0lZX+KjFXbOZgNqoCT4d7a6qfRsSrgqAal+S/i51BsWuXyXscvBM Yz395GLQ0YHthjfRlgJqoZbTF0h1sR8Lfj0JZwr31RSJ7rb2wclhPIK80I4xZ+xz9vf61z Ysnom1S/sJuhaLhCuqkxKIhT65rs+jY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1717995377; 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=knffddWOyCW0QDl1xKKOijWG3nsccOYGG8rNkmXpwNU=; b=ah92qHp16+13m9WoPghw9Jp/xrp52Qac2Tnk9oeMVbqDrOMRtj6voCjDfzFax2lltlZHxO 7wIP60yurwpqE6CA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=C3X+cyDr; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ah92qHp1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1717995377; 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=knffddWOyCW0QDl1xKKOijWG3nsccOYGG8rNkmXpwNU=; b=C3X+cyDriMjyqlC6Xi0lZX+KjFXbOZgNqoCT4d7a6qfRsSrgqAal+S/i51BsWuXyXscvBM Yz395GLQ0YHthjfRlgJqoZbTF0h1sR8Lfj0JZwr31RSJ7rb2wclhPIK80I4xZ+xz9vf61z Ysnom1S/sJuhaLhCuqkxKIhT65rs+jY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1717995377; 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=knffddWOyCW0QDl1xKKOijWG3nsccOYGG8rNkmXpwNU=; b=ah92qHp16+13m9WoPghw9Jp/xrp52Qac2Tnk9oeMVbqDrOMRtj6voCjDfzFax2lltlZHxO 7wIP60yurwpqE6CA== 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 9593313A7F; Mon, 10 Jun 2024 04:56:16 +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 pY6aIXCHZmbeHQAAD6G6ig (envelope-from ); Mon, 10 Jun 2024 04:56:16 +0000 Date: Mon, 10 Jun 2024 06:56:15 +0200 From: Oscar Salvador To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Jonathan Cameron , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.org Subject: Re: [PATCH] mm/memory_hotplug: Drop memblock_phys_free() call in try_remove_memory() Message-ID: References: <20240605082049.973242-1-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240605082049.973242-1-rppt@kernel.org> X-Rspamd-Action: no action X-Rspamd-Queue-Id: 0BAB31F795 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[7]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240609_215621_555381_FE8925B0 X-CRM114-Status: GOOD ( 21.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 05, 2024 at 11:20:49AM +0300, Mike Rapoport wrote: > From: Jonathan Cameron > > The call for memblock_phys_free() in try_remove_memory() does not balance > any call to memblock_alloc() (or memblock_reserve() for that matter). > > There are no memblock_reserve() calls in mm/memory_hotplug.c, no memblock > allocations possible after mm_core_init(), and even if memblock_add_node() > called from add_memory_resource() would need to allocate memory, that > memory would ba allocated from slab. > > The patch f9126ab9241f ("memory-hotplug: fix wrong edge when hot add a new > node") that introduced that call to memblock_free() does not provide > adequate description why that was required and tinkering with memblock in > the context of memory hotplug on x86 seems bogus because x86 never kept > memblock after boot anyway. > > Drop memblock_phys_free() call in try_remove_memory(). > > Signed-off-by: Jonathan Cameron > [rppt: rewrite the commit message] > Signed-off-by: Mike Rapoport (IBM) Acked-by: Oscar Salvador > --- > mm/memory_hotplug.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 431b1f6753c0..e0d49f128e0d 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -2283,10 +2283,8 @@ static int __ref try_remove_memory(u64 start, u64 size) > remove_memory_blocks_and_altmaps(start, size); > } > > - if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { > - memblock_phys_free(start, size); > + if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) > memblock_remove(start, size); > - } > > release_mem_region_adjustable(start, size); > > -- > 2.43.0 > -- Oscar Salvador SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel