From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0B0C4344D80 for ; Wed, 29 Apr 2026 15:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777477052; cv=none; b=Gx4A1/gLr4xrEmgzwb8rpOwXXwMw+NdtbSxPm9iLu+jj94lm3qyRnznEA6P/L4FjxN7RapIp3RU4lMFrAcYidiCRt64fOZT/Z45rTsh+kdfyighweVV0veE8mIZuRNwnXgSAePDw9rPlbX6JlMmEYBYfqK1lK+Z9xTAkuhzhoVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777477052; c=relaxed/simple; bh=dBcxIGB3prEt2EuN+URD9BjkYZPuyxPQexFsSFds9no=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=StOr5pgftmBqsvEFcPYyD+IAdE47GsBkRFhDaqVY6XAUywjasZLBERfOOaACXfG8nXLa2Gn/vFAsklv1NRrVMvmqaZ1ulj+SvyMD9Ti44+MaU4e6DH0A0FOct8wWvinj7j0g829XoN5EY9zN+LfjHUVUbiSt9UEfaEC9jzj6MVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=WKmsyJXz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="WKmsyJXz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27934C19425; Wed, 29 Apr 2026 15:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777477051; bh=dBcxIGB3prEt2EuN+URD9BjkYZPuyxPQexFsSFds9no=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WKmsyJXzSlFrM1KOOXRL+rDlllSB1diKpuGdprKHA6iUO5kEBlav3buILWcMzw5Cz Qamb9pqLJhl7vBxZRelRsnXd7SdHpVtsYnVxtrR2A4P3BznxTIKr9YwDLkn+UZUYvB UrDgmWIEz2ubQ+VTK2AvC3ETFlRFC1zMUamYWSQw= Date: Wed, 29 Apr 2026 08:37:30 -0700 From: Andrew Morton To: Dmitry Ilvokhin Cc: Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, Steven Rostedt , david@kernel.org, Lorenzo Stoakes , Peter Zijlstra Subject: Re: [PATCH v3 0/8] mm: use spinlock guards for zone lock Message-Id: <20260429083730.c105bc1cff04a8e92a74a32b@linux-foundation.org> In-Reply-To: References: <13149be4f8151e18eb5f1eb4f3241ab3cffb373e.1777462630.git.d@ilvokhin.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Wed, 29 Apr 2026 12:02:05 +0000 Dmitry Ilvokhin wrote: > This series uses spinlock guard for zone lock across several mm > functions to replace explicit lock/unlock patterns with automatic > scope-based cleanup. > > This simplifies the control flow by removing 'flags' variables, goto > labels, and redundant unlock calls. > > Patches are ordered by decreasing value. The first six patches simplify > the control flow by removing gotos, multiple unlock paths, or 'ret' > variables. The last two are simpler lock/unlock pair conversions that > only remove 'flags' and can be dropped if considered unnecessary churn. > > Binary size increase is +39 bytes, with Peter Zijlstra's fix for guards > [1] applied (already in mm-stable). This is due to the compiler not > being able to deduplicate epilogue and eliminate redundant NULL check. > See discussion [2] for more details. I proposed a patch [3] that fixes > this, but until it is merged we need to assume +39 bytes will stay > (though it is compiler dependent). OK, thanks, I'll queue it up. Yet again: the question here is whether those who work on this code like guard(), or would prefer the traditional open-coded locking. Michal was an ack, others were silent.