From patchwork Tue Oct 30 17:19:19 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: 12618 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 46B8723F56 for ; Tue, 30 Oct 2012 17:33:01 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id E6F03A18890 for ; Tue, 30 Oct 2012 17:33:00 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so754766iej.11 for ; Tue, 30 Oct 2012 10:33:00 -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-ibm-iss-spamdetectors :x-ibm-iss-detailinfo:x-gm-message-state; bh=fJgiVZC7SVi41kV+5KiqG8sn7cENoJhSXeuzx2c6c8w=; b=S3YGpaU9t9XpubEZ3WxVG0sxYQ9mvO0wVpSpCiqDvLHuEXP9J/a3mMQw9+WKax63w7 e7qCUEp4k4tZa94PtL9EICeOFk3+wcl2Hkgx61aj32qveZDlNqrvwrkLVoQNJWaECBuo wszYxgyTv/AcGQqRoIZx55PbvNgEzmTCVE1b+8ul7DFI+1pMKMSd/qMQMyrgHfnk4t0u OnEwol5nvmnj2JLBo6oAIXg+qFCkXmYy26S0puiegfNQMpV8LodHd0JHezuZoJsdVgxt gdO+QdkpeCWpqu8SyktXzAYiEolf+VVHQEJAHLQ/eo2lN2H7tbNaga/HhTbZLQdyyAeX 82uQ== Received: by 10.50.10.199 with SMTP id k7mr2172485igb.70.1351618380690; Tue, 30 Oct 2012 10:33:00 -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.50.67.148 with SMTP id n20csp457846igt; Tue, 30 Oct 2012 10:33:00 -0700 (PDT) Received: by 10.50.190.230 with SMTP id gt6mr2190128igc.49.1351618380154; Tue, 30 Oct 2012 10:33:00 -0700 (PDT) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com. [32.97.182.143]) by mx.google.com with ESMTPS id wm10si1325813igb.65.2012.10.30.10.32.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 10:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.143 as permitted sender) client-ip=32.97.182.143; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.143 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Oct 2012 13:32:59 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e3.ny.us.ibm.com (192.168.1.103) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Oct 2012 13:32:57 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 4D12DC9006F for ; Tue, 30 Oct 2012 13:32:56 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9UHWsKt287876 for ; Tue, 30 Oct 2012 13:32:54 -0400 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 q9UHVcWL028022 for ; Tue, 30 Oct 2012 11:31:39 -0600 Received: from paulmck-ThinkPad-W500 (sig-9-49-139-14.mts.ibm.com [9.49.139.14]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9UHVZRC027426; Tue, 30 Oct 2012 11:31:37 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id EB891EBEEA; Tue, 30 Oct 2012 10:19:24 -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, edumazet@google.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, Richard Weinberger , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 1/5] rcu: Remove rcu_switch() Date: Tue, 30 Oct 2012 10:19:19 -0700 Message-Id: <1351617563-28506-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <20121030171906.GA27431@linux.vnet.ibm.com> References: <20121030171906.GA27431@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12103017-8974-0000-0000-000010579B88 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000294; HX=3.00000198; KW=3.00000007; PH=3.00000001; SC=3.00000008; SDB=6.00187004; UDB=6.00042362; UTC=2012-10-30 17:32:58 X-Gm-Message-State: ALoCoQnMyEDywseFFEBT9pD2wx31iMFx5NAj/cT60dazRKQxYFvDJOKjbAZgS18YVt/U3xDAOyV+ From: Frederic Weisbecker It's only there to call rcu_user_hooks_switch(). Let's just call rcu_user_hooks_switch() directly, we don't need this function in the middle. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Peter Zijlstra Cc: Richard Weinberger Signed-off-by: Paul E. McKenney --- arch/um/drivers/mconsole_kern.c | 2 +- include/linux/rcupdate.h | 2 ++ include/linux/sched.h | 8 -------- kernel/sched/core.c | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 79ccfe6..49e3b49 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -648,7 +648,7 @@ static void stack_proc(void *arg) struct task_struct *from = current, *to = arg; to->thread.saved_task = from; - rcu_switch(from, to); + rcu_user_hooks_switch(from, to); switch_to(from, to, from); } diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 7c968e4..5d009de 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -204,6 +204,8 @@ static inline void rcu_user_enter(void) { } static inline void rcu_user_exit(void) { } static inline void rcu_user_enter_after_irq(void) { } static inline void rcu_user_exit_after_irq(void) { } +static inline void rcu_user_hooks_switch(struct task_struct *prev, + struct task_struct *next) { } #endif /* CONFIG_RCU_USER_QS */ extern void exit_rcu(void); diff --git a/include/linux/sched.h b/include/linux/sched.h index 0dd42a0..432cc5e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1844,14 +1844,6 @@ static inline void rcu_copy_process(struct task_struct *p) #endif -static inline void rcu_switch(struct task_struct *prev, - struct task_struct *next) -{ -#ifdef CONFIG_RCU_USER_QS - rcu_user_hooks_switch(prev, next); -#endif -} - static inline void tsk_restore_flags(struct task_struct *task, unsigned long orig_flags, unsigned long flags) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2d8927f..68414fa 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1887,7 +1887,7 @@ context_switch(struct rq *rq, struct task_struct *prev, #endif /* Here we just switch the register state and the stack. */ - rcu_switch(prev, next); + rcu_user_hooks_switch(prev, next); switch_to(prev, next, prev); barrier();