From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Li Zhong <zhong@linux.vnet.ibm.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, Alex Shi <alex.shi@intel.com>,
Paul Turner <pjt@google.com>, Mike Galbraith <efault@gmx.de>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH 01/23] sched: Consolidate open coded preemptible() checks
Date: Thu, 1 Aug 2013 02:31:18 +0200 [thread overview]
Message-ID: <1375317100-20651-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1375317100-20651-1-git-send-email-fweisbec@gmail.com>
preempt_schedule() and preempt_schedule_context() open
code their preemptability checks.
Use the standard API instead for consolidation.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Alex Shi <alex.shi@intel.com>
Cc: Paul Turner <pjt@google.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
---
kernel/context_tracking.c | 3 +--
kernel/sched/core.c | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
index 383f823..942835c 100644
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -87,10 +87,9 @@ void user_enter(void)
*/
void __sched notrace preempt_schedule_context(void)
{
- struct thread_info *ti = current_thread_info();
enum ctx_state prev_ctx;
- if (likely(ti->preempt_count || irqs_disabled()))
+ if (likely(!preemptible()))
return;
/*
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b7c32cb..3fb7ace 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2510,13 +2510,11 @@ void __sched schedule_preempt_disabled(void)
*/
asmlinkage void __sched notrace preempt_schedule(void)
{
- struct thread_info *ti = current_thread_info();
-
/*
* If there is a non-zero preempt_count or interrupts are disabled,
* we do not want to preempt the current task. Just return..
*/
- if (likely(ti->preempt_count || irqs_disabled()))
+ if (likely(!preemptible()))
return;
do {
--
1.7.5.4
next prev parent reply other threads:[~2013-08-01 0:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 0:31 [GIT PULL] nohz patches for 3.12 preview v3 Frederic Weisbecker
2013-08-01 0:31 ` Frederic Weisbecker [this message]
2013-08-01 0:31 ` [PATCH 02/23] context_tracing: Fix guest accounting with native vtime Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 03/23] vtime: Update a few comments Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 04/23] context_tracking: Fix runtime CPU off-case Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 05/23] nohz: Only enable context tracking on full dynticks CPUs Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 06/23] context_tracking: Remove full dynticks' hacky dependency on wide context tracking Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 07/23] context_tracking: Ground setup for static key use Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 08/23] context_tracking: Optimize main APIs off case with static key Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 09/23] context_tracking: Optimize guest " Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 10/23] context_tracking: Optimize context switch off case with static keys Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 11/23] context_tracking: User/kernel broundary cross trace events Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 12/23] vtime: Remove a few unneeded generic vtime state checks Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 13/23] vtime: Fix racy cputime delta update Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 14/23] context_tracking: Split low level state headers Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 15/23] hardirq: Split preempt count mask definitions Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 16/23] m68k: hardirq_count() only need preempt_mask.h Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 17/23] vtime: Describe overriden functions in dedicated arch headers Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 18/23] vtime: Optimize full dynticks accounting off case with static keys Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 19/23] vtime: Always scale generic vtime accounting results Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 20/23] vtime: Always debug check snapshot source _before_ updating it Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 21/23] nohz: Rename a few state variables Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 22/23] nohz: Optimize full dynticks state checks with static keys Frederic Weisbecker
2013-08-01 0:31 ` [PATCH 23/23] nohz: Optimize full dynticks's sched hooks " Frederic Weisbecker
2013-08-01 8:29 ` [GIT PULL] nohz patches for 3.12 preview v3 Peter Zijlstra
2013-08-03 15:46 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375317100-20651-2-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=alex.shi@intel.com \
--cc=bp@alien8.de \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=zhong@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome