lkml.org 
[lkml]   [2015]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 4/7] sched/deadline: reschedule if stop task slip in after pull operations
    On Wed, May 13, 2015 at 02:01:04PM +0800, Wanpeng Li wrote:
    > pull_dl_task can drop (and re-acquire) rq->lock, this means a stop task
    > can slip in, in which case we need to reschedule. This patch add the
    > reschedule when the scenario occurs.
    >
    > Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
    > ---
    > kernel/sched/deadline.c | 16 +++++++++++++++-
    > 1 file changed, 15 insertions(+), 1 deletion(-)
    >
    > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
    > index e49b1e6..7d4c4fc 100644
    > --- a/kernel/sched/deadline.c
    > +++ b/kernel/sched/deadline.c
    > @@ -1750,7 +1750,13 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
    > if (!task_on_rq_queued(p) || rq->dl.dl_nr_running)
    > return;
    >
    > - if (pull_dl_task(rq))
    > + /*
    > + * pull_dl_task() can drop (and re-acquire) rq->lock; this
    > + * means a stop task can slip in, in which case we need to
    > + * reschedule.
    > + */
    > + if (pull_dl_task(rq) ||
    > + (rq->stop && task_on_rq_queued(rq->stop)))
    > resched_curr(rq);

    But, the waking of the stop task will already have done the preemption
    check and won (obviously). So the wakeup should already have done the
    resched_curr().

    So why?



    \
     
     \ /
      Last update: 2015-05-29 16:41    [W:4.011 / U:0.280 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site