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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 22 May 2020 16:38:57 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Mel Gorman <mgorman@...hsingularity.net>
Cc:     Jirka Hladky <jhladky@...hat.com>, Phil Auld <pauld@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Hillf Danton <hdanton@...a.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Douglas Shakshober <dshaks@...hat.com>,
        Waiman Long <longman@...hat.com>,
        Joe Mario <jmario@...hat.com>, Bill Gray <bgray@...hat.com>,
        riel@...riel.com
Subject: Re: [PATCH 00/13] Reconcile NUMA balancing decisions with the load
 balancer v6

On Fri, May 22, 2020 at 02:28:54PM +0100, Mel Gorman wrote:

> Is something like this on top of your patch what you had in mind?

All under the assumption that is makes it go faster of course ;-)

> ---8<---

static inline bool ttwu_queue_cond()
{
	/*
	 * If the CPU does not share cache, then queue the task on the
	 * remote rqs wakelist to avoid accessing remote data.
	 */
	if (!cpus_share_cache(smp_processor_id(), cpu))
		return true;

	/*
	 * If the task is descheduling and the only running task on the
	 * CPU, ....
	 */
	if ((wake_flags & WF_ON_RQ) && cpu_rq(cpu)->nr_running <= 1)
		return true;

	return false;
}

> -static bool ttwu_queue_remote(struct task_struct *p, int cpu, int wake_flags)
> +static bool ttwu_queue_wakelist(struct task_struct *p, int cpu, int wake_flags)
>  {
> -	if (sched_feat(TTWU_QUEUE) && !cpus_share_cache(smp_processor_id(), cpu)) {
> -		sched_clock_cpu(cpu); /* Sync clocks across CPUs */
> -		__ttwu_queue_remote(p, cpu, wake_flags);
> -		return true;
> +	if (sched_feat(TTWU_QUEUE)) {
> +		/*
> +		 * If CPU does not share cache then queue the task on the remote
> +		 * rqs wakelist to avoid accessing remote data. Alternatively,
> +		 * if the task is descheduling and the only running task on the
> +		 * CPU then use the wakelist to offload the task activation to
> +		 * the CPU that will soon be idle so the waker can continue.
> +		 * nr_running is checked to avoid unnecessary task stacking.
> +		 */
> +		if (!cpus_share_cache(smp_processor_id(), cpu) ||
> +		    ((wake_flags & WF_ON_RQ) && cpu_rq(cpu)->nr_running <= 1)) {
> +			sched_clock_cpu(cpu); /* Sync clocks across CPUs */
> +			__ttwu_queue_wakelist(p, cpu, wake_flags);
> +			return true;
> +		}

	if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu, wake_flags)) {
		sched_clock_cpu(cpu); /* Sync clocks across CPUs */
		__ttwu_queue_remote(p, cpu, wake_flags);
		return true;

>  	}
>  
>  	return false;


might be easier to read...

Powered by blists - more mailing lists