From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 819393F0AAA for ; Tue, 28 Apr 2026 11:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777376858; cv=none; b=q/3c31yAEDRp4UFv4UvzcT6yu9XiWNYR98EgU/ytJs+igFvT72oMa23dX4HIHlLyeviBOR9i3ahQ1W79GsQc4WRT1U2+ZKKLThlYujft8ozRRMe+R7xxkre2INWCok0SECWvL7y2hJFx0AyjVl087cNVytcOyCyVe9Jqr1tQRGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777376858; c=relaxed/simple; bh=p/Z6XM6qfCBdQTqqVYsQEWSqzUMifdWXc2/HFhFrBuk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T+wpPEYqQuI22jYxnXi5MhgHqmgbyvzVKUe4h7aRlOKTJhXHUC3qaZ6oex1NizsrYPzY8aIjYH9RPjeAhhwR1OJLM4E7BM9VfwcRyplkVEzSiOCZAc4dZhJIZ9FhVy0TPWpuG+gLGMXsg85X9oLEyrvA1/8XY6XWYEjoxJz2Vkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ZTGzB46i; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZTGzB46i" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0f8rP5heUGC6F5VBSMw14CaIOiuQPXY1Shr8xqxlZsQ=; b=ZTGzB46iDeFbTICbvy8X9RkG3T uB3IP4Z460bv8unTcbc31PEGV3Kuk/3zS968MHI2qRl8Mb3l813eQWcsdhit+GoNPgUZwdmxGi52Z 7KN79N+z4q+Loi4t8BH7VHAx7+grjRAQb/9dvjcEh6rQRHTnVq5rIgENHTcz3M+QoRCCczdTG/4Qj O4ixjrixiwi+e/RnfiLEcYetjD8Cc90BDD2tbneqoCptAwReNzZvD/vowm5L2W9ZHa0EELPxrLw1g MZSHkShrXCV3NviizhTS4/x8pfZ09TFXvunxYItRLGacVL1v5ycNrOC7qOXdznLXUv50JDLoX+Jop 7sl1uPkQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1wHguQ-00000003jtX-18pJ; Tue, 28 Apr 2026 11:47:22 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id CE1E0301CEB; Tue, 28 Apr 2026 13:47:21 +0200 (CEST) Date: Tue, 28 Apr 2026 13:47:21 +0200 From: Peter Zijlstra To: Dmitry Ilvokhin Cc: dan.j.williams@intel.com, Vlastimil Babka , Steven Rostedt , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 1/8] mm: use zone lock guard in reserve_highatomic_pageblock() Message-ID: <20260428114721.GV3102624@noisy.programming.kicks-ass.net> References: <20260306095336.a79fcc869a7f6d2b2e97501b@linux-foundation.org> <20260306130052.7da8eab3@gandalf.local.home> <20260307131641.GX606826@noisy.programming.kicks-ass.net> <20260309164516.GE606826@noisy.programming.kicks-ass.net> 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: On Tue, Apr 28, 2026 at 10:58:41AM +0000, Dmitry Ilvokhin wrote: > I re-tested my original patchset after rebasing and can still reproduce > the regression (though smaller). It appears to depend on compiler > inlining decisions: in some cases the compiler is able to deduplicate > the cleanup path across multiple return sites, while in others it is > not. I'm confused, all this has __always_inline on. And the compilers should be able to track the assignment of the variable and eliminate the test themselves if value-tracking excludes NULL. > Given that, I think we can go further than just removing > __GUARD_IS_ERR(). It should be possible to eliminate this branch > entirely and simplify the cleanup flow. > > https://lore.kernel.org/all/20260427165037.205337-1-d@ilvokhin.com/ > > Reposting here to increase visibility, as several people involved in > this code have participated in this thread already. > > Any feedback would be appreciated. This would require very careful audit of all the current users, it's had this behaviour from the start.