From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Scott Lurndal <scott.lurndal@3leafsystems.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
Matthew Wilcox <matthew@wil.cx>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Ulrich Drepper <drepper@redhat.com>
Subject: Re: [PATCH v2] Add preadv and pwritev system calls.
Date: Fri, 12 Dec 2008 19:07:28 +0000 [thread overview]
Message-ID: <20081212190728.GC5774@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20081212182929.GA9631@pendragon.3leafnetworks.com>
On Fri, Dec 12, 2008 at 10:29:29AM -0800, Scott Lurndal wrote:
> On Fri, Dec 12, 2008 at 05:02:05PM +0100, Gerd Hoffmann wrote:
> > Matthew Wilcox wrote:
> > > On the other hand, NetBSD have approximately 0% market share.
> > > We shouldn't let them lock us into making a bad decision. Is there
> > > anyone other than NetBSD who has added these syscalls?
> >
> > Free- and OpenBSD have it too. For Solaris I've found a feature request
> > only. Dunno about MacOS/Darwin. Other un*xes which are important these
> > days?
> >
> > I'd *really* hate it to have the same system call with different
> > argument ordering on different systems though. Especially when swapping
> > two integer values, so gcc wouldn't error out on wrong usage.
>
> I would suggest that from the end-users perspective, the user-mode API
> should be similar to pread/pwrite, e.g:
>
> int preadv(fd, iovec, iovec_size, offset)
Yes, and that's easy for glibc to achieve.
What's hard is that the user <-> kernel API firstly has a limited number
of registers available to it for passing arguments without indirection
from user space into kernel space.
Secondly, the user <-> kernel argument register allocation can vary
depending on the ABI version which user space or kernel space is built
for. On ARM we have two ABIs, one where 64-bit arguments can be placed
in any two consecutive registers, and one where 64-bit arguments must
be placed in an even,odd register pair (not an odd,even pair.)
That leads to the above being:
fd r0 r0
iovec r1 r1
vecsz r2 r2
offset r3,r4 r4,r5
Notice the different register allocation for the 64-bit offset.
This problem of register-aligned argument placement is not limited
to just ARM, but several other Linux supported architectures.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2008-12-12 19:13 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 14:00 [PATCH v2] Add preadv and pwritev system calls Gerd Hoffmann
2008-12-12 15:29 ` Matthew Wilcox
2008-12-12 15:48 ` Gerd Hoffmann
2008-12-12 15:51 ` Matthew Wilcox
2008-12-12 16:02 ` Gerd Hoffmann
2008-12-12 17:03 ` Matthew Wilcox
2008-12-12 17:03 ` Matthew Wilcox
2008-12-12 18:21 ` Alan Cox
2008-12-12 19:02 ` Russell King
2008-12-12 18:29 ` Scott Lurndal
2008-12-12 19:07 ` Russell King [this message]
2008-12-12 19:56 ` Gerd Hoffmann
2008-12-12 19:56 ` Gerd Hoffmann
2008-12-12 20:12 ` Russell King
2008-12-12 20:12 ` Russell King
2008-12-12 20:39 ` Gerd Hoffmann
2008-12-12 20:39 ` Gerd Hoffmann
2008-12-14 18:19 ` Pavel Machek
2008-12-14 18:19 ` Pavel Machek
2008-12-15 16:37 ` Jennifer Pioch
2008-12-15 20:43 ` Gerd Hoffmann
2008-12-16 9:57 ` Arnd Bergmann
[not found] ` <200812161057.03025.arnd-r2nGTMty4D4@public.gmane.org>
2008-12-17 1:45 ` Dan Mick
2008-12-17 1:45 ` [osol-code] " Dan Mick
2008-12-12 19:47 ` Arnd Bergmann
2008-12-12 20:02 ` Gerd Hoffmann
2008-12-14 11:49 ` Heiko Carstens
2008-12-15 4:14 ` Paul Mackerras
2008-12-15 6:20 ` David Miller
2008-12-12 15:40 ` Ralf Baechle
2008-12-12 16:59 ` Russell King
2008-12-13 1:18 ` Michael Kerrisk
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=20081212190728.GC5774@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=drepper@redhat.com \
--cc=kraxel@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=scott.lurndal@3leafsystems.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox