From: luca abeni <luca.abeni@santannapisa.it>
To: Vineeth Remanan Pillai <vineeth@bitbyteword.org>
Cc: Juri Lelli <juri.lelli@redhat.com>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Joel Fernandes <joel@joelfernandes.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 2/5] sched/deadline: Fix reclaim inaccuracy with SMP
Date: Fri, 19 May 2023 11:56:21 +0200 [thread overview]
Message-ID: <20230519115621.2b3f75e2@luca64> (raw)
In-Reply-To: <CAO7JXPh5uLV4QjAEi6bJXfAGSsZ=XsnCyzrvKS8m35BGbRPYJw@mail.gmail.com>
Hi,
sorry for returning on this discussion, but there is something I still
do not understand:
On Tue, 16 May 2023 11:08:18 -0400
Vineeth Remanan Pillai <vineeth@bitbyteword.org> wrote:
[...]
> I had tested this and it was reclaiming much less compared to the
> first one. I had 3 tasks with reservation (3,100) and 3 cpus.
So, just to confirm: here you have only 3 SCHED_DEADLINE tasks,
scheduled on a root domain containing only 3 CPUs (dl_bw_cpus() return
3)... Right?
So, the utilization of each task is 3/100 = 0.03 and Uextra is
1 - (0.03 * 3) / 3 = 0.97.
And since all the tasks are always active, Uinact = 0...
Is this understanding right?
If so:
> With dq = -(max{u_i, (Umax - Uinact - Uextra)} / Umax) * dt (1)
> TID[636]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 95.08
> TID[635]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 95.07
> TID[637]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 95.06
>
> With dq = -(max{u_i, (1 - Uinact - Uextra)} / Umax) * dt (2)
> TID[601]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 35.65
> TID[600]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 35.65
> TID[602]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 35.65
Here, we should have
dq = -(max{0.03, (1 - 0 - 0.97)} / Umax) * dt
= -(0.03 / Umax) * dt
which reclaims up to Umax... So, the utilization should be 95%
Since you measured 35.65%, it means that (1-Uextra) is much larger
than 0.97... So, maybe you found some bug in the Uextra computation?
Can you try printing the extra_bw value, to check what happened?
Thanks,
Luca
>
> As the task bandwidth goes higher, equation (2) reclaims more, but
> equation (2) is a constant of 95% as long as number of tasks less
> than cpus. If the number of tasks is more than cpus, eq (2) fares
> better in reclaiming than eq (1)
>
> eq (1) with 5 tasks (3,100)
> TID[627]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 28.64
> TID[626]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 28.64
> TID[629]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 28.62
> TID[628]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 29.00
> TID[630]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 28.99
>
> Here top shows 3 cpus in the range ~45 to 50% util
>
> eq (2) with 5 tasks (3,100)
> TID[667]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 57.20
> TID[670]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 57.79
> TID[668]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 57.11
> TID[666]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 56.34
> TID[669]: RECLAIM=1, (r=3ms, d=100ms, p=100ms), Util: 55.82
>
> And here top shows all 3 cpus with 95% util
>
> > I'll write more about this later... And thanks for coping with all
> > my comments!
> >
> Thanks :-)
>
> Vineeth
next prev parent reply other threads:[~2023-05-19 9:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 2:57 [PATCH v3 0/5] GRUB reclaiming fixes Vineeth Pillai
2023-05-15 2:57 ` [PATCH v3 1/5] sched/deadline: Fix bandwidth reclaim equation in GRUB Vineeth Pillai
2023-05-15 2:57 ` [PATCH v3 2/5] sched/deadline: Fix reclaim inaccuracy with SMP Vineeth Pillai
2023-05-15 8:06 ` luca abeni
2023-05-16 1:47 ` Vineeth Remanan Pillai
2023-05-16 7:37 ` luca abeni
2023-05-16 15:08 ` Vineeth Remanan Pillai
2023-05-16 16:19 ` luca abeni
2023-05-17 2:17 ` Vineeth Remanan Pillai
2023-05-19 9:56 ` luca abeni [this message]
2023-05-19 10:18 ` luca abeni
2023-05-19 16:12 ` Vineeth Remanan Pillai
2023-05-20 9:50 ` luca abeni
2023-05-20 9:58 ` luca abeni
2023-05-22 19:22 ` Vineeth Remanan Pillai
2023-05-23 20:58 ` luca abeni
2023-05-24 2:11 ` Vineeth Remanan Pillai
2023-05-26 14:54 ` Vineeth Remanan Pillai
2023-05-26 15:18 ` luca abeni
2023-05-19 17:56 ` Dietmar Eggemann
2023-05-20 2:15 ` Vineeth Remanan Pillai
2023-05-25 11:55 ` Dietmar Eggemann
2023-05-15 2:57 ` [PATCH v3 3/5] sched/deadline: Remove unused variable extra_bw Vineeth Pillai
2023-05-15 2:57 ` [PATCH v3 4/5] sched/deadline: Account for normal deadline tasks in GRUB Vineeth Pillai
2023-05-15 2:57 ` [PATCH v3 5/5] Documentation: sched/deadline: Update GRUB description Vineeth Pillai
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=20230519115621.2b3f75e2@luca64 \
--to=luca.abeni@santannapisa.it \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=corbet@lwn.net \
--cc=dietmar.eggemann@arm.com \
--cc=joel@joelfernandes.org \
--cc=juri.lelli@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vineeth@bitbyteword.org \
--cc=vschneid@redhat.com \
/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.