linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Chuck Ebbert <cebbert.lkml@gmail.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [tip:x86/asm] x86: Speed up ___preempt_schedule*() by using THUNK helpers
Date: Fri, 3 Oct 2014 14:56:56 -0700	[thread overview]
Message-ID: <CALCETrVVeuVc7JC7w3Z_2pCx0y_HAFtm4=FmEp_xNkn3tvnR+A@mail.gmail.com> (raw)
In-Reply-To: <20141003214124.GA31614@redhat.com>

On Fri, Oct 3, 2014 at 2:41 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> On 10/03, Chuck Ebbert wrote:
>>
>> > [  921.917752] ? ___preempt_schedule_context (arch/x86/lib/thunk_64.S:44)
>> > [  921.917752] ? preempt_schedule_context (kernel/context_tracking.c:145)
>> > [  921.917752] ? ___preempt_schedule_context (arch/x86/lib/thunk_64.S:44)
>> > [  921.917752] ? preempt_schedule_context (kernel/context_tracking.c:145)
>> > [  921.917752] ? ___preempt_schedule_context (arch/x86/lib/thunk_64.S:44)
>> > [  921.917752] ? preempt_schedule_context (kernel/context_tracking.c:145)
>> > [  921.917752] ? ___preempt_schedule_context (arch/x86/lib/thunk_64.S:44)
>> > [  921.917752] ? preempt_schedule_context (kernel/context_tracking.c:145)
>> > [  921.917752] ? ___preempt_schedule_context (arch/x86/lib/thunk_64.S:44)
>> > [  921.917752] ? preempt_schedule_context (kernel/context_tracking.c:145)
>>
>> <snip lots of repeats of this>
>>
>> I *think* this is because RBP isn't being saved across task switch
>> anymore?
>>
>> Without CONFIG_FRAME_POINTERS that night not be a problem...
>
> Could you please spell?
>
> I don't even understand "RBP isn't being saved", SAVE_CONTEXT/RESTORE_CONTEXT
> do push/pop %rbp?
>

Is this thing missing a flags or cc clobber:

# define __preempt_schedule() asm ("call ___preempt_schedule")

Also, I'm at a loss as to wtf all this code is doing.

There's preempt_schedule, which appears to be a normal C function.

There's ___preempt_schedule, which is written in assembly and calls
preempt_schedule.

Then there's __preempt_schedule, which is an inline assembler function
that calls ___preempt_schedule.

Is this all just to make the call sequence for preempt_schedule shorter?

--Andy


> Thanks,
>
> Oleg.
>



-- 
Andy Lutomirski
AMA Capital Management, LLC

  reply	other threads:[~2014-10-03 21:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21 18:41 [PATCH v3 0/2] x86: reimplement ___preempt_schedule*() using THUNK helpers Oleg Nesterov
2014-09-21 18:41 ` [PATCH v3 1/2] " Oleg Nesterov
2014-09-24 15:02   ` [tip:x86/asm] x86: Speed up ___preempt_schedule*() by " tip-bot for Oleg Nesterov
2014-10-03  4:50     ` Sasha Levin
2014-10-03 13:39       ` Chuck Ebbert
2014-10-03 21:41         ` Oleg Nesterov
2014-10-03 21:56           ` Andy Lutomirski [this message]
2014-10-03 23:48             ` Linus Torvalds
2014-10-03 23:51             ` Oleg Nesterov
2014-10-03 22:48           ` Chuck Ebbert
2014-10-03 22:53             ` Andy Lutomirski
2014-10-03 23:13               ` H. Peter Anvin
2014-10-03 23:37             ` Oleg Nesterov
2014-10-03 21:16       ` Oleg Nesterov
2014-10-03 23:26       ` Oleg Nesterov
2014-10-04  0:01         ` Linus Torvalds
2014-10-04  0:11           ` Linus Torvalds
2014-10-04  0:33             ` Oleg Nesterov
2014-10-05 20:23               ` [PATCH 0/1] stop the unbound recursion in preempt_schedule_context() Oleg Nesterov
2014-10-05 20:23                 ` [PATCH 1/1] " Oleg Nesterov
2014-10-28 11:03                   ` [tip:sched/core] sched: " tip-bot for Oleg Nesterov
2014-10-05 23:53                 ` [PATCH 0/1] " Oleg Nesterov
2014-10-04  0:19           ` [tip:x86/asm] x86: Speed up ___preempt_schedule*() by using THUNK helpers Oleg Nesterov
2014-09-21 18:42 ` [PATCH v3 2/2] x86, lib/Makefile: remove the unnecessary "+= thunk_64.o" Oleg Nesterov
2014-09-24 15:02   ` [tip:x86/asm] x86/lib/Makefile: Remove " tip-bot for Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALCETrVVeuVc7JC7w3Z_2pCx0y_HAFtm4=FmEp_xNkn3tvnR+A@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=cebbert.lkml@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sasha.levin@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).