Re: [patch 06/11] syslets: core, documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 14, 2007 at 11:50:39AM +0100, Ingo Molnar wrote:
> * Russell King <[email protected]> wrote:
> > On Tue, Feb 13, 2007 at 03:20:42PM +0100, Ingo Molnar wrote:
> > > +Arguments to the system call are implemented via pointers to arguments.
> > > +This not only increases the flexibility of syslet atoms (multiple syslets
> > > +can share the same variable for example), but is also an optimization:
> > > +copy_uatom() will only fetch syscall parameters up until the point it
> > > +meets the first NULL pointer. 50% of all syscalls have 2 or less
> > > +parameters (and 90% of all syscalls have 4 or less parameters).
> > > +
> > > + [ Note: since the argument array is at the end of the atom, and the
> > > +   kernel will not touch any argument beyond the final NULL one, atoms
> > > +   might be packed more tightly. (the only special case exception to
> > > +   this rule would be SKIP_TO_NEXT_ON_STOP atoms, where the kernel will
> > > +   jump a full syslet_uatom number of bytes.) ]
> > 
> > What if you need to increase the number of arguments passed to a 
> > system call later?  That would be an API change since the size of 
> > syslet_uatom would change?
> 
> the syslet_uatom has a constant size right now, and space for a maximum 
> of 6 arguments. /If/ the user knows that a specific atom (which for 
> example does a sys_close()) takes only 1 argument, it could shrink the 
> size of the atom down by 4 arguments.
> 
> [ i'd not actually recommend doing this, because it's generally a 
>   volatile thing to play such tricks - i guess i shouldnt have written 
>   that side-note in the header file :-) ]
> 
> there should be no new ABI issues: the existing syscall ABI never 
> changes, it's only extended. New syslets can rely on new properties of 
> new system calls. This is quite parallel to how glibc handles system 
> calls.

Let me spell it out, since you appear to have completely missed my point.

At the moment, SKIP_TO_NEXT_ON_STOP is specified to jump a "jump a full
syslet_uatom number of bytes".

If we end up with a system call being added which requires more than
the currently allowed number of arguments (and it _has_ happened before)
then either those syscalls are not accessible to syslets, or you need
to increase the arg_ptr array.

That makes syslet_uatom larger.

If syslet_uatom is larger, SKIP_TO_NEXT_ON_STOP increments the syslet_uatom
pointer by a greater number of bytes.

If we're running a set of userspace syslets built for an older kernel on
such a newer kernel, that is an incompatible change which will break.

> > How do you propose syslet users know about these kinds of ABI issues 
> > (including the endian-ness of 64-bit arguments) ?
> 
> syslet users would preferably be libraries like glibc - not applications 
> - i'm not sure the raw syslet interface should be exposed to 
> applications. Thus my current thinking is that syslets ought to be 
> per-arch structures - no need to pad them out to 64 bits on 32-bit 
> architectures - it's per-arch userspace that makes use of them anyway. 
> system call encodings are fundamentally per-arch anyway - every arch 
> does various fixups and has its own order of system calls.
> 
> but ... i'd not be against having a 'generic syscall layer' though, and 
> syslets might be a good starting point for that. But that would 
> necessiate a per-arch table of translating syscall numbers into this 
> 'generic' numbering, at minimum - or a separate sys_async_call_table[].

Okay - I guess the userspace library approach is fine, but it needs
to be documented that applications which build syslets directly are
going to be non-portable.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux