lkml.org 
[lkml]   [2014]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/13] sched: Add 3 new scheduler syscalls to support an extended scheduling parameters ABI

* Peter Zijlstra <peterz@infradead.org> wrote:

> > > SYNOPSIS
> > > #include <sched.h>
> > >
> > > struct sched_attr {
> > > u32 size;
> > >
> > > u32 sched_policy;
> > > u64 sched_flags;
> > [...]
> > > };
> > >
> > > int sched_setattr(pid_t pid, const struct sched_attr *attr);
> > >
> > > int sched_getattr(pid_t pid, const struct sched_attr *attr, unsigned int size);
> >
> > So, I that there's a flags field in the structure, which allows for
> > some extensibility for these calls in the future. However, is it
> > worthwhile to consider adding a 'flags' argument in the base signature
> > of either of these calls, to allow for some possible extensions in the
> > future. (See http://lwn.net/SubscriberLink/585415/7b905c0248a158a2/ ).
>
> Sure why not.. I picked 'unsigned long' for the flags argument; I
> don't think there's a real standard for this, I've seen: 'int'
> 'unsigned int' and 'unsigned long' flags.
>
> Please holler if there is indeed a preference and I picked the wrong
> one.

Yo!

So, since this is an ABI, if it's a true 64-bit flags value then
please make it u64 - and 'unsigned int' or u32 otherwise. I don't
think we have many (any?) 'long' argument syscall ABIs.

'unsigned long' is generally a bad choice because it's u32 on 32-bit
platforms and u64 on 64-bit platforms.

Now, for syscall argument ABIs it's not a lethal mistake to make (as
compared to say ABI data structures), because syscall arguments have
their own types and width anyway, so any definition mistake can
usually be fixed after the fact.

Thanks,

Ingo


\
 
 \ /
  Last update: 2014-02-15 14:41    [W:0.131 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site