From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, David Wei <[email protected]>,
[email protected]
Subject: Re: [PATCH v1 1/4] io_uring: only account cqring wait time as iowait if enabled for a ring
Date: Mon, 26 Feb 2024 14:56:27 +0000 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2/25/24 21:11, Jens Axboe wrote:
> On 2/25/24 9:43 AM, Jens Axboe wrote:
>> If you are motivated, please dig into it. If not, I guess I will take a
>> look this week.
I tried to split the atomic as mentioned, but I don't think anybody
cares, it was 0.1% in perf, so wouldn't even be benchmarkeable,
and it's iowait only patch anyway. If anything you'd need to read
two vars every tick now, so nevermind
> The straight forward approach - add a nr_short_wait and ->in_short_wait
> and ensure that the idle governor factors that in. Not sure how
> palatable it is, would be nice fold iowait under this, but doesn't
> really work with how we pass back the previous state.
It might look nicer if instead adding nr_short_waiters you'd
do nr_iowait_account for the iowait% and leave nr_iowait
for cpufreq.
The block iowaiting / io_schedule / etc. would need to set
both flags...
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 9116bcc90346..dc7a08db8921 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3790,6 +3790,8 @@ ttwu_do_activate(struct rq *rq, struct task_struct *p, int wake_flags,
> if (p->in_iowait) {
> delayacct_blkio_end(p);
> atomic_dec(&task_rq(p)->nr_iowait);
> + } else if (p->in_short_wait) {
> + atomic_dec(&task_rq(p)->nr_short_wait);
> }
>
> activate_task(rq, p, en_flags);
> @@ -4356,6 +4358,8 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
> if (p->in_iowait) {
> delayacct_blkio_end(p);
> atomic_dec(&task_rq(p)->nr_iowait);
> + } else if (p->in_short_wait) {
> + atomic_dec(&task_rq(p)->nr_short_wait);
... which would get this branch folded into the previous one,
which should be more welcome by the sched guys.
--
Pavel Begunkov
next prev parent reply other threads:[~2024-02-26 15:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-24 5:07 [PATCH v1 1/4] io_uring: only account cqring wait time as iowait if enabled for a ring David Wei
2024-02-24 5:07 ` [PATCH v1 2/4] liburing: add examples/proxy to .gitignore David Wei
2024-02-24 5:07 ` [PATCH v1 3/4] liburing: add helper for IORING_REGISTER_IOWAIT David Wei
2024-02-24 15:29 ` Jens Axboe
2024-02-24 16:39 ` David Wei
2024-02-24 5:07 ` [PATCH v1 4/4] liburing: add unit test for io_uring_register_iowait() David Wei
2024-02-24 15:28 ` [PATCH v1 1/4] io_uring: only account cqring wait time as iowait if enabled for a ring Jens Axboe
2024-02-24 15:31 ` Pavel Begunkov
2024-02-24 17:20 ` David Wei
2024-02-24 18:55 ` Jens Axboe
2024-02-25 1:39 ` Pavel Begunkov
2024-02-25 16:43 ` Jens Axboe
2024-02-25 21:11 ` Jens Axboe
2024-02-25 21:33 ` Jens Axboe
2024-02-26 14:56 ` Pavel Begunkov [this message]
2024-02-26 15:22 ` Jens Axboe
2024-02-24 18:51 ` Jens Axboe
2024-02-25 0:58 ` Pavel Begunkov
2024-02-25 16:39 ` Jens Axboe
2024-03-05 14:59 ` Christian Loehle
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox