From: "David S. Miller" <davem@redhat.com>
To: Andrew Morton <akpm@osdl.org>
Cc: arnd@arndb.de, arun.sharma@intel.com, linux-arch@vger.kernel.org
Subject: Re: sys getdents64 needs compat wrapper ?
Date: Sat, 5 Jun 2004 12:31:50 -0700 [thread overview]
Message-ID: <20040605123150.562eda8e.davem@redhat.com> (raw)
In-Reply-To: <20040605114113.13926473.akpm@osdl.org>
On Sat, 5 Jun 2004 11:41:13 -0700
Andrew Morton <akpm@osdl.org> wrote:
> Easier to read, yes. But __put_user() is faster. It's a single
> instruction!
It emits a lot of fixup code though, multiply that by the number of
struct members you're copying over and over the entire kernel it begins
to be a non-trivial amount of .text space.
Actually, even the main part is 2 instructions on Sparc. One to
do the load/store and one to clear the return value to zero for
success.
It would be much better to have a generic way on each platform to
operate on a series of user structure members like this is so
that the code output looks like:
load/store [%ptr + 0], %reg0 ! struct foo->a
load/store [%ptr + 4], %reg1 ! struct foo->b
load/store [%ptr + 8], %reg2 ! struct foo->c
clr %retval
exception_label:
That is the optimal solution for these things. Because right now
we get code like:
load/store [%ptr + 0], %reg0 ! struct foo->a
clr %retval
exception_label1:
cmp %retval, 0
bne fault_path
load/store [%ptr + 4], %reg1 ! struct foo->b
clr %retval
exception_label2:
cmp %retval, 0
bne fault_path
load/store [%ptr + 8], %reg2 ! struct foo->c
clr %retval
exception_label3:
But the optimization is terribly hard to do generic, and the
register availability for such tricks is very platform dependent.
next prev parent reply other threads:[~2004-06-05 19:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-05 14:52 =?iso-8859-1?Q?Re:_Re:_Re:_sys_getdents64_needs_compat_wrapper_??= Arnd Bergmann
2004-06-05 18:41 ` sys getdents64 needs compat wrapper ? Andrew Morton
2004-06-05 19:31 ` David S. Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-05-20 21:06 =?iso-8859-1?Q?Re:_sys_getdents64_needs_compat_wrapper_??= Arnd Bergmann
2004-06-05 0:16 ` =?iso-8859-1?Q?Re:_sys_getdents64_needs_compat_wrapper_??= Arun Sharma
2004-06-05 0:28 ` sys getdents64 needs compat wrapper ? David S. Miller
2004-06-07 21:13 ` Arun Sharma
2004-06-07 21:58 ` David S. Miller
2004-06-11 15:09 ` Arnd Bergmann
2004-06-14 18:15 ` Arun Sharma
2004-06-17 22:28 ` Arun Sharma
2004-06-17 23:36 ` Arnd Bergmann
2004-06-18 0:56 ` Arun Sharma
2004-06-18 17:05 ` Arun Sharma
2004-06-20 21:50 ` Arnd Bergmann
2004-06-22 18:21 ` Arun Sharma
2004-05-20 18:32 sys_getdents64 " Arun Sharma
2004-05-20 20:58 ` David S. Miller
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=20040605123150.562eda8e.davem@redhat.com \
--to=davem@redhat.com \
--cc=akpm@osdl.org \
--cc=arnd@arndb.de \
--cc=arun.sharma@intel.com \
--cc=linux-arch@vger.kernel.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