lkml.org 
[lkml]   [2014]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/3] sched: Add new API wake_up_if_idle() to wake up the idle cpu
Date


> -----Original Message-----
> From: Peter Zijlstra [mailto:peterz@infradead.org]
> Sent: Wednesday, September 03, 2014 5:54 PM
> To: Andy Lutomirski
> Cc: Liu, Chuansheng; linux-pm@vger.kernel.org; Rafael J. Wysocki; Daniel
> Lezcano; Wang, Xiaoming; Ingo Molnar; Chakravarty, Souvik K; Liu, Changcheng;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/3] sched: Add new API wake_up_if_idle() to wake up the
> idle cpu
>
> On Thu, Aug 21, 2014 at 02:21:51PM -0700, Andy Lutomirski wrote:
> > On Aug 18, 2014 3:52 AM, "Chuansheng Liu" <chuansheng.liu@intel.com>
> wrote:
>
> > > +void wake_up_if_idle(int cpu)
> > > +{
> > > + struct rq *rq = cpu_rq(cpu);
> > > + unsigned long flags;
> > > +
> > > + if (set_nr_if_polling(rq->idle)) {
> > > + trace_sched_wake_idle_without_ipi(cpu);
> > > + } else {
> > > +
> >
> > FWIW, adding:
> >
> > if (rq->curr != rq->idle)
> > return;
> >
> > Right here could improve performance on large, mostly non-idle
> > systems. It would skip the spinlock in most cases.
> >
>
> !is_idle_task() :-)
Thanks Peter and Andy, will refine the patches again:)




\
 
 \ /
  Last update: 2014-09-03 12:41    [W:0.066 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site