From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Li Zhong <zhong@linux.vnet.ibm.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
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: Re: [RFC PATCH 4/4] sched: Consolidate open coded preemptible() checks
Date: Wed, 26 Jun 2013 15:05:11 +0200 [thread overview]
Message-ID: <20130626130511.GL28407@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1371761141-25386-5-git-send-email-fweisbec@gmail.com>
On Thu, Jun 20, 2013 at 10:45:41PM +0200, Frederic Weisbecker wrote:
> 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 6667700..08db730 100644
> --- a/kernel/context_tracking.c
> +++ b/kernel/context_tracking.c
> @@ -88,10 +88,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;
>
#ifdef CONFIG_PREEMPT_COUNT
# define preemptible() (preempt_count() == 0 && !irqs_disabled())
#else
# define preemptible() 0
#endif
Wouldn't that give a problem for !PREEMPT_COUNT?
next prev parent reply other threads:[~2013-06-26 15:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 20:45 [RFC PATCH 0/4] sched: Disabled LB_BIAS with full dynticks Frederic Weisbecker
2013-06-20 20:45 ` [RFC PATCH 1/4] sched: Disable lb_bias feature for " Frederic Weisbecker
2013-06-20 21:01 ` Paul E. McKenney
2013-06-20 20:45 ` [RFC PATCH 2/4] sched: Consolidate nohz cpu load prelude code Frederic Weisbecker
2013-06-20 21:01 ` Paul E. McKenney
2013-06-20 20:45 ` [RFC PATCH 3/4] sched: Conditionally build decaying cpu load stats Frederic Weisbecker
2013-06-20 20:45 ` [RFC PATCH 4/4] sched: Consolidate open coded preemptible() checks Frederic Weisbecker
2013-06-26 13:05 ` Peter Zijlstra [this message]
2013-07-01 11:20 ` Frederic Weisbecker
2013-07-01 11:55 ` Peter Zijlstra
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=20130626130511.GL28407@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alex.shi@intel.com \
--cc=bp@alien8.de \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--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