From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA3273B6C02 for ; Thu, 14 May 2026 09:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778749852; cv=none; b=JGDIbI525MiH8FYcBOPBTPINApEl6ZSJIBQriS8xa0WWFw5VO7cj2p3pJs/1wcTdMYsVJAvBn7gCHyxhcO+dxl5HLEga/Kjnh4+ewViMq659Rueilc2vrFkJOtk1TxcSaXuAJkvU2eniuG+Rwtl1G1k+AC0gJuNIUD0paw1OyPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778749852; c=relaxed/simple; bh=hbCpKmSjnQM9BnmSvBClYpw150h5deNbBvgw7StNIRw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mrz25mFzEt9MNaiGxMEnjt0a1e7QXEMRymzTiQA6PGIFlRMq1wH9KBccvWNkhDol5tHUOd5uuJJj5kXtEE7ELyPq6qFyQM6YJSr+7CFcmmBGLc0hqhtxViKRDR9uuPJvvUPYtW6RcM1mXN034aSk10LweXwAXB/l2JJS4wnHyWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=n7nqNzMi; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=sC09+8+7; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=n7nqNzMi; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=sC09+8+7; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n7nqNzMi"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="sC09+8+7"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n7nqNzMi"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="sC09+8+7" 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 2057166D49; Thu, 14 May 2026 09:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778749849; 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=N02BDNbIIy3mrxP163anPLxP+RFbS21R7W+6zJLh/9M=; b=n7nqNzMiQjIT87bTfbEiS50xRXvGbJ1xgcV38pSySqxfhjdoWUS6gdghzpINMGhi9Nw7ac rjRmQPtZNWUx/EzA0lhndCHvfPt7RRc5uGt6IKy3dsRk60KkTlNS+/xZNcslr9oo8NGOhz f57dBjvu1QgRB6ApXh7jn0g6q+hGHQ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778749849; 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=N02BDNbIIy3mrxP163anPLxP+RFbS21R7W+6zJLh/9M=; b=sC09+8+78AN2yGLSHhLbQYS+cldn424UoaMr0t9cHTOvoN2FDU4GzTjkJ+wXWS1TusJoE7 qPX5ejOrBpMXDNBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778749849; 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=N02BDNbIIy3mrxP163anPLxP+RFbS21R7W+6zJLh/9M=; b=n7nqNzMiQjIT87bTfbEiS50xRXvGbJ1xgcV38pSySqxfhjdoWUS6gdghzpINMGhi9Nw7ac rjRmQPtZNWUx/EzA0lhndCHvfPt7RRc5uGt6IKy3dsRk60KkTlNS+/xZNcslr9oo8NGOhz f57dBjvu1QgRB6ApXh7jn0g6q+hGHQ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778749849; 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=N02BDNbIIy3mrxP163anPLxP+RFbS21R7W+6zJLh/9M=; b=sC09+8+78AN2yGLSHhLbQYS+cldn424UoaMr0t9cHTOvoN2FDU4GzTjkJ+wXWS1TusJoE7 qPX5ejOrBpMXDNBw== 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 A908D593A9; Thu, 14 May 2026 09:10:48 +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 cO54JpiRBWr2cwAAD6G6ig (envelope-from ); Thu, 14 May 2026 09:10:48 +0000 Date: Thu, 14 May 2026 11:10:43 +0200 From: Oscar Salvador To: Kaitao Cheng Cc: linmiaohe@huawei.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kaitao Cheng Subject: Re: [PATCH] mm/memory-failure: Use zone_pcp_disable() for poison handling Message-ID: References: <20260514085754.84097-1-kaitao.cheng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260514085754.84097-1-kaitao.cheng@linux.dev> X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[huawei.com,gmail.com,linux-foundation.org,kvack.org,vger.kernel.org,kylinos.cn]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo] X-Spam-Flag: NO X-Spam-Score: -2.80 On Thu, May 14, 2026 at 04:57:54PM +0800, Kaitao Cheng wrote: > From: Kaitao Cheng > > __page_handle_poison() used drain_all_pages() instead of > zone_pcp_disable() because dissolve_free_hugetlb_folio() could restore > HVO vmemmap pages and decrement hugetlb_optimize_vmemmap_key. That static > key update took cpu_hotplug_lock through static_key_slow_dec(), while > zone_pcp_disable() holds pcp_batch_high_lock. CPU hotplug takes the locks > in the opposite order through page_alloc_cpu_online/dead(), so the > combination could deadlock. > > That dependency no longer exists. Commit da3e2d1ca43d ("mm/hugetlb: > remove hugetlb_optimize_vmemmap_key static key") removed the HVO static > key and the static_branch_dec() from hugetlb_vmemmap_restore_folio(). > The dissolve_free_hugetlb_folio() path no longer reaches > static_key_slow_dec(). > > Use zone_pcp_disable() again while dissolving the hugetlb folio and > taking the target page off the buddy allocator. This prevents the drained > PCP lists from being refilled before take_page_off_buddy() runs, making > the page isolation deterministic. > > Signed-off-by: Kaitao Cheng Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs