lkml.org 
[lkml]   [2015]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/7] sched: Replace post_schedule with a balance callback list
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

On Wed, Jun 03, 2015 at 04:24:05PM +0800, pang.xunlei@zte.com.cn wrote:
> Hi Peter,
>
> This may increase the overhead of schedule() a bit, as it will have
> more work to do.

How so? It replaces the post_schedule() muck and should not be more
expensive than that.

It will make sched_setscheduler() etc.. a little more expensive, but
that doesn't matter, those are not critical things at all.

> check_class_changed():
> if (prev_class->switched_from)
> prev_class->switched_from(rq, p);
> /* Possble rq->lock 'hole'. */
> p->sched_class->switched_to(rq, p);
>
> For above cases, why can't we just add a judgement in switched_to_fair()
> as follows:
> if (rq != task_rq(p))
> return;

Because its too easy to get wrong. There have been many instances of
bugs caused by this dropping of rq->lock.

And sure you can patch it up, once you find it, but I would really
rather prevent these things if at all possible.


\
 
 \ /
  Last update: 2015-06-03 11:21    [W:0.143 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site