From patchwork Sat Apr 14 16:20:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 7816 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 83EAB23E42 for ; Sat, 14 Apr 2012 16:20:56 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4C6AFA185AE for ; Sat, 14 Apr 2012 16:20:56 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so7572362iag.11 for ; Sat, 14 Apr 2012 09:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=B00U1Ot/x0QjhKTEcTs/Rcmcdp/Q8dOd/AeznlbsKCc=; b=EvWQxE4efQNhov/zPxirlpYydeE1VrgNTKhEy8+3ejB6u+bLhtNdA+idcNNJSItBgc +trMNKGuXBuHF1J9nCX+9aYNZoNY7teMAPN7qjVn8T0WJH/SttFqtyG0IrBN5kIxHEyc Lx3iLIin5LR8LuMdzwTtD/TMH8nu/3lZoVpkfJkYO3xMjRS2Rt9Y2UUZcYZz/CQLlooL 8kXPSQjZ1kUL981kvcqaEAak/VhA5dCYY0Imc4lTe+24UfKQQSH2+4C7F1urCT2yVEIH MlNjFCiQL2Gzhj5bMBSUhkxOpTxqMGS0vkMqPR/XZASvP3AnF2D84gNwOkTDT7DxGpAt 8ULg== Received: by 10.50.188.199 with SMTP id gc7mr1520029igc.40.1334420456092; Sat, 14 Apr 2012 09:20:56 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.70.69 with SMTP id c5csp89576ibj; Sat, 14 Apr 2012 09:20:55 -0700 (PDT) Received: by 10.182.124.7 with SMTP id me7mr7754935obb.6.1334420455469; Sat, 14 Apr 2012 09:20:55 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com. [32.97.110.150]) by mx.google.com with ESMTPS id e3si1887114oea.27.2012.04.14.09.20.55 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Apr 2012 09:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.150 as permitted sender) client-ip=32.97.110.150; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.150 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 14 Apr 2012 10:20:55 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 14 Apr 2012 10:20:52 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 11F151FF004F; Sat, 14 Apr 2012 10:20:50 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3EGKmBH182162; Sat, 14 Apr 2012 10:20:48 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3EGKioT025977; Sat, 14 Apr 2012 10:20:48 -0600 Received: from paulmck-ThinkPad-W500 ([9.49.223.21]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3EGKgmG025816; Sat, 14 Apr 2012 10:20:43 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 1ADAEE5271; Sat, 14 Apr 2012 09:20:40 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, patches@linaro.org, torvalds@linux-foundation.org, "Paul E. McKenney" , "Paul E. McKenney" Subject: [PATCH RFC 6/7] rcu: Inline preemptible RCU __rcu_read_lock() Date: Sat, 14 Apr 2012 09:20:36 -0700 Message-Id: <1334420437-19264-6-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1334420437-19264-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120414161953.GA18140@linux.vnet.ibm.com> <1334420437-19264-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12041416-3270-0000-0000-0000058E69A9 X-Gm-Message-State: ALoCoQlUWL4+wv58BRgsnKG/EdQ81Z/3lrxSGdD4rRMb1s6cjWykQ58Eup47AhewJK/gYCjCuCbs From: "Paul E. McKenney" Move __rcu_read_lock() from kernel/rcupdate.c to include/linux/rcupdate.h, allowing the compiler to inline it. Suggested-by: Linus Torvalds Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- include/linux/rcupdate.h | 13 ++++++++++++- kernel/rcupdate.c | 12 ------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 89f7e97..9967b2b 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef CONFIG_RCU_TORTURE_TEST extern int rcutorture_runnable; /* for sysctl */ @@ -150,7 +151,17 @@ DECLARE_PER_CPU(int, rcu_read_unlock_special); DECLARE_PER_CPU(struct task_struct *, rcu_current_task); #endif /* #ifdef CONFIG_PROVE_RCU */ -extern void __rcu_read_lock(void); +/* + * Preemptible-RCU implementation for rcu_read_lock(). Just increment + * the per-CPU rcu_read_lock_nesting: Shared state and per-task state will + * be updated if we block. + */ +static inline void __rcu_read_lock(void) +{ + __this_cpu_inc(rcu_read_lock_nesting); + barrier(); /* Keep code within RCU read-side critical section. */ +} + extern void __rcu_read_unlock(void); void synchronize_rcu(void); diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index f77a5fc..d52c68e 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c @@ -59,18 +59,6 @@ DEFINE_PER_CPU(struct task_struct *, rcu_current_task); #endif /* #ifdef CONFIG_PROVE_RCU */ /* - * Preemptible-RCU implementation for rcu_read_lock(). Just increment - * the per-CPU rcu_read_lock_nesting: Shared state and per-task state will - * be updated if we block. - */ -void __rcu_read_lock(void) -{ - __this_cpu_inc(rcu_read_lock_nesting); - barrier(); /* Keep code within RCU read-side critical section. */ -} -EXPORT_SYMBOL_GPL(__rcu_read_lock); - -/* * Tree-preemptible RCU implementation for rcu_read_unlock(). * Decrement rcu_read_lock_nesting. If the result is zero (outermost * rcu_read_unlock()) and rcu_read_unlock_special is non-zero, then