Re: [tip:x86/asm] x86: Speed up ___preempt_schedule*() by using THUNK helpers

From: Oleg Nesterov
Date: Fri Oct 03 2014 - 17:19:41 EST


Hi Sasha,

On 10/03, Sasha Levin wrote:
>
> On 09/24/2014 11:02 AM, tip-bot for Oleg Nesterov wrote:
> > Commit-ID: 0ad6e3c5199be12c9745da8f8b9e3c9f8066c235
> > Gitweb: http://git.kernel.org/tip/0ad6e3c5199be12c9745da8f8b9e3c9f8066c235
> > Author: Oleg Nesterov <oleg@xxxxxxxxxx>
> > AuthorDate: Sun, 21 Sep 2014 20:41:53 +0200
> > Committer: Ingo Molnar <mingo@xxxxxxxxxx>
> > CommitDate: Wed, 24 Sep 2014 15:15:38 +0200
> >
> > x86: Speed up ___preempt_schedule*() by using THUNK helpers
> >
> > ___preempt_schedule() does SAVE_ALL/RESTORE_ALL but this is
> > suboptimal, we do not need to save/restore the callee-saved
> > register. And we already have arch/x86/lib/thunk_*.S which
> > implements the similar asm wrappers, so it makes sense to
> > redefine ___preempt_schedule() as "THUNK ..." and remove
> > preempt.S altogether.
> >
> > Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> > Reviewed-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> > Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> > Link: http://lkml.kernel.org/r/20140921184153.GA23727@xxxxxxxxxx
> > Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
> > ---
>
> Hi Oleg,
>
> I *think* that this patch is causing the following trace (arch/x86/lib/thunk_64.S:44
> is new code introduced by this patch):

Not sure, but I'm afraid your guess can be correct...

> [ 921.908530] kernel BUG at kernel/sched/core.c:2702!

OK, this is schedule_debug() -> BUG_ON(unlikely(task_stack_end_corrupted(prev)))
in linux-next.

But at first glance this doesn't match the disassembled code... Could you
send me (privately) your kernel/sched/core.c just in case? And .config
please. And, if possible, kernel/sched/core.s

Oleg.

--
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/