From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 A5CE629B766 for ; Mon, 7 Sep 2026 22:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788820041; cv=none; b=ZiyV0ndOhfaQEECbLNhjODylj9CJD1Txarjz4glO1XTyJwObvqwX2rKoiFFHSR0sS8SAPDBxCaNlwj6+VWZaj+N1ArOvGhjXigVBYPQDMUD7Y/4yMLJIFsgxBBXl9XfinW8qk03hIyE8AjATkVhy6vkScQR13USzNpr+nmUG3PI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788820041; c=relaxed/simple; bh=w089gXyEOCJY9gUZSUVwdihbdEuqGTphnzmTU3c5wIg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aj8YFFAGt6jQCNZhbXYCvdggae9JIEEYNpLLiNMKoqmRQ1njCW4Xq1qh85sHm60xj+LU155FS+dJb2VAXgHmRSTYOxWd3EqI+bYD61hVEsqEtOmiEsNyJ9MsiNXfr9q8l+7XHBXIXiwKQhUbzYMWrt2UYDsjZ2F9QpVsTgK43YU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=gaVEiIr+; arc=none smtp.client-ip=209.85.160.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="gaVEiIr+" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-5301a453186so37794571cf.2 for ; Mon, 07 Sep 2026 15:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1788820038; x=1789424838; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=voF+0uPdvqMWSZZsE3DB359nSHA2KdFl0fM0Svv/P2k=; b=gaVEiIr+tWszuP7yIhlBLyyh6/EQoRUbXiocZyOvHCAyBAuFNw4GjNq+ApFupWmr+O +tDD4hPSE0KEVpVFxDgs2hlVMnH1STJdy/eJU1jdZzOxgpd3KhkSPxtbMxAeux4ifkJj dOgDQjsDRKYUGY83uMid7eSJa1jVyw8TBHH/DDUJC6VYhuPT7QNQmV+is1/w9MxWB06L /vIil5JV+IF72ZbJZw8oKRphab6uPo5BZN6FIITg8v049OxKRawJ4GU2ukGXiu/xBflG ehUOPG5JWTfgduNbsO32bN/kw2Jv9lVlhfbTfLG7myRDbuVZOHJn8mctdilaaubRODmi GRXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788820038; x=1789424838; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=voF+0uPdvqMWSZZsE3DB359nSHA2KdFl0fM0Svv/P2k=; b=AqY58deVK+60lrtqfPFCKcK3K6kiVD3D4ksZCjGfrzzORc6gw7lYuBF5GHEAz9Kyhi h5AzeTRvSmB1QHpQgh86PbaG3zJhdnhJ1KKCzHmadzXSb/CC4l+LbxzMGK6vnfU3UbtH TQxjmp5jsSWHR5zBgq/IWVaaTyDjtsIJS5vkqBW4mm+G7+XEuF6rigu//ORzCarNEfgc 14skl6irpllXiQUH5/7uDO9pkTtWYy2fXWrJ7CXDQBs/dlewhu34y/NcFKP04P/8BkZV s3sSYpyjjrVmlA8DUFESrJTUmqVaAe5deG26+d+Vk+04pVLJj1gyv+Wu8r6ewQ/6iDdA FMpQ== X-Forwarded-Encrypted: i=1; AKwUvBw583QmDEcYqTNESCuJBbhygWtwKu/mCoylGSx8rin4/wNZlVMhzcWzAbiB4KpziM13fAlWTjPuAiY8AYO74zbDUvU=@vger.kernel.org X-Gm-Message-State: AFuF++nPEhNSvF3Fvnd4WlGLIiu1y6d1g/pFt7pzOxDLWKlVELMHYjYq E64NhLB1hKqBYPvwhEBXVVM37bA5mQ7UFBk0YMPnIlruNTCGPgjqDqKcFNqXfJQ43JA= X-Gm-Gg: AYBFou1Koi0YLMzzIIlqCkECeMBo19KYy+QK9zzVeKPJbPV8ZcyAQ8skESv+Hlb3wlZ ug+BueoZt1lKXlJ+rwEku+VFx9fOfUM/aQpcxb/OwuLFTtvsBefc0QxyjUwEO6kR+5k+QGsplZJ ITT74l29kKnZ/QhUodnjbMwJS05NNFl86nMBWDF5cYJvyrCFUUHhY6dE0Xl5Aizydse/PSctl+Z bjhPOVp+k+ZX6vzpDhkFeqyhPrfMVE9ckyCDiSAi1A5vH/owBiKG/DKF89HM4dKRa8NUSIuO2Om 3KwrcBSPHklZVj6dpWkDQ3VIhF49zfoorPJW6Os90DYZgrNN5PmizjfazHw2oedZ2BUThfUpgtX eNJYGxqIBMpzqU85YCojoRgNDiBbhBip24ZfAyG+MJCSIvkPojP1sapTOpE7upuIrnP7ZBeQw/d uKc6wWLFT4ar3BCRK5Fxp3Brru9rdu10dHzJaCWK/dfERXaVZO28VYoEGeHMcRRPV4lSqBlkHCd f+zg0hzcoSceALo5pJPeLwRCRieWkiuQDd5GoytPoeV X-Received: by 2002:ac8:594c:0:b0:52f:b1b6:a4aa with SMTP id d75a77b69052e-530547fb02fmr300586681cf.4.1788820038503; Mon, 07 Sep 2026 15:27:18 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-53080ce82aesm39676931cf.31.2026.09.07.15.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2026 15:27:18 -0700 (PDT) Date: Mon, 7 Sep 2026 18:27:14 -0400 From: Gregory Price To: Oleg Nesterov Cc: Ye Liu , Thomas Gleixner , Peter Zijlstra , "Rafael J. Wysocki" , Andrew Morton , Ingo Molnar , Will Deacon , Boqun Feng , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Juri Lelli , Vincent Guittot , Steven Rostedt , Masami Hiramatsu , Josh Poimboeuf , Ye Liu , Michal Hocko , mic@digikod.net, david@kernel.org, linmiaohe@huawei.com, nao.horiguchi@gmail.com, gnoack3000@gmail.com, ljs@kernel.org, sj@kernel.org, rientjes@google.com, shakeel.butt@linux.dev, xu.xin16@zte.com.cn, chengming.zhou@linux.dev, tony.luck@intel.com, reinette.chatre@intel.com, x86@kernel.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, pavel@kernel.org, lance.yang@linux.dev, pmladek@suse.com, longman@redhat.com, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, qiang.zhang@linux.dev, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, mark.rutland@arm.com, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rcu@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v2 5/8] kernel: convert process/thread iterators to for_each_*_rculock Message-ID: References: <20260907081334.1152889-1-ye.liu@linux.dev> <20260907081334.1152889-6-ye.liu@linux.dev> Precedence: bulk X-Mailing-List: linux-trace-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 Mon, Sep 07, 2026 at 11:54:41PM +0200, Oleg Nesterov wrote: > > > > This might be my - admittedly shallow - understanding of scoped_guard, > > but does scoped guard handle goto correctly? > > Yes, it does, > > > and why it's generally discouraged to mix cleanup.h and goto. > > Hmm, why? I didn't know... > one of the reasons to use cleanup.h it is to eliminate the "goto for exit cleanup" mechanism in the first place (says so in the first paragraph of cleanup.h). Later in the header is explicit says don't mix: * Lastly, given that the benefit of cleanup helpers is removal of * "goto", and that the "goto" statement can jump between scopes, the * expectation is that usage of "goto" and cleanup helpers is never * mixed in the same function. I.e. for a given routine, convert all * resources that need a "goto" cleanup to scope-based cleanup, or * convert none of them. This particular patch only does a partial conversion - so it's a bit of an anti-pattern. Reading up on scoped_guard a bit more it seems you're right it handles the issue to jump-out, but i can see why cleanup.h says "don't do that" because it's confusing to look at / hard to reason about. ~Gregory