[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7d702960-bb2b-4abb-29b4-4f169db7ecf2@kernel.dk>
Date: Sun, 12 Sep 2021 16:49:15 -0600
From: Jens Axboe <axboe@...nel.dk>
To: "Dmitry V. Levin" <ldv@...linux.org>
Cc: Eugene Syromiatnikov <esyr@...hat.com>,
Pavel Begunkov <asml.silence@...il.com>,
io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-api@...r.kernel.org
Subject: Re: [PATCH] io-wq: expose IO_WQ_ACCT_* enumeration items to UAPI
On 9/12/21 4:24 PM, Dmitry V. Levin wrote:
> On Sun, Sep 12, 2021 at 12:29:41PM -0600, Jens Axboe wrote:
>> On 9/12/21 6:24 AM, Eugene Syromiatnikov wrote:
>>> These are used to index aargument of IORING_REGISTER_IOWQ_MAX_WORKERS
>>> io_uring_register command, so they are to be exposed in UAPI.
>>
>> Not sure that's necessary, as it's really just a boolean values - is
>> the worker type bounded or not. That said, not against making it
>> available for userspace, but definitely not IO_WQ_ACCT_NR. It
>> should probably just go in liburing, I guess.
>
> If IO_WQ_ACCT_* were just boolean values, no enum would have been
> introduced in the first place. What's the benefit of hiding
> the API in the implementation, or burying it inside liburing?
Because it's easier to grok internally with an enum instead of
using 0/1. And you could argue that's the case too for an app,
and as I said, I'm not against making them exposed, but the _NR
part is strictly internal.
Just add separate defines or an enum in io_uring.h:
enum {
IO_WQ_BOUND,
IO_WQ_UNBOUND,
};
and be done with it.
--
Jens Axboe
Powered by blists - more mailing lists