From: Vojtech Pavlik <vojtech@suse.cz>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Ingo Molnar <mingo@redhat.com>, Jiri Kosina <jkosina@suse.cz>,
Jiri Slaby <jslaby@suse.cz>, Steven Rostedt <rostedt@goodmis.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] s390 vs. kprobes on ftrace
Date: Wed, 22 Oct 2014 11:37:35 +0200 [thread overview]
Message-ID: <20141022093735.GA31440@suse.cz> (raw)
In-Reply-To: <20141022082625.GB4090@osiris>
On Wed, Oct 22, 2014 at 10:26:25AM +0200, Heiko Carstens wrote:
> > I can confirm that kGraft works well on top of current mainline with
> > this patch added.
> >
> > Another reason for a performance impact when kGraft is enabled is that
> > kGraft still adds two instructions to the syscall path on s390x, as
> > there is no space left for a kgraft TIF in the first eight bits of
> > thread info flags. Renumbering the thread info flags such that _TIF_WORK
> > occupies the first eight bits and TIF_TRACE the next eight would fix
> > that problem: Do you believe it is feasible?
>
> Hi Vojtech,
>
> I think you're talking about the SLES12 kernel?
I'm working with upstream git right now, to make sure kGraft keeps up
with it.
> There you can simply move the TIF_SYSCALL bit to the same byte where
> your TIF_KGR bit resides.
On 3.12 (SLE12) this would allow me to clear the TIF_KGR in a single
instruction when exiting a syscall simply by extending the mask.
I need to clear it before entering a syscall, too, and TIF_SYSCALL is
set there, not cleared.
What could work is moving TIF_SYSCALL and TIF_KGR to the same byte as
TIF_TRACE. Then I could use the TIF_TRACE check to also clear the
TIF_KGR bit in sysc_tracesys without adding an instruction to the hot
path.
> Upstream is a bit different since the TIF_SYSCALL bit is already gone (got
> replaced with an s390 specific "PIF" bit). However the free TIF bit got
> already eaten up by uprobes..
Yes, and all the 8 bits are eaten now in upstream. That's what got me
thinking about separating TIF_WORK and TIF_TRACE to separate bytes, with
no other flags in them. Then the syscall code would then just check the
whole byte for zero instead of doing test-under-mask.
> However we can think of a better solution for upstream if the combined
> solution of kGraft/kpatch is ready to be merged.
We may, indeed, end up doing things very differently there.
At least initially the plan is to go entirely without enforcing any kind
of consistency when patching, so TIF_KGR and the lazy migration will not
exist, and neither will we be stopping the kernel or checking stacks.
This will make applying patches bigger than a single functions tricky,
but it's a good initial goal.
--
Vojtech Pavlik
Director SUSE Labs
prev parent reply other threads:[~2014-10-22 9:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 8:30 [PATCH v3 0/2] s390 vs. kprobes on ftrace Heiko Carstens
2014-10-21 8:30 ` [PATCH v3 1/2] kprobes: introduce weak arch_check_ftrace_location() helper function Heiko Carstens
2014-10-21 9:30 ` Masami Hiramatsu
2014-10-21 12:00 ` Heiko Carstens
2014-10-21 12:11 ` Masami Hiramatsu
2014-10-21 13:16 ` Steven Rostedt
2014-10-21 8:30 ` [PATCH v3 2/2] s390/ftrace,kprobes: allow to patch first instruction Heiko Carstens
2014-10-21 19:58 ` [PATCH v3 0/2] s390 vs. kprobes on ftrace Vojtech Pavlik
2014-10-22 8:26 ` Heiko Carstens
2014-10-22 9:37 ` Vojtech Pavlik [this message]
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=20141022093735.GA31440@suse.cz \
--to=vojtech@suse.cz \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=jkosina@suse.cz \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=schwidefsky@de.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.