All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>,
	Florian Schmaus <flo@geekplace.eu>,
	io-uring@vger.kernel.org
Subject: Re: [PATCH 9/9] io_uring: optimise io_get_cqe()
Date: Tue, 12 Apr 2022 10:25:28 -0600	[thread overview]
Message-ID: <01c568c3-8248-215c-1525-b78422f3910e@kernel.dk> (raw)
In-Reply-To: <bfede80f-b712-f34e-47d7-a81bd7f17afb@gmail.com>

On 4/12/22 10:15 AM, Pavel Begunkov wrote:
> On 4/12/22 17:06, Florian Schmaus wrote:
>> On 12/04/2022 16.09, Pavel Begunkov wrote:
>>> io_get_cqe() is expensive because of a bunch of loads, masking, etc.
>>> However, most of the time we should have enough of entries in the CQ,
>>> so we can cache two pointers representing a range of contiguous CQE
>>> memory we can use. When the range is exhausted we'll go through a slower
>>> path to set up a new range. When there are no CQEs avaliable, pointers
>>> will naturally point to the same address.
>>>
>>> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>>> ---
>>>   fs/io_uring.c | 46 +++++++++++++++++++++++++++++++++++-----------
>>>   1 file changed, 35 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>>> index b349a3c52354..f2269ffe09eb 100644
>>> --- a/fs/io_uring.c
>>> +++ b/fs/io_uring.c
>>> @@ -416,6 +416,13 @@ struct io_ring_ctx {
>>>       unsigned long        check_cq_overflow;
>>>       struct {
>>> +        /*
>>> +         * We cache a range of free CQEs we can use, once exhausted it
>>> +         * should go through a slower range setup, see __io_get_cqe()
>>> +         */
>>> +        struct io_uring_cqe    *cqe_cached;
>>> +        struct io_uring_cqe    *cqe_santinel;
>>
>> I think this should s/santinel/sentinel.

I fixed it up.

-- 
Jens Axboe


  reply	other threads:[~2022-04-12 16:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 14:09 [PATCH next 0/9] for-next clean ups and micro optimisation Pavel Begunkov
2022-04-12 14:09 ` [PATCH 1/9] io_uring: explicitly keep a CQE in io_kiocb Pavel Begunkov
2022-04-12 14:09 ` [PATCH 2/9] io_uring: memcpy CQE from req Pavel Begunkov
2022-04-12 14:09 ` [PATCH 3/9] io_uring: shrink final link flush Pavel Begunkov
2022-04-12 14:09 ` [PATCH 4/9] io_uring: inline io_flush_cached_reqs Pavel Begunkov
2022-04-12 14:09 ` [PATCH 5/9] io_uring: helper for empty req cache checks Pavel Begunkov
2022-04-12 14:09 ` [PATCH 6/9] io_uring: add helper to return req to cache list Pavel Begunkov
2022-04-12 14:09 ` [PATCH 7/9] io_uring: optimise submission loop invariant Pavel Begunkov
2022-04-12 14:09 ` [PATCH 8/9] io_uring: optimise submission left counting Pavel Begunkov
2022-04-12 14:09 ` [PATCH 9/9] io_uring: optimise io_get_cqe() Pavel Begunkov
2022-04-12 16:06   ` Florian Schmaus
2022-04-12 16:15     ` Pavel Begunkov
2022-04-12 16:25       ` Jens Axboe [this message]
2022-04-12 15:05 ` [PATCH next 0/9] for-next clean ups and micro optimisation Jens Axboe
2022-04-12 15:12   ` Jens Axboe
2022-04-12 16:47 ` 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 \
    --in-reply-to=01c568c3-8248-215c-1525-b78422f3910e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=flo@geekplace.eu \
    --cc=io-uring@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.