From: Ingo Molnar <mingo@kernel.org>
To: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
Andi Kleen <ak@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andy Lutomirski <luto@kernel.org>,
Brian Gerst <brgerst@gmail.com>,
Denys Vlasenko <dvlasenk@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, Maninder Singh <maninder1.s@samsung.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH 0/3] syscalls: clean up stub naming convention
Date: Mon, 9 Apr 2018 09:06:11 +0200 [thread overview]
Message-ID: <20180409070611.43iq66eay2ctwv2m@gmail.com> (raw)
In-Reply-To: <20180409064511.ejhfqcurtlq2srq5@gmail.com>
* Ingo Molnar <mingo@kernel.org> wrote:
>
> * Dominik Brodowski <linux@dominikbrodowski.net> wrote:
>
> > On Sun, Apr 08, 2018 at 10:35:50AM +0200, Ingo Molnar wrote:
> > > - _____sys_waitid() # ridiculous number of underscores?
> > > - __sys_waitid() # too generic sounding?
> >
> > ... and we'd need to rename internal helpers in net/
> >
> > > - __inline_sys_waitid() # too long?
> >
> > sounds acceptable, though a bit long (especially for the compat case, though
> > it doesn't really matter in the case of
> > __inline_compat_sys_sched_rr_get_interval)
>
> So as per the previous mail this is not just an inline function, but an active
> type conversion wrapper that sign-extends 32-bit ints to longs, which is important
> on some 64-bit architectures.
>
> And that's a really non-obvious property IMO, and the name should probably reflect
> _that_ non-obvious property, not the inlining property which is really just a
> small detail.
>
> I.e. how about:
>
> __se_sys_waitid()
>
> ... where 'se' stands for sign-extended, with a comment in the macro that explains
> the prefix? (The historical abbreviation for sign extension is 'sext', which I
> think wouldn't really be suitable these days.)
Ok, so I got confused there: I think it's the do_sys_waitid() intermediate that
is actually doing the sign-extension - and the inlined helper is what is in the
syscall definition body.
So it's all still somewhat of a confusing misnomer: the 'do' named function is
actually the sign-extension function variant - and the '_il' variant actually
'does' the real work ...
I.e., old naming:
810f08d0 t kernel_waitid # common C function (see kernel/exit.c)
<inline> __il_sys_waitid # inlined helper doing the actual work
# (takes parameters as declared)
810f1aa0 T __do_sys_waitid # C function calling inlined helper
# (takes parameters of type long; casts
# them to the declared type)
810f1aa0 T sys_waitid # alias to __do_sys_waitid() (taking
# parameters as declared), to be included
# in syscall table
New suggested naming:
810f08d0 t kernel_waitid # common C function (see kernel/exit.c)
<inline> __do_sys_waitid # inlined helper doing the actual work
# (takes original parameters as declared)
810f1aa0 T __se_sys_waitid # sign-extending C function calling inlined
# helper (takes parameters of type long;
# casts them to the declared type)
810f1aa0 T sys_waitid # alias to __se_sys_waitid() (but taking
# original parameters as declared), to be
# included in syscall table
Agreed?
Thanks,
Ingo
next prev parent reply other threads:[~2018-04-09 7:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 7:46 [PATCH 0/3] syscalls: clean up stub naming convention Dominik Brodowski
2018-04-07 7:46 ` [PATCH 1/3] syscalls: clean up syscall " Dominik Brodowski
2018-04-07 7:46 ` [PATCH 2/3] syscalls: clean up compat " Dominik Brodowski
2018-04-07 7:46 ` [PATCH 3/3] syscalls: rename struct pt_regs-based sys_*() to __x64_sys_*() Dominik Brodowski
2018-04-08 8:35 ` [PATCH 0/3] syscalls: clean up stub naming convention Ingo Molnar
2018-04-08 9:15 ` Dominik Brodowski
2018-04-08 19:59 ` Dominik Brodowski
2018-04-08 20:06 ` [PATCH 4/3] syscalls/x86: adapt syscall_wrapper.h to the new syscall " Dominik Brodowski
2018-04-09 6:49 ` [PATCH 0/3] syscalls: clean up " Ingo Molnar
2018-04-09 6:54 ` Dominik Brodowski
2018-04-09 6:39 ` Ingo Molnar
2018-04-09 19:13 ` Linus Torvalds
2018-04-09 6:45 ` Ingo Molnar
2018-04-09 6:53 ` Dominik Brodowski
2018-04-09 7:06 ` Ingo Molnar [this message]
2018-04-09 7:08 ` Dominik Brodowski
2018-04-09 7:34 ` Ingo Molnar
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=20180409070611.43iq66eay2ctwv2m@gmail.com \
--to=mingo@kernel.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=luto@kernel.org \
--cc=maninder1.s@samsung.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.