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]
Message-ID: <20101229145153.GE2728@zhy>
Date:	Wed, 29 Dec 2010 22:51:53 +0800
From:	Yong Zhang <yong.zhang0@...il.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Chris Mason <chris.mason@...cle.com>,
	Frank Rowand <frank.rowand@...sony.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Mike Galbraith <efault@....de>,
	Oleg Nesterov <oleg@...hat.com>, Paul Turner <pjt@...gle.com>,
	Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 17/17] sched: Sort hotplug vs ttwu queueing

On Fri, Dec 24, 2010 at 01:23:55PM +0100, Peter Zijlstra wrote:
> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> ---
>  kernel/sched.c |   20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6/kernel/sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ linux-2.6/kernel/sched.c
> @@ -2470,15 +2470,15 @@ static int ttwu_remote(struct task_struc
>  	return ret;
>  }
>  
> -void sched_ttwu_pending(void)
> +static void __sched_ttwu_pending(struct rq *rq)
>  {
>  #ifdef CONFIG_SMP
> -	struct rq *rq = this_rq();
>  	struct task_struct *list = xchg(&rq->wake_list, NULL);
>  
>  	if (!list)
>  		return;
>  
> +	rq = this_rq(); /* always enqueue locally */

But it's possible that p is not allowed to run on this cpu,
right?

Thanks,
Yong

>  	raw_spin_lock(&rq->lock);
>  
>  	while (list) {
> @@ -2491,6 +2491,11 @@ void sched_ttwu_pending(void)
>  #endif
>  }
>  
> +void sched_ttwu_pending(void)
> +{
> +	__sched_ttwu_pending(this_rq());
> +}
> +
>  #ifdef CONFIG_SMP
>  static void ttwu_queue_remote(struct task_struct *p, int cpu)
>  {
> @@ -6162,6 +6167,17 @@ migration_call(struct notifier_block *nf
>  		migrate_nr_uninterruptible(rq);
>  		calc_global_load_remove(rq);
>  		break;
> +
> +	case CPU_DEAD:
> +		/*
> +		 * Queue any possible remaining pending wakeups on this cpu.
> +		 * Load-balancing will sort it out eventually.
> +		 */
> +		local_irq_save(flags);
> +		__sched_ttwu_pending(cpu_rq(cpu));
> +		local_irq_restore(flags);
> +		break;
> +
>  #endif
>  	}
>  	return NOTIFY_OK;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ