* [RFC] io_uring: submit even with overflow backlog
@ 2021-04-15 12:40 Pavel Begunkov
2021-04-15 13:59 ` Jens Axboe
2021-04-16 23:28 ` [PATCH] io_uring: don't fail submit " Pavel Begunkov
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-04-15 12:40 UTC (permalink / raw)
To: Jens Axboe, io-uring
Not submitting when have requests in overflow backlog looks artificial,
and limits users for no clear purpose, especially since requests with
resources are now not locked into it but it consists for a small memory
area. Remove the restriction.
Signed-off-by: Pavel Begunkov <[email protected]>
---
Mainly for discussion. It breaks several tests, and so in theory
userspace, but can't think this restriction not being just a
nuisance to the userspace. IMHO much more convenient to allow it,
userspace can take care of it itself if needed, but for those
who don't care and use rings in parallel (e.g. different threads
for submission and completion), it will be hell of a synchronisation.
fs/io_uring.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 357993e3e0d2..21026653e1c1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6673,12 +6673,6 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
{
int submitted = 0;
- /* if we have a backlog and couldn't flush it all, return BUSY */
- if (test_bit(0, &ctx->sq_check_overflow)) {
- if (!__io_cqring_overflow_flush(ctx, false))
- return -EBUSY;
- }
-
/* make sure SQ entry isn't read before tail */
nr = min3(nr, ctx->sq_entries, io_sqring_entries(ctx));
--
2.24.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC] io_uring: submit even with overflow backlog
2021-04-15 12:40 [RFC] io_uring: submit even with overflow backlog Pavel Begunkov
@ 2021-04-15 13:59 ` Jens Axboe
2021-04-15 14:00 ` Pavel Begunkov
2021-04-16 23:28 ` [PATCH] io_uring: don't fail submit " Pavel Begunkov
1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-04-15 13:59 UTC (permalink / raw)
To: Pavel Begunkov, io-uring
On 4/15/21 6:40 AM, Pavel Begunkov wrote:
> Not submitting when have requests in overflow backlog looks artificial,
> and limits users for no clear purpose, especially since requests with
> resources are now not locked into it but it consists for a small memory
> area. Remove the restriction.
>
> Signed-off-by: Pavel Begunkov <[email protected]>
> ---
>
> Mainly for discussion. It breaks several tests, and so in theory
> userspace, but can't think this restriction not being just a
> nuisance to the userspace. IMHO much more convenient to allow it,
> userspace can take care of it itself if needed, but for those
> who don't care and use rings in parallel (e.g. different threads
> for submission and completion), it will be hell of a synchronisation.
I think we can kill it, with the main change enabling that being the
cgroup memory accounting. This was kind of a safe guard to avoid having
silly cases just go way overboard, but I do agree that this is really
up to the application to manage. And it may have an easier time doing
so without -EBUSY on overflow being set on submit.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] io_uring: submit even with overflow backlog
2021-04-15 13:59 ` Jens Axboe
@ 2021-04-15 14:00 ` Pavel Begunkov
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-04-15 14:00 UTC (permalink / raw)
To: Jens Axboe, io-uring
On 15/04/2021 14:59, Jens Axboe wrote:
> On 4/15/21 6:40 AM, Pavel Begunkov wrote:
>> Not submitting when have requests in overflow backlog looks artificial,
>> and limits users for no clear purpose, especially since requests with
>> resources are now not locked into it but it consists for a small memory
>> area. Remove the restriction.
>>
>> Signed-off-by: Pavel Begunkov <[email protected]>
>> ---
>>
>> Mainly for discussion. It breaks several tests, and so in theory
>> userspace, but can't think this restriction not being just a
>> nuisance to the userspace. IMHO much more convenient to allow it,
>> userspace can take care of it itself if needed, but for those
>> who don't care and use rings in parallel (e.g. different threads
>> for submission and completion), it will be hell of a synchronisation.
>
> I think we can kill it, with the main change enabling that being the
> cgroup memory accounting. This was kind of a safe guard to avoid having
Yeah, and not keeping requests, its resources and linking requests.
> silly cases just go way overboard, but I do agree that this is really
> up to the application to manage. And it may have an easier time doing
> so without -EBUSY on overflow being set on submit.
Btw, apparently that's the main reason for getting -EBUSY in mshot test,
just another lackmustest that it's not convenient.
--
Pavel Begunkov
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] io_uring: don't fail submit with overflow backlog
2021-04-15 12:40 [RFC] io_uring: submit even with overflow backlog Pavel Begunkov
2021-04-15 13:59 ` Jens Axboe
@ 2021-04-16 23:28 ` Pavel Begunkov
1 sibling, 0 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-04-16 23:28 UTC (permalink / raw)
To: Jens Axboe, io-uring
Don't fail submission attempts if there are CQEs in the overflow
backlog, but give away the decision making to the userspace. It
might be very inconvenient to the userspace, especially if
submission and completion are done by different threads.
We can remove it because of recent changes, where requests
are now not locked by the backlog, backlog entries are allocated
separately, so they take less space and cgroup accounted.
Signed-off-by: Pavel Begunkov <[email protected]>
---
since RFC: commit message rewording
fs/io_uring.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 357993e3e0d2..21026653e1c1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6673,12 +6673,6 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
{
int submitted = 0;
- /* if we have a backlog and couldn't flush it all, return BUSY */
- if (test_bit(0, &ctx->sq_check_overflow)) {
- if (!__io_cqring_overflow_flush(ctx, false))
- return -EBUSY;
- }
-
/* make sure SQ entry isn't read before tail */
nr = min3(nr, ctx->sq_entries, io_sqring_entries(ctx));
--
2.24.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-16 23:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-15 12:40 [RFC] io_uring: submit even with overflow backlog Pavel Begunkov
2021-04-15 13:59 ` Jens Axboe
2021-04-15 14:00 ` Pavel Begunkov
2021-04-16 23:28 ` [PATCH] io_uring: don't fail submit " Pavel Begunkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox