public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: torvalds@transmeta.com,
	kernel list <linux-kernel@vger.kernel.org>,
	Rusty trivial patch monkey Russell  <trivial@rustcorp.com.au>
Subject: Re: Provide example copy_in_user implementation
Date: Tue, 24 Jun 2003 12:25:51 +0200	[thread overview]
Message-ID: <20030624102551.GE159@elf.ucw.cz> (raw)
In-Reply-To: <20030624111820.D6478@flint.arm.linux.org.uk>

On Út 24-06-03 11:18:20, Russell King wrote:
> On Tue, Jun 24, 2003 at 12:06:10PM +0200, Pavel Machek wrote:
> > This patch adds example copy_in_user implementation (copy_in_user is
> > needed for new ioctl32 implementation, all 64bit archs will need
> > it)... Please apply,
> 
> get_user / put_user on byte quantities may be faster than using
> copy_from_user/copy_to_user on byte quantities.  Yes, it may be
> a generic implementation, but there's no point in purposely making
> it inefficient.

Actually, it seems that most architectures do...

static inline unsigned long
__copy_from_user(void *to, const void __user *from, unsigned long n)
{
        if (__builtin_constant_p(n)) {
                unsigned long ret;

                switch (n) {
                case 1:


...so it should be exactly as fast. Ahha, not arm.

If I wanted to optimize it, first step would be to copy over something
else than bytes. I'm afraid I do not want to optimize it.
								Pavel

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  reply	other threads:[~2003-06-24 10:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-24 10:06 Provide example copy_in_user implementation Pavel Machek
2003-06-24 10:18 ` Russell King
2003-06-24 10:25   ` Pavel Machek [this message]
2003-06-24 11:01     ` Russell King
2003-06-24 18:52     ` Linus Torvalds
2003-06-24 10:29 ` Andrew Morton
2003-06-24 10:33   ` Pavel Machek
2003-06-24 18:51 ` Linus Torvalds

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=20030624102551.GE159@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=trivial@rustcorp.com.au \
    /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