From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH 3/3] io_uring: tweak io_req_task_work_add
Date: Wed, 30 Jun 2021 15:17:38 -0600 [thread overview]
Message-ID: <70c425a8-73dd-e15a-5a10-8ea640cdc7cd@kernel.dk> (raw)
In-Reply-To: <24b575ea075ae923992e9ce86b61e8b51629fd29.1625086418.git.asml.silence@gmail.com>
On 6/30/21 2:54 PM, Pavel Begunkov wrote:
> Whenever possible we don't want to fallback a request. task_work_add()
> will be fine if the task is exiting, so don't check for PF_EXITING,
> there is anyway only a relatively small gap between setting the flag
> and doing the final task_work_run().
>
> Also add likely for the hot path.
I'm not a huge fan of likely/unlikely, and in particular constructs like:
> - if (test_bit(0, &tctx->task_state) ||
> + if (likely(test_bit(0, &tctx->task_state)) ||
> test_and_set_bit(0, &tctx->task_state))
> return 0;
where the state is combined. In any case, it should be a separate
change. If there's an "Also" paragraph in a patch, then that's also
usually a good clue that that particular change should've been
separate :-)
--
Jens Axboe
next prev parent reply other threads:[~2021-06-30 21:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 20:54 [PATCH 5.14 0/3] fallback fix and task_work cleanup Pavel Begunkov
2021-06-30 20:54 ` [PATCH 1/3] io_uring: fix stuck fallback reqs Pavel Begunkov
2021-06-30 20:54 ` [PATCH 2/3] io_uring: simplify task_work func Pavel Begunkov
2021-06-30 20:54 ` [PATCH 3/3] io_uring: tweak io_req_task_work_add Pavel Begunkov
2021-06-30 21:17 ` Jens Axboe [this message]
2021-06-30 21:19 ` Pavel Begunkov
2021-06-30 21:22 ` Jens Axboe
2021-06-30 21:38 ` Pavel Begunkov
2021-06-30 21:45 ` Jens Axboe
2021-06-30 21:56 ` Jens Axboe
2021-06-30 22:04 ` Pavel Begunkov
2021-06-30 22:10 ` Pavel Begunkov
2021-06-30 22:11 ` Jens Axboe
2021-06-30 22:53 ` Pavel Begunkov
2021-06-30 21:57 ` Pavel Begunkov
2021-06-30 21:57 ` Jens Axboe
2021-06-30 21:18 ` [PATCH 5.14 0/3] fallback fix and task_work cleanup Jens Axboe
2021-06-30 21:20 ` Pavel Begunkov
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=70c425a8-73dd-e15a-5a10-8ea640cdc7cd@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--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.