Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3349789ybt; Mon, 22 Jun 2020 23:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCBePk52kmdK9Bo4ieREXoYTGWyVCTpTDVMTUt3j0r05gu55JilGvL08lEjMLN49xz5+NN X-Received: by 2002:aa7:c358:: with SMTP id j24mr5285444edr.59.1592893445681; Mon, 22 Jun 2020 23:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592893445; cv=none; d=google.com; s=arc-20160816; b=yePf4epDba61hOE04BpE7ZhkxdPYffxGgiZeviI5DbA22emig36iI52W/gnTsPfxTq YTqxGQKFbkZnxdg3VGlx0LZvH0JXPn+YyHEB7Y75VrX6fTJ3pl0v/KI3pRrlRYsl2tkS ORA1j9wLGRJXeEJ8UGU63gco26wFbgtcJOpbt+HCGz2SgHM6QXowQW8qSBoH+bOeEPBc 6lCgIOwx2NJ/0KS3ViQTMWYL4x3PZrpvJHJ4OBbb2KOO6L1zpLL1T2/3rXNR8aLBytXA 91XlHyjwXjYhJNKyIWM1iusEKAEx/YoK6YStrPgm9jjbrjBIHJryIqJ1LW32QSV6nuDf Shpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=5ZAFSKQuOxtflxXUrt8WGXtwebbL5g0a4E24JJ4kqw8=; b=MmJUoF/AQ6xmaADyxH4/BGvl2ciI3Rdq9KqMFEyE0g/b2O0Y702iuBPzgYZcVjsxRA vEcysG7Bl/134QLRLo8JL9ivehi1zBTslrJmABeU/KYlBmOJ55p8vNo5IVNH5HY4edma /jUj/pSifY+31OPLI314BxbRIw3YZcrWEEfY9vYNM5Eo9WT1GdJPwDzfnBksAUbhoEI0 qBEHb6/TruqRC3kS+nJODxsnJcIno4n8rvFkghad0HH//qH/7HIwRzoFQCU9mCiPUZVU BsOGXhQOxlA8l585miSApf+SVs7xNMtoo7kbsRlsWOxnYEFC7hbZAZccsAaSG6I3frB3 uu1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=O1nSICvs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x94si2218593ede.416.2020.06.22.23.23.42; Mon, 22 Jun 2020 23:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=O1nSICvs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730654AbgFWGVz (ORCPT + 99 others); Tue, 23 Jun 2020 02:21:55 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:24907 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730406AbgFWGVy (ORCPT ); Tue, 23 Jun 2020 02:21:54 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1592893314; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=5ZAFSKQuOxtflxXUrt8WGXtwebbL5g0a4E24JJ4kqw8=; b=O1nSICvstKHhWb8qi8tYy4wP7Q5uYlzyWZUslwoisC9XzgzS45VPt2zx29bf3fToyxC4Ti4W D36uStuVYoR03bF2C8o6tJlt4x7qr3L4VIIHka3YaW25t2OJtegxPb/HT6sQFEZP5EP9An/i JcBWdhY8TLqTlJNgoYepAA83eUQ= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n12.prod.us-east-1.postgun.com with SMTP id 5ef19f81bfb34e631ca52f12 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 23 Jun 2020 06:21:53 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C6900C43395; Tue, 23 Jun 2020 06:21:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.0.100] (unknown [124.123.165.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: neeraju) by smtp.codeaurora.org (Postfix) with ESMTPSA id B4CADC433C6; Tue, 23 Jun 2020 06:21:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B4CADC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=neeraju@codeaurora.org Subject: Re: [PATCH] rcu/tree: Remove CONFIG_PREMPT_RCU check in force_qs_rnp To: paulmck@kernel.org Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org References: <1592849223-17774-1-git-send-email-neeraju@codeaurora.org> <20200622231829.GV9247@paulmck-ThinkPad-P72> From: Neeraj Upadhyay Message-ID: Date: Tue, 23 Jun 2020 11:51:47 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200622231829.GV9247@paulmck-ThinkPad-P72> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On 6/23/2020 4:48 AM, Paul E. McKenney wrote: > On Mon, Jun 22, 2020 at 11:37:03PM +0530, Neeraj Upadhyay wrote: >> Remove CONFIG_PREMPT_RCU check in force_qs_rnp(). Originally, >> this check was required to skip executing fqs failsafe >> for rcu-sched, which was added in commit a77da14ce9af ("rcu: >> Yet another fix for preemption and CPU hotplug"). However, >> this failsafe has been removed, since then. So, cleanup the >> code to avoid any confusion around the need for boosting, >> for !CONFIG_PREMPT_RCU. >> >> Signed-off-by: Neeraj Upadhyay > > Good point, there is a !PREEMPT definition of the function > rcu_preempt_blocked_readers_cgp() that unconditionally returns zero. > And if !PREEMPT kernels, the same things happens in the "if" > body as after it, so behavior is not changed. > > I have queued and pushed this with an upgraded commit log as > shown below. > > Thanx, Paul > Thanks! patch looks good to me! Thanks Neeraj >> --- >> kernel/rcu/tree.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c >> index 6226bfb..57c904b 100644 >> --- a/kernel/rcu/tree.c >> +++ b/kernel/rcu/tree.c >> @@ -2514,8 +2514,7 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp)) >> raw_spin_lock_irqsave_rcu_node(rnp, flags); >> rcu_state.cbovldnext |= !!rnp->cbovldmask; >> if (rnp->qsmask == 0) { >> - if (!IS_ENABLED(CONFIG_PREEMPT_RCU) || >> - rcu_preempt_blocked_readers_cgp(rnp)) { >> + if (rcu_preempt_blocked_readers_cgp(rnp)) { >> /* >> * No point in scanning bits because they >> * are all zero. But we might need to >> -- >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >> a Linux Foundation Collaborative Project > > ------------------------------------------------------------------------ > > commit a4600389c35010aef414b89e2817d4a527e751b5 > Author: Neeraj Upadhyay > Date: Mon Jun 22 23:37:03 2020 +0530 > > rcu/tree: Remove CONFIG_PREMPT_RCU check in force_qs_rnp() > > Originally, the call to rcu_preempt_blocked_readers_cgp() from > force_qs_rnp() had to be conditioned on CONFIG_PREEMPT_RCU=y, as in > commit a77da14ce9af ("rcu: Yet another fix for preemption and CPU > hotplug"). However, there is now a CONFIG_PREEMPT_RCU=n definition of > rcu_preempt_blocked_readers_cgp() that unconditionally returns zero, so > invoking it is now safe. In addition, the CONFIG_PREEMPT_RCU=n definition > of rcu_initiate_boost() simply releases the rcu_node structure's ->lock, > which is what happens when the "if" condition evaluates to false. > > This commit therefore drops the IS_ENABLED(CONFIG_PREEMPT_RCU) check, > so that rcu_initiate_boost() is called only in CONFIG_PREEMPT_RCU=y > kernels when there are readers blocking the current grace period. > This does not change the behavior, but reduces code-reader confusion by > eliminating non-CONFIG_PREEMPT_RCU=y calls to rcu_initiate_boost(). > > Signed-off-by: Neeraj Upadhyay > Signed-off-by: Paul E. McKenney > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 6226bfb..57c904b 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2514,8 +2514,7 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp)) > raw_spin_lock_irqsave_rcu_node(rnp, flags); > rcu_state.cbovldnext |= !!rnp->cbovldmask; > if (rnp->qsmask == 0) { > - if (!IS_ENABLED(CONFIG_PREEMPT_RCU) || > - rcu_preempt_blocked_readers_cgp(rnp)) { > + if (rcu_preempt_blocked_readers_cgp(rnp)) { > /* > * No point in scanning bits because they > * are all zero. But we might need to > -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation