From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit
Date: Mon, 21 Jan 2013 06:02:29 +0000 [thread overview]
Message-ID: <20130121060229.GT4939@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFwPM3qWE7F7nwUVKphVTJb7WE7zPF5artdVw7Xq5Z1UgQ@mail.gmail.com>
On Sun, Jan 20, 2013 at 06:39:09PM -0800, Linus Torvalds wrote:
> And right now, that HAVE_SYSCALL_WRAPPERS does make it much harder to
> think about the header file changes.
Agreed.
> > FWIW, there's another bit of ugliness around that area - all these
> > #define __SC_BLAH3, etc., all of the same form. This stuff begs for
> > something like
> > #define __MAP1(m,t,a) m(t,a)
> > #define __MAP2(m,t,a,...) m(t,a) __MAP1(m,__VA_ARGS__)
> > #define __MAP3(m,t,a,...) m(t,a) __MAP2(m,__VA_ARGS__)
> > #define __MAP4(m,t,a,...) m(t,a) __MAP3(m,__VA_ARGS__)
> > #define __MAP5(m,t,a,...) m(t,a) __MAP4(m,__VA_ARGS__)
> > #define __MAP6(m,t,a,...) m(t,a) __MAP5(m,__VA_ARGS__)
> > #define __MAP(n,...) __MAP##n(__VA_ARGS__)
> > with __MAP(x,__SC_DECL,__VA_ARGS__) instead of __SC_DECL##x(__VA_ARGS__)
> > etc. in users...
... with missing commas added, of course.
> Well, I can see both sides. The above is the nice and dense
> declaration model with less duplication, but christ, it's hard for
> people to wrap their minds around unless they've seen it a million
> times. It really does take some getting used to, and the long-form can
> be easier to understand.
Umm... Even with
/*
* __MAP - apply a given macro to all syscall arguments.
* __MAP(n, m, t1, a1, ..., tn, an) will expand to
* m(t1,a1), m(t2,a2), ..., m(tn, an)
* Note that the first argument of __MAP must be equal to the number of
* type, name pairs in the list. The list itself (all arguments of __MAP
* starting with the 3rd one) is in the form we pass to SYSCALL_DEFINE<n>.
*/
slapped on top of it?
> That said, we have so many of those things now when it comes to the
> syscall stuff that the dense form seems to be called for just to be
> consistent.
>
> So go wild if you have the energy for it. I'm not going to pull that
> for 3.8, though.
No, that's obviously next cycle fodder, along with the sick tricks for
generating compat wrappers on s390 if Martin can live with those.
BTW, grep for asmlinkage; it's amazing how much cargo-culting is going
on with it ;-/ Some of the instances are syscalls yet to be converted
to SYSCALL_DEFINE<n>; even more of COMPAT_SYSCALL_DEFINE<n>-to-be. We
also have a bunch of declarations in syscalls.h and compat.h - those
are fine. _Some_ of the rest might be legitimate - ia64 and i386 have
non-trivial asmlinkage expansion and some (but not all) of arch/{x86,ia64}
instances do make sense. Not all of those - e.g. things like
FPU_divide_by_zero() have no business being regparm(0); they are only called
from C code and forcing their arguments on stack is a pure pessimization for
no reason whatsoever. Everything else in arch/* is magic green marker,
AFAICS...
There are some borderline cases - e.g. I'm not sure if having sys_recv
done *not* via SYSCALL_DEFINE() is deliberate; it might cut down on
some overhead (the sucker's calling sys_recvfrom(), which does normalizations,
which make normalizing in sys_recv() pointless). OTOH, sys_send *is*
done as SYSCALL_DEFINE, even though it ends up calling sys_sendto()...
next prev parent reply other threads:[~2013-01-21 6:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 9:42 Issues with "x86, um: switch to generic fork/vfork/clone" commit Nicolas Dichtel
2013-01-19 6:38 ` Al Viro
2013-01-20 3:12 ` Al Viro
2013-01-20 20:53 ` Linus Torvalds
2013-01-20 21:28 ` Al Viro
2013-01-21 1:22 ` Al Viro
2013-01-21 1:40 ` Linus Torvalds
2013-01-21 2:30 ` Al Viro
2013-01-21 2:39 ` Linus Torvalds
2013-01-21 6:02 ` Al Viro [this message]
2013-01-21 22:55 ` [RFC] making HAVE_SYSCALL_WRAPPERS universal (Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit) Al Viro
2013-01-22 12:47 ` James Hogan
2013-01-22 14:23 ` Al Viro
2013-01-22 13:16 ` Arnd Bergmann
2013-01-22 15:33 ` Arnd Bergmann
2013-01-21 9:00 ` Issues with "x86, um: switch to generic fork/vfork/clone" commit Nicolas Dichtel
-- strict thread matches above, loose matches on Subject: below --
2012-11-10 4:36 Michel Lespinasse
2012-11-10 4:51 ` Al Viro
2012-11-10 4:57 ` Michel Lespinasse
2012-11-10 5:33 ` Al Viro
2012-11-10 5:47 ` Michel Lespinasse
2012-11-10 7:33 ` Al Viro
2012-11-10 8:08 ` Michel Lespinasse
2012-11-10 18:59 ` Al Viro
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=20130121060229.GT4939@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--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