From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A6C7E51FCD1 for ; Mon, 7 Sep 2026 17:57:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788803860; cv=none; b=oCf/UqL7MQJIan4omCoY94KnGumWO14LZcXx5j/JlfPIv82hbvheVz41mG++JVgGckjZmmD1cvzW2jqB6zm8TQ61viH0Ge4B8PDP8QhRuK9MzETaOBmN6qo1c+nbwXxIQNXk+G7NQPLEeWzzqP+USEBJ4Fi11SqtaMeVRa4VP0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788803860; c=relaxed/simple; bh=7j1GuZlr4DkZd3tFGTmsdUmo9C7PnISCitw4kPz9VIU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lWvYCYgMXnrWGkuvJCwCocYi8KMb4OF37IXVVinjFmJtzusMme2HDvlVmCVD3ewm/lF+G526uvm+yao42IWxuP8lJwAaAmpyYYXVfBhlOswkjPUAN54LH0iC29O0oBIIEu4nyG73igK0ZCpTiv1b84krROI09ArkYJ1CSeuILJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eA9SIVvc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eA9SIVvc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788803857; h=from:from:reply-to:subject:subject: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=PBB+Ha5hfEwnTM3XMtEUMJZL5woFR7RP7WxRg6VNgHk=; b=eA9SIVvcwUwN/IMgAUfAn6PPs8HXxhKrC7EDc1fOYTQKZaUmTILFb23gJWK9jG0eVkovhG MTXCteAfw1nrdwgiYf/fPdjG7uv2GKS5UjV5iYQtY2jOG2BxhAcMdO2v+5ExaViXSfoL9M VD3E35Ymvrhb8p9EQg0ayz6NFAia86g= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-599-LOu-IESzNa-TentWVwO3qQ-1; Mon, 07 Sep 2026 13:57:34 -0400 X-MC-Unique: LOu-IESzNa-TentWVwO3qQ-1 X-Mimecast-MFC-AGG-ID: LOu-IESzNa-TentWVwO3qQ_1788803853 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC8E71954B12; Mon, 7 Sep 2026 17:57:32 +0000 (UTC) Received: from fedora (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 779F3180059E; Mon, 7 Sep 2026 17:57:16 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 7 Sep 2026 19:57:32 +0200 (CEST) Date: Mon, 7 Sep 2026 19:57:15 +0200 From: Oleg Nesterov To: Gregory Price 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-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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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 patch renames the "unlock:" label to "out:", and to me this makes sense. Unfortunately for_each_process_thread() and the new helper can't use "break". Oleg.