From: Valentin Schneider <valentin.schneider@arm.com>
To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
peterz@infradead.org, vincent.guittot@linaro.org,
tglx@linutronix.de, qais.yousef@arm.com
Subject: Re: [PATCH v2 2/4] sched/fair: Move active balance logic to its own function
Date: Tue, 1 Oct 2019 12:48:17 +0100 [thread overview]
Message-ID: <4ecdbee5-9eb5-a18c-80c4-3473d3f1124c@arm.com> (raw)
In-Reply-To: <20191001111601.GA32306@linux.vnet.ibm.com>
On 01/10/2019 12:36, Srikar Dronamraju wrote:
>> +unlock:
>> + raw_spin_unlock_irqrestore(&busiest->lock, flags);
>> +
>> + if (status == started)
>> + stop_one_cpu_nowait(cpu_of(busiest),
>> + active_load_balance_cpu_stop, busiest,
>> + &busiest->active_balance_work);
>> +
>> + /* We've kicked active balancing, force task migration. */
>> + if (status != cancelled_affinity)
>> + sd->nr_balance_failed = sd->cache_nice_tries + 1;
>
> Should we really update nr_balance_failed if status is cancelled?
> I do understand this behaviour was present even before this change. But
> still dont understand why we need to update if the current operation didn't
> kick active_load_balance.
>
Agreed, I kept it as is to keep this as pure a code movement as possible,
but I don't see why this wouldn't be valid wouldn't be valid
(PoV of the current code):
---
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1fac444a4831..59f9e3583482 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9023,10 +9023,10 @@ static int load_balance(int this_cpu, struct rq *this_rq,
stop_one_cpu_nowait(cpu_of(busiest),
active_load_balance_cpu_stop, busiest,
&busiest->active_balance_work);
- }
- /* We've kicked active balancing, force task migration. */
- sd->nr_balance_failed = sd->cache_nice_tries+1;
+ /* We've kicked active balancing, force task migration. */
+ sd->nr_balance_failed = sd->cache_nice_tries+1;
+ }
}
} else
sd->nr_balance_failed = 0;
---
Or even better, fold it in active_load_balance_cpu_stop(). I could add that
after the move.
next prev parent reply other threads:[~2019-10-01 11:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 14:51 [PATCH v2 0/4] sched/fair: Active balancer RT/DL preemption fix Valentin Schneider
2019-08-15 14:51 ` [PATCH v2 1/4] sched/fair: Make need_active_balance() return bools Valentin Schneider
2019-08-15 14:51 ` [PATCH v2 2/4] sched/fair: Move active balance logic to its own function Valentin Schneider
2019-10-01 11:36 ` Srikar Dronamraju
2019-10-01 11:48 ` Valentin Schneider [this message]
2019-08-15 14:51 ` [PATCH v2 3/4] sched/fair: Check for CFS tasks before detach_one_task() Valentin Schneider
2019-08-15 14:51 ` [PATCH v2 4/4] sched/fair: Prevent active LB from preempting higher sched classes Valentin Schneider
2019-08-27 12:28 ` Vincent Guittot
2019-08-28 9:46 ` Valentin Schneider
2019-08-29 14:19 ` Vincent Guittot
2019-08-30 15:44 ` Valentin Schneider
2019-10-01 10:29 ` [PATCH v2 0/4] sched/fair: Active balancer RT/DL preemption fix Valentin Schneider
2019-10-01 13:31 ` Juri Lelli
2019-10-01 14:15 ` Valentin Schneider
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=4ecdbee5-9eb5-a18c-80c4-3473d3f1124c@arm.com \
--to=valentin.schneider@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qais.yousef@arm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).