lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 2/3] sched/rt: Fix wrong SMP scheduler behavior for equal prio cases
On Mon, Apr 20, 2015 at 01:48:03PM -0400, Steven Rostedt wrote:
> On Mon, 20 Apr 2015 19:20:48 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > > > + */
> > > > + if (preempt_count() & PREEMPT_ACTIVE)
> > > > + enqueue_pushable_task_preempted(rq, p);
> > > > + else
> > > > + enqueue_pushable_task(rq, p);
> > > > + }
> > > > }
> >
> > This looks wrong, what do you want to find? _any_ preemption? In that
> > case PREEMPT_ACTIVE is wrong. What you need to check is if the task is
> > still on the RQ or not.
> >
> > If the task was put to sleep it got dequeued, if it was not dequeued, it
> > got preempted.
> >
> > PREEMPT_ACTIVE is only ever set for forced kernel preemption, which is a
> > special sub case only ever triggered with CONFIG_PREEMPT=y.
>
> Ah, you're right. I was thinking of just forced preemption, but, I
> wasn't thinking about voluntary preemption (preemption points). We want
> this behavior for that too (for kernel).
>
> And yes, if we preempt in user space, this isn't enough either.
>
> Actually, I think we only care if the state of the task is
> TASK_RUNNING, if it is anything else, the task is probably going to
> sleep anyway and we don't care about FIFO order then.

Please don't try and be clever there :-) Task state can be misleading,
you might get a wakeup before you're running again, in which case you
never went to sleep.

Please use task_on_rq_queued(p) like all other sites.


\
 
 \ /
  Last update: 2015-04-21 02:01    [W:0.074 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site