Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5222387ybv; Mon, 17 Feb 2020 15:11:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyFQFWUJAZr/woxt2SEZdNmicczengNazOorcFakMbRR9MBFoh9DuKhz8HQUeLohwKnM9nt X-Received: by 2002:a9d:3b09:: with SMTP id z9mr13963521otb.195.1581981095971; Mon, 17 Feb 2020 15:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581981095; cv=none; d=google.com; s=arc-20160816; b=EkhZfs21FzTKzv75n6wS724Jk1hXsTFijImMFWrAJLchiCTleolay9uNUGkLFlx7YI hsAQMhavqKnQsAiPbLJOPTOQNJoNUwZ4Wb2jKBM4hp4sXtcQFl5JZDFOc4zzOobO3Ep+ PVCyEsB2gLG6bk7rUHQIuoR+vYfXsbIutMs0+cHOx8rimZO+qZMSAJsT9+FSEP3UCz7I VNXq9ps3qJVTdIGM5hSOELY+h0E5ZFi/OpOWAZP8xhnMUQirWUvb0gxoGq+HLh3vO3l8 eTqYP/XxYVri0a4ps417lgiGDejRGzQb26r9HZwPNsMM5tNtTdgAIpQaa/V/UW8Lne0B VsfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Y+1FZ1b1mJQx/3A9TI1V0s1X3IuSUUpz5LNZP/+Ro5g=; b=HMc9o7HxkxGtReF09SxOBYGD/SuiFGojyyvhyHRdM18MqUIgWPGzg0MwY5F8dLav8+ ECLQPS10rmVNZEnC1uIGX0waNbx7jrcAsd+gsGloD/YW/yt8hsZkiJc7XOFcsHyORG/y qTI+75X5lXfgFOb+AtUJcRt9vr6pQTg56UESKv3FuZM3th91USBRO4PktSu+219KVLed SduGNeWTdyY3d2vor8cVzbdffWDk50dsGU+HPo6wJx83rdGbNr6kaTnjsvcsRG+6bF9w kKVQ2m+/PsIkqyMS4rHaSUHY98YtoDnWDNwAih6OUPTdI6HtrfIw1xgCQgfngncI5Y0z wxqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="n/6vnVzM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si849772otr.131.2020.02.17.15.11.22; Mon, 17 Feb 2020 15:11:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="n/6vnVzM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726182AbgBQXKq (ORCPT + 99 others); Mon, 17 Feb 2020 18:10:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:53082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbgBQXKp (ORCPT ); Mon, 17 Feb 2020 18:10:45 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47D6620725; Mon, 17 Feb 2020 23:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581981045; bh=IlqVkbwn4RNuULuX2RYl0Y7FZw236aKOJdaJutAiaQ0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=n/6vnVzMGQwVLBp4PNaPUzcfn77ztU9CwSpfl5XJL0vJ4cTHwnacI3VbELAnLKp39 37cAD9Jnq2h/Lhu6BqQ1V4R1gbnzKi1612RVqQ7m2BM8vVaU5/qTpKm40hXgikLAec rCOFLdOKMOEtgccwHKpHKxVpNxN6XUKSekTwub1Y= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 0D6E335227A8; Mon, 17 Feb 2020 15:10:45 -0800 (PST) Date: Mon, 17 Feb 2020 15:10:45 -0800 From: "Paul E. McKenney" To: Joel Fernandes Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, Jules Irenge Subject: Re: [PATCH tip/core/rcu 2/3] rcu: Add missing annotation for exit_tasks_rcu_start() Message-ID: <20200217231045.GA2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200215002446.GA15663@paulmck-ThinkPad-P72> <20200215002520.15746-2-paulmck@kernel.org> <20200217144452.GA145700@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200217144452.GA145700@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2020 at 09:44:52AM -0500, Joel Fernandes wrote: > On Fri, Feb 14, 2020 at 04:25:19PM -0800, paulmck@kernel.org wrote: > > From: Jules Irenge > > > > Sparse reports a warning at exit_tasks_rcu_start(void) > > > > |warning: context imbalance in exit_tasks_rcu_start() - wrong count at exit > > > > To fix this, this commit adds an __acquires(&tasks_rcu_exit_srcu). > > Given that exit_tasks_rcu_start() does actually call __srcu_read_lock(), > > this not only fixes the warning but also improves on the readability of > > the code. > > For patch 1/3 and 2/3: > > Reviewed-by: Joel Fernandes (Google) Applied, thank you! > Though IMO it would be good to squash both the patches. Fair point, but I will leave them be. ;-) Thanx, Paul > thanks, > > - Joel > > > > Signed-off-by: Jules Irenge > > Signed-off-by: Paul E. McKenney > > --- > > kernel/rcu/update.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c > > index a27df76..a04fe54 100644 > > --- a/kernel/rcu/update.c > > +++ b/kernel/rcu/update.c > > @@ -801,7 +801,7 @@ static int __init rcu_spawn_tasks_kthread(void) > > core_initcall(rcu_spawn_tasks_kthread); > > > > /* Do the srcu_read_lock() for the above synchronize_srcu(). */ > > -void exit_tasks_rcu_start(void) > > +void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu) > > { > > preempt_disable(); > > current->rcu_tasks_idx = __srcu_read_lock(&tasks_rcu_exit_srcu); > > -- > > 2.9.5 > >