Received: by 10.192.165.148 with SMTP id m20csp2949742imm; Sun, 22 Apr 2018 20:08:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49JCH1zCratanc21KSjUh9CGIYEuuO6hpeC2HA37HbOpSrxOpYknTG8+HA4FLIyClllK93R X-Received: by 2002:a17:902:d20a:: with SMTP id t10-v6mr19231013ply.151.1524452887535; Sun, 22 Apr 2018 20:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524452887; cv=none; d=google.com; s=arc-20160816; b=QqApJZYalJN6aJp43On8PadY9g3y9RmbfATke2qrYDU0UmXEoqjT/bBk10vaf2+07n vuF63JaEwL9D/qzOj+/0e+qd+p38ahPuVNy03tRPbUeuMJGZDXfw+HfnSmSz95TpbIfh xdDkS5GIXA3X0GSsyFd3GJLco5gPQQk2v7CZNjTSKj4JxDL7JpEnf/NEj7CM1M3uqt80 J1Y3KCedQwze0cRQWnJThBfxui0bgeq/8kZdISdXj8/XoGXNshcwPKpvKW99w4efEwzW Yg6q0mcWKJkQ+JepKN/BsnYwowU4P68SAHU05E8U5lrkfNoX0S1V2vYgbrRr7/Nh6c44 ofQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=biUAnXASxCdfLRR69QxOz3YulG7tbfpuRmg9Uz8f6Ao=; b=SPiiznBvcmlIq3z3/S1Iv2gDh6mYZMK9Ljp1N1PmWNA2LROn/05mdo2qRBvN1kdTsH MILVrDyZcaj8Uho/k02LlXoFQ5hg+Fm9b4XY6R9JuyhEHUK81nHUwfWUGWKU7krECSuh nN2WUWyWYDJkP0+8foiHKDqvjH4dpHRr9txEuis2xjQBbyoi6pSUuPQl5d0F+RbHCSly 5PjzcEwnTAyjE3eKJhpcfeRrjuQ+oFImAeryXuT4Tcn/P2JeA+Qyghc5E6tfCOjd2Xsn fg+ag7/DSTIEpDDxiF3Cx8b/ad4JVWCqJVUZsv7CILc4qXRsO+27vl6qosgvLMDMXXER H+Jg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi10-v6si6926492plb.49.2018.04.22.20.07.53; Sun, 22 Apr 2018 20:08:07 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293AbeDWDGD (ORCPT + 99 others); Sun, 22 Apr 2018 23:06:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39260 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953AbeDWDCj (ORCPT ); Sun, 22 Apr 2018 23:02:39 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3N313Tv127171 for ; Sun, 22 Apr 2018 23:02:39 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hh3w5dhj5-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 22 Apr 2018 23:02:38 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 22 Apr 2018 23:02:37 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 22 Apr 2018 23:02:32 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3N32Wu355247096; Mon, 23 Apr 2018 03:02:32 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE3F9B206A; Mon, 23 Apr 2018 00:04:34 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.149.45]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id A0E7FB2058; Mon, 23 Apr 2018 00:04:34 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 2429416C8F67; Sun, 22 Apr 2018 20:03:45 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: 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, joel.opensrc@gmail.com, torvalds@linux-foundation.org, npiggin@gmail.com, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 08/21] rcu: Convert ->need_future_gp[] array to boolean Date: Sun, 22 Apr 2018 20:03:31 -0700 X-Mailer: git-send-email 2.5.2 In-Reply-To: <20180423030258.GA23370@linux.vnet.ibm.com> References: <20180423030258.GA23370@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18042303-0052-0000-0000-000002E0B3AE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008903; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01021898; UDB=6.00521542; IPR=6.00801134; MB=3.00020719; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-23 03:02:36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042303-0053-0000-0000-00005C6D8F39 Message-Id: <1524452624-27589-8-git-send-email-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804230032 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no longer any need for ->need_future_gp[] to count the number of requests for future grace periods, so this commit converts the additions to assignments to "true" and reduces the size of each element to one byte. While we are in the area, fix an obsolete comment. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 6 +++--- kernel/rcu/tree.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index b05ab6379562..6ef1f2b4a6d3 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1709,7 +1709,7 @@ rcu_start_future_gp(struct rcu_node *rnp, struct rcu_data *rdp, * current grace period, we don't need to explicitly start one. */ if (rnp->gpnum != rnp->completed) { - need_future_gp_element(rnp, c)++; + need_future_gp_element(rnp, c) = true; trace_rcu_future_gp(rnp, rdp, c, TPS("Startedleaf")); goto out; } @@ -1741,7 +1741,7 @@ rcu_start_future_gp(struct rcu_node *rnp, struct rcu_data *rdp, } /* Record the need for the future grace period. */ - need_future_gp_element(rnp_root, c)++; + need_future_gp_element(rnp_root, c) = true; /* If a grace period is not already in progress, start one. */ if (rnp_root->gpnum != rnp_root->completed) { @@ -1769,7 +1769,7 @@ static bool rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp) bool needmore; struct rcu_data *rdp = this_cpu_ptr(rsp->rda); - need_future_gp_element(rnp, c) = 0; + need_future_gp_element(rnp, c) = false; needmore = need_any_future_gp(rnp); trace_rcu_future_gp(rnp, rdp, c, needmore ? TPS("CleanupMore") : TPS("Cleanup")); diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 123c30eac8b5..9f97fd7f648c 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -150,7 +150,7 @@ struct rcu_node { struct swait_queue_head nocb_gp_wq[2]; /* Place for rcu_nocb_kthread() to wait GP. */ #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ - int need_future_gp[4]; /* Counts of upcoming no-CB GP requests. */ + u8 need_future_gp[4]; /* Counts of upcoming GP requests. */ raw_spinlock_t fqslock ____cacheline_internodealigned_in_smp; spinlock_t exp_lock ____cacheline_internodealigned_in_smp; -- 2.5.2