Re: [PATCH v3 1/2] io_uring: avoid whole io_wq_work copy for requests completed inline

Jens Axboe
2020-05-29T14:27:58Z

On 5/29/20 2:58 AM, Pavel Begunkov wrote:
> On 28/05/2020 12:15, Xiaoguang Wang wrote:
>> If requests can be submitted and completed inline, we don't need to
>> initialize whole io_wq_work in io_init_req(), which is an expensive
>> operation, add a new 'REQ_F_WORK_INITIALIZED' to control whether
>> io_wq_work is initialized.
>
> It looks nicer. Especially if you'd add a helper as Jens supposed.
>
> The other thing, even though I hate treating a part of the fields differently
> from others, I don't like ->creds tossing either.
>
> Did you consider trying using only ->work.creds without adding req->creds? like
> in the untested incremental below. init_io_work() there is misleading, should be
> somehow played around better.

I had that thought too when reading the patchset, would be nice _not_ to have
to add a new creds field.

--
Jens Axboe