All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC -tip 0/4] x86: improve uaccess in signal
Date: Mon, 22 Dec 2008 21:20:52 -0800	[thread overview]
Message-ID: <49507534.5080401@ct.jp.nec.com> (raw)

This patch series is experimental.

This is another proposal to improve uaccess in signal.
This patch series will improve signal handling performance. The normal path of
signal handling should be same as this;
http://lkml.org/lkml/2008/9/25/332

I think there is a lot of fixup code in signal generated by __{get|put}_user().
In most case kernel only needs to know whether there is error, and error value
is not important. And when an exception has occurred, kernel doesn't need to
continue following __{get|put}_user() in that function.

I think in fixup code to use direct jump to the tail of function and returns
error, will save fixup code size. This fixup code can be used __{get|put}_user()
calls in same function.

The concept code is;
int func()
{
	int err = 0;
.section .fixup
error_out:
	err = -EFAULT;
	goto out;
.previous
	__{get|put}_user(); /* fixup: jump to error_out */
	__{get|put}_user();
	__{get|put}_user();
	:
out:
	return err;
}

and the results are;
$ size *signal*.o.*
   text	   data	    bss	    dec	    hex	filename
   4646	      0	      0	   4646	   1226	ia32_signal.o.new
   6006	      0	      0	   6006	   1776	ia32_signal.o.old
   3557	      0	      0	   3557	    de5	signal.o.new
   4540	      0	      0	   4540	   11bc	signal.o.old
   3840	      0	      0	   3840	    f00	signal32.o.new
   4876	      0	      0	   4876	   130c	signal32.o.old

However, this code is tricky, I can't say compiler guarantees to keep the
order of this framework code and this code relies on the order, fixup section
is before the all __{get|put}_user() codes and the out label is just before
the return.

Comments are welcome.

Thanks,
Hiroshi

             reply	other threads:[~2008-12-23  5:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  5:20 Hiroshi Shimamoto [this message]
2008-12-23  5:22 ` [RFC -tip 1/4] x86: uaccess: rename __put_user_u64() to __put_user_asm_u64() Hiroshi Shimamoto
2008-12-23  5:22 ` [RFC -tip 2/4] x86: uaccess: introduce __{get|put}_user exception handling framework Hiroshi Shimamoto
2008-12-23  5:38   ` Brian Gerst
2008-12-23  5:47     ` Hiroshi Shimamoto
2008-12-23 14:30   ` Ingo Molnar
2008-12-23 19:59     ` Hiroshi Shimamoto
2008-12-23  5:23 ` [RFC -tip 3/4] x86: signal: use " Hiroshi Shimamoto
2008-12-23  5:24 ` [RFC -tip 4/4] x86: ia32_signal: " Hiroshi Shimamoto

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=49507534.5080401@ct.jp.nec.com \
    --to=h-shimamoto@ct.jp.nec.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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.