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: <20061213150314.B12795@unix-os.sc.intel.com>
Date:	Wed, 13 Dec 2006 15:03:14 -0800
From:	"Siddha, Suresh B" <suresh.b.siddha@...el.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	"Siddha, Suresh B" <suresh.b.siddha@...el.com>,
	nickpiggin@...oo.com.au, vatsa@...ibm.com, clameter@....com,
	tglx@...utronix.de, arjan@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC] Patch: dynticks: idle load balancing

On Thu, Dec 14, 2006 at 12:13:16AM +0100, Ingo Molnar wrote:
> there's another bug as well: in schedule() resched_cpu() is called with 
> the current runqueue held in two places, which is deadlock potential. 

resched_cpu() was getting called after prepare_task_switch() which
releases the current runqueue lock. Isn't it?

> The easiest fix for this is to use trylock - find the patch for that. 
> This is a hint only anyway - and if a CPU is idle its runqueue will be 

Though I don't see a potential deadlock, I like this optimization.

thanks,
suresh

> lockable. (fixing it via double-locking is easy in the first call site, 
> but the second one looks harder)
> 
> 	Ingo
> 
> Index: linux/kernel/sched.c
> ===================================================================
> --- linux.orig/kernel/sched.c
> +++ linux/kernel/sched.c
> @@ -1167,12 +1167,14 @@ static void resched_task(struct task_str
>  	if (!tsk_is_polling(p))
>  		smp_send_reschedule(cpu);
>  }
> +
>  static void resched_cpu(int cpu)
>  {
>  	struct rq *rq = cpu_rq(cpu);
> -	unsigned int flags;
> +	unsigned long flags;
>  
> -	spin_lock_irqsave(&rq->lock, flags);
> +	if (!spin_trylock_irqsave(&rq->lock, flags))
> +		return;
>  	resched_task(cpu_curr(cpu));
>  	spin_unlock_irqrestore(&rq->lock, flags);
>  }
-
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