public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Christian Brauner <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [PATCHSET v4 0/5] Add io_uring support for waitid
Date: Tue, 19 Sep 2023 08:57:30 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <20230919-beinen-fernab-dbc587acb08d@brauner>

On 9/19/23 8:45 AM, Christian Brauner wrote:
> On Tue, Sep 12, 2023 at 11:06:39AM -0600, Jens Axboe wrote:
>> On 9/9/23 9:11 AM, Jens Axboe wrote:
>>> Hi,
>>>
>>> This adds support for IORING_OP_WAITID, which is an async variant of
>>> the waitid(2) syscall. Rather than have a parent need to block waiting
>>> on a child task state change, it can now simply get an async notication
>>> when the requested state change has occured.
>>>
>>> Patches 1..4 are purely prep patches, and should not have functional
>>> changes. They split out parts of do_wait() into __do_wait(), so that
>>> the prepare-to-wait and sleep parts are contained within do_wait().
>>>
>>> Patch 5 adds io_uring support.
>>>
>>> I wrote a few basic tests for this, which can be found in the
>>> 'waitid' branch of liburing:
>>>
>>> https://git.kernel.dk/cgit/liburing/log/?h=waitid
>>>
>>> Also spun a custom kernel for someone to test it, and no issues reported
>>> so far.
>>
>> Forget to mention that I also ran all the ltp testcases for any wait*
>> syscall test, and everything still passes just fine.
> 
> I think the struct that this ends up exposing to io_uring is pretty ugly
> and it would warrant a larger cleanup. I wouldn't be surprised if you
> get some people complain about this.
> 
> Other than that I don't have any complaints about the series.

io_uring only really needs child_wait and wo_pid on the wait_opts side,
for waitid_info it needs all of it. I'm assuming your worry is about the
former rather than the latter.

I think we could only make this smaller if we had a separate entry point
for io_uring, which would then make the code reuse a lot smaller. Right
now we just have __do_wait() abstracted out, and if we added a third
struct that has child_wait/wo_pid and exposed just that, we could not
share this infrastructure.

So as far as I can tell, there's no way to make the sharing less than it
is, at least not without adding cost of more code and less reuse.

Shrug?

-- 
Jens Axboe


  reply	other threads:[~2023-09-19 14:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-09 15:11 [PATCHSET v4 0/5] Add io_uring support for waitid Jens Axboe
2023-09-09 15:11 ` [PATCH 1/5] exit: abstract out should_wake helper for child_wait_callback() Jens Axboe
2023-09-09 15:11 ` [PATCH 2/5] exit: move core of do_wait() into helper Jens Axboe
2023-09-09 15:11 ` [PATCH 3/5] exit: add kernel_waitid_prepare() helper Jens Axboe
2023-09-09 15:11 ` [PATCH 4/5] exit: add internal include file with helpers Jens Axboe
2023-09-09 15:11 ` [PATCH 5/5] io_uring: add IORING_OP_WAITID support Jens Axboe
2023-09-12 17:06 ` [PATCHSET v4 0/5] Add io_uring support for waitid Jens Axboe
2023-09-19 14:45   ` Christian Brauner
2023-09-19 14:57     ` Jens Axboe [this message]
2023-09-20 14:54       ` Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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