From: Jens Axboe <axboe@kernel.dk>
To: Florian Weimer <fweimer@redhat.com>, Arnd Bergmann <arnd@arndb.de>
Cc: "y2038 Mailman List" <y2038@lists.linaro.org>,
"Linux API" <linux-api@vger.kernel.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Stefan Bühler" <source@stbuehler.de>,
"Hannes Reinecke" <hare@suse.com>,
"Jackie Liu" <liuyun01@kylinos.cn>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Hristo Venev" <hristo@venev.name>,
linux-block <linux-block@vger.kernel.org>,
"Linux FS-devel Mailing List" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] io_uring: use __kernel_timespec in timeout ABI
Date: Tue, 1 Oct 2019 12:08:16 -0600 [thread overview]
Message-ID: <dc4fc8dc-0a6b-19a2-e85b-71fd1ad4c4ca@kernel.dk> (raw)
In-Reply-To: <874l0stpog.fsf@oldenburg2.str.redhat.com>
On 10/1/19 10:07 AM, Florian Weimer wrote:
> * Arnd Bergmann:
>
>> On Tue, Oct 1, 2019 at 5:38 PM Jens Axboe <axboe@kernel.dk> wrote:
>>>
>>> On 10/1/19 8:09 AM, Jens Axboe wrote:
>>>> On 9/30/19 2:20 PM, Arnd Bergmann wrote:
>>>>> All system calls use struct __kernel_timespec instead of the old struct
>>>>> timespec, but this one was just added with the old-style ABI. Change it
>>>>> now to enforce the use of __kernel_timespec, avoiding ABI confusion and
>>>>> the need for compat handlers on 32-bit architectures.
>>>>>
>>>>> Any user space caller will have to use __kernel_timespec now, but this
>>>>> is unambiguous and works for any C library regardless of the time_t
>>>>> definition. A nicer way to specify the timeout would have been a less
>>>>> ambiguous 64-bit nanosecond value, but I suppose it's too late now to
>>>>> change that as this would impact both 32-bit and 64-bit users.
>>>>
>>>> Thanks for catching that, Arnd. Applied.
>>>
>>> On second thought - since there appears to be no good 64-bit timespec
>>> available to userspace, the alternative here is including on in liburing.
>>
>> What's wrong with using __kernel_timespec? Just the name?
>> I suppose liburing could add a macro to give it a different name
>> for its users.
>
> Yes, mostly the name.
>
> __ names are reserved for the C/C++ implementation (which does not
> include the kernel). __kernel_timespec looks like an internal kernel
> type to the uninitiated, not a UAPI type.
>
> Once we have struct timespec64 in userspace, you also end up with
> copying stuff around or introducing aliasing violations.
>
> I'm not saying those concerns are valid, but you asked what's wrong with
> it. 8-)
FWIW, I do agree, __kernel_timespec sounds like an internal type, not
something apps should be using. timespec64 works a lot better for that.
Oh well.
--
Jens Axboe
prev parent reply other threads:[~2019-10-01 18:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 20:20 [PATCH] io_uring: use __kernel_timespec in timeout ABI Arnd Bergmann
2019-10-01 14:09 ` Jens Axboe
2019-10-01 15:38 ` Jens Axboe
2019-10-01 15:49 ` Arnd Bergmann
2019-10-01 15:52 ` Jens Axboe
2019-10-01 15:57 ` Arnd Bergmann
2019-10-01 16:02 ` Jens Axboe
2019-10-01 16:07 ` Florian Weimer
2019-10-01 18:08 ` Jens Axboe [this message]
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=dc4fc8dc-0a6b-19a2-e85b-71fd1ad4c4ca@kernel.dk \
--to=axboe@kernel.dk \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=fweimer@redhat.com \
--cc=hare@suse.com \
--cc=hristo@venev.name \
--cc=linux-api@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyun01@kylinos.cn \
--cc=source@stbuehler.de \
--cc=viro@zeniv.linux.org.uk \
--cc=y2038@lists.linaro.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).