mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Qais Yousef <qais.yousef@arm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	peterz@infradead.org, vincent.guittot@linaro.org
Subject: Re: [PATCH 2/3] sched/fair: Prevent active LB from preempting higher sched classes
Date: Thu, 8 Aug 2019 11:46:36 +0100	[thread overview]
Message-ID: <4d7cd9de-9f90-0e47-5c77-e888fb7eb3ef@arm.com> (raw)
In-Reply-To: <20190808092455.qavanylzts2vmktk@e107158-lin.cambridge.arm.com>

On 08/08/2019 10:24, Qais Yousef wrote:
>> @@ -8834,6 +8834,10 @@ static inline enum alb_status active_load_balance(struct lb_env *env)
>>  
>>  	raw_spin_lock_irqsave(&busiest->lock, flags);
>>  
>> +	/* Make sure we're not about to stop a task from a higher sched class */
>> +	if (busiest->curr->sched_class != &fair_sched_class)
>> +		goto unlock;
>> +
> 
> This looks correct to me, but I wonder if this check is something that belongs
> to the CONFIG_PREEMPT_RT land. This will give a preference to not disrupt the
> RT/DL tasks which is certainly the desired behavior there, but maybe in none
> PREEMPT_RT world balancing CFS tasks is more important? Hmmm
> 

My take on this is that if the running task isn't CFS, there is no point in
running the cpu_stopper there (PREEMPT_RT or not). We can still try other
things though.

It could be that the running task had been > CFS all along, so if we
failed to move any load then we just couldn't pull any CFS task and should
bail out of load balance at this point.

If the running task was CFS but got preempted by a > CFS task in the
meantime (e.g. after detach_tasks() failed to pull anything), the best we
could do is run detach_one_task() (locally - no need for any cpu_stopper)
to try and nab the now not-running CFS task. Otherwise we'll have to wait
for another round of load_balance().
Not sure how much we care about this case - I think it's extremely unlikely
to repeatedly want to pull a currently-running CFS task and have it
repeatedly preempted by a > CFS task whenever we get to active_load_balance().

Let me try and see if I can come up with something sensible with that
detach_one_task() thingy.

> --
> Qais Yousef
> 
>>  	/*
>>  	 * Don't kick the active_load_balance_cpu_stop, if the curr task on
>>  	 * busiest CPU can't be moved to dst_cpu:
>> --
>> 2.22.0
>>

  reply	other threads:[~2019-08-08 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 17:40 [PATCH 0/3] sched/fair: Active balancer RT/DL preemption fix Valentin Schneider
2019-08-07 17:40 ` [PATCH 1/3] sched/fair: Move active balance logic to its own function Valentin Schneider
2019-08-07 17:40 ` [PATCH 2/3] sched/fair: Prevent active LB from preempting higher sched classes Valentin Schneider
2019-08-08  9:24   ` Qais Yousef
2019-08-08 10:46     ` Valentin Schneider [this message]
2019-08-07 17:40 ` [PATCH 3/3] sched/fair: Check for CFS tasks in active_load_balance_cpu_stop() 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=4d7cd9de-9f90-0e47-5c77-e888fb7eb3ef@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=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

Powered by JetHome