Received: by 10.213.65.68 with SMTP id h4csp746668imn; Sun, 25 Mar 2018 12:14:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELsknxMMxyXMW9goOHwM+7o8GneFTpSh6WpizxOaaP/pTb8B83E8MEaeim49/mHcSmVMBO86 X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr29817315plh.84.1522005255053; Sun, 25 Mar 2018 12:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522005255; cv=none; d=google.com; s=arc-20160816; b=WsT1lm3oD3tWyeZQ/NnAdX0dFzJugy2qE7XRJbmmSdcrKr0JSIX3pFJE4ikvJRiVn2 uGz7YLITTYYsr17zrurgrY9Xf62SAzTNcLQcqeA4QYlf4rdAIKtP5kxer/HZhNXZ6VHu rn8gDQbjD5LJca4aN0ufiUtGltrPxtG0/sdQLdeyRf1inny44i/QzXg6IzydfzN+sHQ2 RqN1yTFuJKsotDMlV6LUgSeQvdTMQWXCcgv4eP/9oHQaA0oHhqXCkyNEvP9dD7Sx9MIm rmwpgae0ZDv2N6gzz930/oOunmkZRdOyb2366ZGOvr5SDE1uNhov/ncgHkcHhWo4Si2b xMIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=KGTPkUn6u+dTPjNDbAMRdsDVTSc9AMtHfDQR5y8J1c0=; b=HHDnIg9u/StB/sQ/dQWqghc9yoBks8+RKSwH6HBbZcERHjVCpLPpo2MFptJw1ib7Jq TxI8XWCk0k8wzlpeDQOaBwp35vUUGAiOREKcrAotwagVwIGTvE4Z+HJR/7JFbzxf80or 8n81d/O4eJh0d8ygm7qKx5/WmaP7/NMxvZNWN+jBGDVMHS907A1vIrxa6L1oGUhm2dIv quHDpHYvQ7pvjOKNl/n3ob0iVUgQp0exXmjS6yoLUZjg2aH+BVD2B/7buOYUNblU4cG6 Dz+zUZN1+nsdtCCoro5i91QM2u2evbPBKnt4V8PTb292Y4Bp6GlD0pvtJOsa5UwCU4iN dcBA== 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 t135si4880188pgb.24.2018.03.25.12.13.47; Sun, 25 Mar 2018 12:14:15 -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 S1751732AbeCYTMB (ORCPT + 99 others); Sun, 25 Mar 2018 15:12:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52182 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751049AbeCYTL7 (ORCPT ); Sun, 25 Mar 2018 15:11:59 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2PJ9V80141984 for ; Sun, 25 Mar 2018 15:11:59 -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 2gx40q26wt-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 Cc: Chris Metcalf , Christopher Lameter , Russell King - ARM Linux , Mark Rutland , Steven Rostedt , Mathieu Desnoyers , Catalin Marinas , Will Deacon , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] rcu: declare rcu_eqs_special_set() in public header Reply-To: paulmck@linux.vnet.ibm.com References: <20180325175004.28162-1-ynorov@caviumnetworks.com> <20180325175004.28162-2-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803250233 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);