All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Blaisorblade <blaisorblade@yahoo.it>
Cc: Bodo Stroesser <bstroesser@fujitsu-siemens.com>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Removing call to function pointer in inner loop of copy_from_user()
Date: Mon, 16 May 2005 11:00:55 -0400	[thread overview]
Message-ID: <20050516150055.GA4977@ccure.user-mode-linux.org> (raw)
In-Reply-To: <200505152044.44400.blaisorblade@yahoo.it>

On Sun, May 15, 2005 at 08:44:44PM +0200, Blaisorblade wrote:
> copy_from_user() loops, in SKAS mode, calls do_op inside the inner loop; do_op 
> acts on 4k at once, so with modern pipelines, the potential cost of the 
> function call can be very big.
> 
> Beyond that, we also call setjmp_wrapper, which simply puts a sigjmp_buf on 
> the stack.
> 
> Wouldn't the code be cleaner if we rip that out, together with the va_arg() 
> calls, and do everything inside do_buffer_op? Doh, those are from userspace 
> headers. However it looks they would be includable from kernel code (no 
> reference to kernel headers), by adding them at the end of the include search 
> path.

> What's your opinion? I'm ready to work on this.

I was unhappy about adding the setjmp there, but it turns out that the 
kernel data might not be present and so can segfault.  So, when that happens,
we need to get out of there and return an error, and the way that's done is
by the page fault handler longjmping back out.

If you can think of a better way to do it, go ahead.

				Jeff


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2005-05-16 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-15 18:44 [uml-devel] Removing call to function pointer in inner loop of copy_from_user() Blaisorblade
2005-05-16 15:00 ` Jeff Dike [this message]
2005-05-16 17:04   ` Blaisorblade
2005-05-16 18:48     ` Jeff Dike
2005-05-16 21:27       ` Blaisorblade

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=20050516150055.GA4977@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=blaisorblade@yahoo.it \
    --cc=bstroesser@fujitsu-siemens.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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.