lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Mar 2020 17:51:13 +0000
From:   Qais Yousef <qais.yousef@....com>
To:     Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Pavan Kondeti <pkondeti@...eaurora.org>
Cc:     Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/6] sched/rt: Fix pushing unfit tasks to a better CPU

Hi Pavan

On 03/02/20 13:27, Qais Yousef wrote:
> If a task was running on unfit CPU we could ignore migrating if the
> priority level of the new fitting CPU is the *same* as the unfit one.
> 
> Add an extra check to select_task_rq_rt() to allow the push in case:
> 
> 	* p->prio == new_cpu.highest_priority
> 	* task_fits(p, new_cpu)
> 
> Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware")
> Signed-off-by: Qais Yousef <qais.yousef@....com>
> ---

Can you please confirm if you have any objection to this patch? Without it
I see large delays in the 2 tasks test like I outlined in [1]. It wasn't clear
from [2] whether you are in agreement now or not.

[1] https://lore.kernel.org/lkml/20200217135306.cjc2225wdlwqiicu@e107158-lin.cambridge.arm.com/
[2] https://lore.kernel.org/lkml/20200227033608.GN28029@codeaurora.org/

Thanks

--
Qais Yousef

>  kernel/sched/rt.c | 41 ++++++++++++++++++++++++++++-------------
>  1 file changed, 28 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index ce230bec6847..8aaa442e4867 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1474,20 +1474,35 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
>  	if (test || !rt_task_fits_capacity(p, cpu)) {
>  		int target = find_lowest_rq(p);
>  
> -		/*
> -		 * Bail out if we were forcing a migration to find a better
> -		 * fitting CPU but our search failed.
> -		 */
> -		if (!test && target != -1 && !rt_task_fits_capacity(p, target))
> -			goto out_unlock;
> +		if (target != -1) {
> +			bool fit_target = rt_task_fits_capacity(p, target);
>  
> -		/*
> -		 * Don't bother moving it if the destination CPU is
> -		 * not running a lower priority task.
> -		 */
> -		if (target != -1 &&
> -		    p->prio < cpu_rq(target)->rt.highest_prio.curr)
> -			cpu = target;
> +			/*
> +			 * Bail out if we were forcing a migration to find a
> +			 * better fitting CPU but our search failed.
> +			 */
> +			if (!test && !fit_target)
> +				goto out_unlock;
> +
> +			/*
> +			 * Don't bother moving it if the destination CPU is
> +			 * not running a lower priority task.
> +			 */
> +			if (p->prio < cpu_rq(target)->rt.highest_prio.curr) {
> +
> +				cpu = target;
> +
> +			} else if (p->prio == cpu_rq(target)->rt.highest_prio.curr) {
> +
> +				/*
> +				 * If the priority is the same and the new CPU
> +				 * is a better fit, then move, otherwise don't
> +				 * bother here either.
> +				 */
> +				if (fit_target)
> +					cpu = target;
> +			}
> +		}
>  	}
>  
>  out_unlock:
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ