Re: [process scheduler] Possible bug in context_swich()?

From: Will Newton
Date: Wed Sep 08 2010 - 11:48:25 EST


On Wed, Sep 8, 2010 at 4:28 PM, fabio de francesco <fabio@xxxxxxxxxxx> wrote:
> Dear List,
>
> My previous mails to you have gone unheard... my last chance...
>
> In context_switch() (in linux/kernel/sched.c), starting with release 2.6.33,
> two "unlikely" macro  have been changed to "likely". I think the previous
> logic was right while the latter is wrong.
>
> In case I am missing something I, please, ask someone to explain the above
> mentioned inversion of logic through releases.

Hi fabio,

The logic was changed in commit
710390d90f143a9ebb87a475215140f426792efd on the basis of a branch hint
profiling run. It would guess previous logic was more likely to be
correct, unless one is often scheduling between kernel threads, but
maybe that happens more often than I expect.

I would suggest trying the branch tracer yourself if you think the
current code is wrong for your workload, the config option is
PROFILE_ANNOTATED_BRANCHES. I would suggest not profiling the boot
process (which will have predominantly kernel threads) and not
profiling on an idle system (which may also be relatively heavy on
kernel threads).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/