From: Qais Yousef <qyousef@layalina.io>
To: Pierre Gondois <pierre.gondois@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] sched/topology: Sort asym_cap_list in descending order
Date: Thu, 4 Jan 2024 19:17:13 +0000 [thread overview]
Message-ID: <20240104191713.6wcohpywqw36a2io@airbuntu> (raw)
In-Reply-To: <8e2263b7-e33b-43e1-b0df-92b560b8fa25@arm.com>
On 01/02/24 18:09, Pierre Gondois wrote:
> Hello Qais,
> I just have some comments regarding the commit message/comments,
> otherwise the code (of the 2 patches) looks good to me,
Thanks for taking a look!
>
> On 12/31/23 18:52, Qais Yousef wrote:
> > So that searches always start from biggest CPU which would help misfit
> > detection logic to be more efficient.
> >
> > I see the following when adding trace_printks() during add and del
> > operations
> >
> > init-1 [000] ..... 0.058128: asym_cpu_capacity_update_data: Added new capacity 250. Capacity list order:
> > init-1 [000] ..... 0.058132: asym_cpu_capacity_update_data: -- 250
> > init-1 [000] ..... 0.058135: asym_cpu_capacity_update_data: Added new capacity 620. Capacity list order:
> > init-1 [000] ..... 0.058136: asym_cpu_capacity_update_data: -- 620
> > init-1 [000] ..... 0.058137: asym_cpu_capacity_update_data: -- 250
> > init-1 [000] ..... 0.058139: asym_cpu_capacity_update_data: Added new capacity 1024. Capacity list order:
> > init-1 [000] ..... 0.058140: asym_cpu_capacity_update_data: -- 1024
> > init-1 [000] ..... 0.058141: asym_cpu_capacity_update_data: -- 620
> > init-1 [000] ..... 0.058142: asym_cpu_capacity_update_data: -- 250
> > init-1 [000] ..... 0.058143: asym_cpu_capacity_scan: Final capacity list order:
> > init-1 [000] ..... 0.058145: asym_cpu_capacity_scan: -- 1024
> > init-1 [000] ..... 0.058145: asym_cpu_capacity_scan: -- 620
> > init-1 [000] ..... 0.058146: asym_cpu_capacity_scan: -- 250
> > <...>-244 [007] ..... 1.959174: asym_cpu_capacity_update_data: Added new capacity 160. Capacity list order:
> > <...>-244 [007] ..... 1.959175: asym_cpu_capacity_update_data: -- 1024
> > <...>-244 [007] ..... 1.959176: asym_cpu_capacity_update_data: -- 620
> > <...>-244 [007] ..... 1.959176: asym_cpu_capacity_update_data: -- 250
> > <...>-244 [007] ..... 1.959176: asym_cpu_capacity_update_data: -- 160
> > <...>-244 [007] ..... 1.959183: asym_cpu_capacity_update_data: Added new capacity 498. Capacity list order:
> > <...>-244 [007] ..... 1.959184: asym_cpu_capacity_update_data: -- 1024
> > <...>-244 [007] ..... 1.959184: asym_cpu_capacity_update_data: -- 620
> > <...>-244 [007] ..... 1.959185: asym_cpu_capacity_update_data: -- 498
> > <...>-244 [007] ..... 1.959185: asym_cpu_capacity_update_data: -- 250
> > <...>-244 [007] ..... 1.959186: asym_cpu_capacity_update_data: -- 160
> > <...>-244 [007] ..... 1.959204: asym_cpu_capacity_scan: Deleted capacity 620
> > <...>-244 [007] ..... 1.959208: asym_cpu_capacity_scan: Deleted capacity 250
> > <...>-244 [007] ..... 1.959209: asym_cpu_capacity_scan: Final capacity list order:
> > <...>-244 [007] ..... 1.959209: asym_cpu_capacity_scan: -- 1024
> > <...>-244 [007] ..... 1.959210: asym_cpu_capacity_scan: -- 498
> > <...>-244 [007] ..... 1.959210: asym_cpu_capacity_scan: -- 160
> > rcuop/7-66 [001] b.... 1.968114: free_asym_cap_entry: Freeing capacity 620
> > rcuop/7-66 [001] b.... 1.968118: free_asym_cap_entry: Freeing capacity 250
>
> IMO the trace is not necessary.
Yeah maybe it's a bit too much. I'll drop it.
>
> >
> > Suggested-by: Pierre Gondois <pierre.gondois@arm.com>
> > Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
> > ---
> > kernel/sched/topology.c | 16 ++++++++++++++--
> > 1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> > index ba4a0b18ae25..1505677e4247 100644
> > --- a/kernel/sched/topology.c
> > +++ b/kernel/sched/topology.c
> > @@ -1384,18 +1384,30 @@ static void free_asym_cap_entry(struct rcu_head *head)
> > static inline void asym_cpu_capacity_update_data(int cpu)
> > {
> > unsigned long capacity = arch_scale_cpu_capacity(cpu);
> > - struct asym_cap_data *entry = NULL;
> > + struct asym_cap_data *insert_entry = NULL;
> > + struct asym_cap_data *entry;
> > + /*
> > + * Search if capacity already exits. If not, track which the entry
> > + * where we should insert to keep the list ordered descendingly.
> > + */
>
> IMO just a small comment like the one suggested below should be enough,
> but this is just a suggestion.
It seems you think it's too verbose but I think your suggestion is too terse
too. Since it is divided into two places and I am combining two operations
I thought it'd be useful to explain what's happening to help read the code at
a glance. I'll keep it as it is for now.
Thanks
--
Qais Yousef
prev parent reply other threads:[~2024-01-04 19:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-31 17:52 [PATCH v3 0/2] sched: Don't trigger misfit if affinity is restricted Qais Yousef
2023-12-31 17:52 ` [PATCH v3 1/2] sched/fair: Check a task has a fitting cpu when updating misfit Qais Yousef
2023-12-31 17:52 ` [PATCH v3 2/2] sched/topology: Sort asym_cap_list in descending order Qais Yousef
2024-01-02 17:09 ` Pierre Gondois
2024-01-04 19:17 ` Qais Yousef [this message]
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=20240104191713.6wcohpywqw36a2io@airbuntu \
--to=qyousef@layalina.io \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pierre.gondois@arm.com \
--cc=vincent.guittot@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®