linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Matthew Wilcox <matthew@wil.cx>,
	Andrew Morton <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org, paulus@samba.org,
	linux-arch@vger.kernel.org, drepper@redhat.com
Subject: Re: Introduce fixed sys_sync_file_range2() syscall, implement on PowerPC and ARM
Date: Mon, 25 Jun 2007 12:37:34 +0100	[thread overview]
Message-ID: <1182771454.12109.71.camel@pmac.infradead.org> (raw)
In-Reply-To: <20070625110907.GA23438@flint.arm.linux.org.uk>

On Mon, 2007-06-25 at 12:09 +0100, Russell King wrote:
> On Mon, Jun 25, 2007 at 04:35:35AM -0600, Matthew Wilcox wrote:
> > On Mon, Jun 25, 2007 at 02:11:45AM -0700, Andrew Morton wrote:
> > > ABI.  How would you like "it would be nice if maintainers of oddball
> > > architectures would pay attention"?
> > 
> > If new syscalls got posted to linux-arch for discussion, I assure you,
> > we'd pay attention.
> 
> Ditto.  sys_sync_file_range() wasn't, so I think David's sentiment is
> bang on.
> 
> And as David says, we've _finally_ been round the discussion loop with
> fallocate, so in theory we now know what the issues are, and we _all_
> have a good idea how to deal with argument ordering to satisfy the
> majority.  That should mean that subsequent discussion be shorter.

Well, those who were paying attention might. We should probably add
Documentation/new-syscalls.txt with such information as...

--- 

Never add any system call without considering how its prototype works
for all architectures and for 32-bit userspace on 64-bit kernels.

- Some architectures have a limit of 6 (32-bit) argument slots.
- Some architectures must align 64-bit integers into an aligned
  pair of registers. A slot may be wasted for padding.
- S390 may not have a 64-bit integer in slots 5/6.

Where you invent a data structure for communication with userspace, be
aware of the following:

- Try to ensure your data structure will be identical for 32-bit and
  64-bit builds, if possible. That way, you avoid the need to implement
  compatibility routines for 32-bit userspace on 64-bit kernels. In
  particular, avoid the 'long' data type. Try to use explicitly sized
  types such as 'uint64_t' instead.
- Most architectures align 64-bit integers to 8 bytes, but i386 doesn't.
  If you have to implement 32-bit compatibility, make sure you get this
  right. Preferably, avoid the problem by ensuring that your 64-bit 
  integers are naturally placed with 8-byte alignment even without
  padding.

---

> At least now, if they don't, provided we build every -rc kernel as it's
> released, we can detect when new syscalls are added quickly and give
> those submitters a suitable roasting at gas mark 95.

Linus should be refusing any new system call which doesn't at _least_
handle the 32/64 compatibility issues. Explictly stating that it doesn't
need compatibility wrappers would be OK, as long as it's true -- but
just saying _nothing_ about it is bad.

-- 
dwmw2


  reply	other threads:[~2007-06-25 11:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  8:49 Introduce fixed sys_sync_file_range2() syscall, implement on PowerPC and ARM David Woodhouse
2007-06-25  9:11 ` Andrew Morton
2007-06-25  9:48   ` David Woodhouse
2007-06-25 10:24     ` Matthew Wilcox
2007-06-25 10:35   ` Matthew Wilcox
2007-06-25 11:09     ` Russell King
2007-06-25 11:37       ` David Woodhouse [this message]
2007-06-25 11:47         ` Matthew Wilcox
2007-06-25 12:01           ` David Woodhouse
2007-06-25 12:04           ` Segher Boessenkool
2007-06-25 12:34             ` David Woodhouse
2007-06-25 13:10               ` Segher Boessenkool
2007-06-25 13:33                 ` David Woodhouse
2007-06-27 13:34           ` Ralf Baechle
2007-06-27 12:23         ` Geert Uytterhoeven
2007-06-25 11:33     ` David Howells
2007-06-25 14:35       ` Kyle McMartin
2007-06-27 13:22 ` Ralf Baechle

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=1182771454.12109.71.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=paulus@samba.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).