From patchwork Sun Mar 25 19:12:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 10306801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1F1760212 for ; Sun, 25 Mar 2018 22:14:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3FDC29012 for ; Sun, 25 Mar 2018 22:14:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C853D292A5; Sun, 25 Mar 2018 22:14:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B7D7629012 for ; Sun, 25 Mar 2018 22:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:In-Reply-To: MIME-Version:References:Subject:To:From:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ShmyBiDUHlr3/pGALTAo/YQ/ioAQqB9EGaqFEKcyYts=; b=V+gCHg65g4rpr8 RU02/FdwFRHcjQ4u1UKJsWwgaIJZejtr//6rVoCHa9+6Aad2Mo2RVItmUDwRWp1qeMtCQbD3LSdt8 2cnlz8EMvrNOCneQuayOyUA8oLoQvdju9Y3P8X3DzDZB4lUjJ1lV7VXNufH0heUI2/ImQSYvJ+Zzy wBXQRLgZ0IdLcf0odAa+2iJFauY47tKhdburzlcq4n6J/fn2ZSwYtNEQbRgGwh5zCrHmdpzqM6Oli IFUGbqd4ssLdCYFnfb4win7ZmVmulNMH5luhPxVoqVrkXrJj9ZPx7Rjve7jZpbrqtGYPW4cr/5XgY 2Hmxx+kxv/hA8dW6xs3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0DuT-00076W-Mc; Sun, 25 Mar 2018 22:14:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0Dpn-0000f2-Vi for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Mar 2018 22:09:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:In-Reply-To:Content-Type: MIME-Version:References:Reply-To:Subject:Cc:To:From:Date:Sender: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KGTPkUn6u+dTPjNDbAMRdsDVTSc9AMtHfDQR5y8J1c0=; b=SJTclLh5bnPhvuDvnNzLak84X 8TYbUPaKoEksbWeBzox+nxtUG5p9A7M6+sRQu6usK1NWJdwQw1nb7TZZTkXO5LGXm+fq7UXvbL/1U 7Iuw2gh3GSegg0a0p1jBgNAD0/EOlDyZH7g31r+V+qGiJSXUiV0oA26i4o5PzesCu/PEh7mkOKTRC hL2O12Zpa2TyXi9O/VBk7Uzjp6nl61/j2Bd0N0TMrTRYXSXu0IjC7/YKypnSKrE3vhZkF1QQq1H5O 88lzZ+Cjh+gQwLZFRQlwcQrUyYKjH6N0AGYtGFxSbC6bU1KA0N5lyAymh5rZv8ULPbmm0c/0GaCRO FDJBVTIOg==; Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0B4F-0006DU-KF for linux-arm-kernel@lists.infradead.org; Sun, 25 Mar 2018 19:12:37 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2PJ9QcR009593 for ; Sun, 25 Mar 2018 15:11:58 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gx45jab58-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 25 Mar 2018 15:11:58 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 25 Mar 2018 15:11:57 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 25 Mar 2018 15:11:53 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2PJBqjZ42270784; Sun, 25 Mar 2018 19:11:52 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04A73B204E; Sun, 25 Mar 2018 16:14:03 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.80.206.195]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id C8A81B2046; Sun, 25 Mar 2018 16:14:02 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id B89D016C16BA; Sun, 25 Mar 2018 12:12:43 -0700 (PDT) Date: Sun, 25 Mar 2018 12:12:43 -0700 From: "Paul E. McKenney" To: Yury Norov Subject: Re: [PATCH 1/2] rcu: declare rcu_eqs_special_set() in public header References: <20180325175004.28162-1-ynorov@caviumnetworks.com> <20180325175004.28162-2-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180325175004.28162-2-ynorov@caviumnetworks.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18032519-0056-0000-0000-000004328E85 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008742; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01008312; UDB=6.00513550; IPR=6.00787601; MB=3.00020235; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-25 19:11:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032519-0057-0000-0000-000008749967 Message-Id: <20180325191243.GH3675@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-25_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803250233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180325_201235_853573_9AAA9F1F X-CRM114-Status: GOOD ( 39.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@linux.vnet.ibm.com Cc: Mark Rutland , Benjamin Herrenschmidt , Chris Metcalf , kvm-ppc@vger.kernel.org, Catalin Marinas , Will Deacon , Russell King - ARM Linux , Steven Rostedt , linux-kernel@vger.kernel.org, Pekka Enberg , linux-mm@kvack.org, Mathieu Desnoyers , Michael Ellerman , Andrew Morton , David Rientjes , Paul Mackerras , Christopher Lameter , linuxppc-dev@lists.ozlabs.org, Joonsoo Kim , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Mar 25, 2018 at 08:50:03PM +0300, Yury Norov wrote: > rcu_eqs_special_set() is declared only in internal header > kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h. > > This patch declares rcu_eqs_special_set() in include/linux/rcutree.h, so > it can be used in non-rcu kernel code. > > Signed-off-by: Yury Norov > --- > include/linux/rcutree.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h > index fd996cdf1833..448f20f27396 100644 > --- a/include/linux/rcutree.h > +++ b/include/linux/rcutree.h > @@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void) > void rcu_barrier(void); > void rcu_barrier_bh(void); > void rcu_barrier_sched(void); > +bool rcu_eqs_special_set(int cpu); > unsigned long get_state_synchronize_rcu(void); > void cond_synchronize_rcu(unsigned long oldstate); > unsigned long get_state_synchronize_sched(void); Good point, a bit hard to use otherwise. ;-) I removed the declaration from rcutree.h and updated the commit log as follows. Does it look OK? Thanx, Paul ------------------------------------------------------------------------ commit 4497105b718a819072d48a675916d9d200b5327f Author: Yury Norov Date: Sun Mar 25 20:50:03 2018 +0300 rcu: Declare rcu_eqs_special_set() in public header Because rcu_eqs_special_set() is declared only in internal header kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h, it is inaccessible outside of the RCU implementation. This patch therefore moves the rcu_eqs_special_set() declaration to include/linux/rcutree.h, which allows it to be used in non-rcu kernel code. Signed-off-by: Yury Norov Signed-off-by: Paul E. McKenney diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index fd996cdf1833..448f20f27396 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void) void rcu_barrier(void); void rcu_barrier_bh(void); void rcu_barrier_sched(void); +bool rcu_eqs_special_set(int cpu); unsigned long get_state_synchronize_rcu(void); void cond_synchronize_rcu(unsigned long oldstate); unsigned long get_state_synchronize_sched(void); diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 59ad0e23c722..d5f617aaa744 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -415,7 +415,6 @@ extern struct rcu_state rcu_preempt_state; #endif /* #ifdef CONFIG_PREEMPT_RCU */ int rcu_dynticks_snap(struct rcu_dynticks *rdtp); -bool rcu_eqs_special_set(int cpu); #ifdef CONFIG_RCU_BOOST DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);