From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 1EEE53F44EB for ; Mon, 7 Sep 2026 21:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788815123; cv=none; b=u0H8Xs5DUc2ZerG8vGUd+AKeh/y3hYpoWaj2uAACl4PtFd+sBZUOtRhmlwfqTeinnFLvzvOdcGxNq2QDc33KH6VBF9ko0YHTgr78aoLxqphp+9JHM0C+h2vLEuCO6pZaB/eG4wcm82YumIaOxRyFtBOISlvxWKvXNAjSgST/ruk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788815123; c=relaxed/simple; bh=UJGiGn2L6JlGWKi00NV6I86Kya9Dh8i6c/d0ym4ux+s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SjnONJOF8f21pzUwcnWSC1CmkEjuFBUV7v1bzSusTn5Yo0rhpmELVWDJDtFHl6HQ+qdSdgEuyZS60HnvbfFYC4p79RHbP6ANyn3dzBkeqmArXauFib1GU1ISXLXtuiZYRcDGywKfLSOLLZ9pkKsFLZzoCT1uWu4BHfcJf8YA8xw= 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=cwfRj0Eu; arc=none smtp.client-ip=209.85.222.181 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="cwfRj0Eu" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-92f0b5ed131so475414985a.3 for ; Mon, 07 Sep 2026 14:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1788815120; x=1789419920; 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=jr5pTyJqXfvpszR/f6xdIiW4q3ltvvAQPTAcZR/VHKM=; b=cwfRj0EuGT8r0csM3DJky7VB9De0Icu2GDXtIvRlZqxLdmvO7mCHZRG5fQbndYJ4oO J43XMFZlpeBwItWjZhxc4pdb6mvqQoAAFpPSTlVOdbACto/BIrOcs5jxFZQQnWqgK1hQ ocf/erDEK2Xnnw9DctkL/hHH0xi7KGn8bE5SMh02lnmzrtlF711Fl5/2PATJ409jKaMj O03gUkpUsoz/Ji6+mn6cRlnTJfEfzElDQPpN82DY4cSq/0XMvxracxiL1DKLVn1zC8/a WstEOPvR3b3Y8Dd0nW4ywk6a1VNSWUccBRenO/gnpOABPhyKse8qGBQO0VuJpAXTg6EM oa4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788815120; x=1789419920; 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=jr5pTyJqXfvpszR/f6xdIiW4q3ltvvAQPTAcZR/VHKM=; b=Pni1Cx+oWHjrErOStzHctxOawr0/0YOMbKJsCRY8nGM/rYeo3+gBmwEZfJNhGak8WP UrJUN8dFvcdvbaH/5YISdVJaCcJVF0IehzvT3RoZzhpZGFu+OvKh9LhL+DbqwfIvjeWH erI3CuUp4ZP/0vWhw9wgumyn3R+vlBO7uap8skfw9HtywG7CobCee4qL6Hu9MX/FxPUB kXMa2LnUONyKLr2Zj9B/CXOUYMBrgE+ECU12FV6IUQxZ8rH1cyVrbEz3lOAXnrsJEpCc XSK0veZaU3o/Bi8Uy3QtZjFzo3JBKcxAtkTu3NQg5BCeScHAsN0xQDY4M3Fw56ABYFUz srqQ== X-Forwarded-Encrypted: i=1; AKwUvByvBY2xM0tJNPzwK+V8NbJkLlwklbAvf9sCuH1mcLCtSxY2hdlcygzP+/CCYXR3/sSmHPpe0H9SJ5RUUNvUSWl5iKU=@vger.kernel.org X-Gm-Message-State: AFuF++l4XEATk6HHJFQqSHdiRtqcU9nom81dXkToLY7nErtPBVah4N3J 0mrQBhhqzCL+7kxFq5GlYIuyNkliXb0PY8EQ31aOkDYEk6LLBH5iVcyzyvNP5AvH0Zw= X-Gm-Gg: AYBFou39lAnUXSoteJ83oHm44ygycFWD4pwWps9pX04BYplKLZ2KcT5REGV9ZvMmmKA nUNlw8xaP2gDVmiGSUjE8l96XjBwdUGcV9HYtN3ia1ptZmOUXsB/hcyp03xgrkn8oDNzqYzlC9h b7BZJCsQ+/LVVMPuIOGZCymxPJlgcDgC5Ead0RRTgMgO+/zM4qhBl0FYxTY2U/nHWt4c5tMpReV rLIOcXVyZ78gyUUPwVHeM8Sg0D3YyljUJordAVxXbcXCfrNePIpuAoUq2rowH7CW91bICkyMxwT W2aIaPIkBl3Aftzm9nAPBp+8j+qUQ8wUuasKUpFMey8OAM7RWINPSB9yj5d5jEcGBolWaWmbyqp therANqW5ijCgitg/DLMEv2wGkX4YF5uYrMdx7HrgxFf0qFA9mw72jLpPLhH0E/PkQXwdcW7hFz 7mDlylMzqAVcY5C7Aqcy39hM8O8irIIM1AShTmwdzUt4cYZ/1Fu5fQKhsqlswIEOTnJgCVGm2Dn YePwE8FgDxlablE0kgZZIpei4hzH8lnDHA4qv8a0Ygl5ld+u65YSJE= X-Received: by 2002:a05:620a:404c:b0:939:df5:977c with SMTP id af79cd13be357-93980361c84mr2678122285a.19.1788815119859; Mon, 07 Sep 2026 14:05:19 -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 af79cd13be357-9399429b97esm677101585a.29.2026.09.07.14.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2026 14:05:19 -0700 (PDT) Date: Mon, 7 Sep 2026 17:05:15 -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 07:57:15PM +0200, Oleg Nesterov wrote: > On 09/07, Gregory Price wrote: > > > > On Mon, Sep 07, 2026 at 04:13:31PM +0800, Ye Liu wrote: > > > --- a/kernel/hung_task.c > > > +++ b/kernel/hung_task.c > > > @@ -315,13 +315,12 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout) > > > return; > > > > > > this_round_count = 0; > > > - rcu_read_lock(); > > > - for_each_process_thread(g, t) { > > > + for_each_process_thread_rculock(g, t) { > > > if (!max_count--) > > > - goto unlock; > > > + goto out; > > ... snip ... > > > - unlock: > > > - rcu_read_unlock(); > > > - > > > +out: > > > if (!this_round_count) > > > return; > > > > > > > The sunken rcu_read_lock()/unlock() + scoped_guard usage makes this goto > > at a minimum very confusing, if not actually broken. > > I am afraid I misunderstood you concerns... > This might be my - admittedly shallow - understanding of scoped_guard, but does scoped guard handle goto correctly? On the surface it looks like it would skip the unlock entirely. That is what i mean by "at a minimum very confusing, if not broken" and why it's generally discouraged to mix cleanup.h and goto. ~Gregory