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] [day] [month] [year] [list]
Message-ID: <20150507173228.GA28383@home.goodmis.org>
Date:	Thu, 7 May 2015 13:32:28 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
Cc:	kpreempt-tech@...ts.sourceforge.net,
	Peter Zijlstra <peterz@...radead.org>,
	Robert Love <rml@...h9.net>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] sched/preempt: fix cond_resched_lock() and
 cond_resched_softirq()

On Thu, May 07, 2015 at 08:06:47PM +0300, Konstantin Khlebnikov wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index fe22f7510bce..087bf36ecd46 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4223,7 +4223,7 @@ SYSCALL_DEFINE0(sched_yield)
>  
>  int __sched _cond_resched(void)
>  {
> -	if (should_resched()) {
> +	if (should_resched(0)) {
>  		preempt_schedule_common();
>  		return 1;
>  	}
> @@ -4241,7 +4241,7 @@ EXPORT_SYMBOL(_cond_resched);
>   */
>  int __cond_resched_lock(spinlock_t *lock)
>  {
> -	int resched = should_resched();
> +	int resched = should_resched(PREEMPT_LOCK_OFFSET);

Hmm, yeah, the current code would have should_resched() always return false.

>  	int ret = 0;
>  
>  	lockdep_assert_held(lock);
> @@ -4263,7 +4263,7 @@ int __sched __cond_resched_softirq(void)
>  {
>  	BUG_ON(!in_softirq());
>  
> -	if (should_resched()) {
> +	if (should_resched(SOFTIRQ_DISABLE_OFFSET)) {

Here too.

-- Steve

>  		local_bh_enable();
>  		preempt_schedule_common();
>  		local_bh_disable();
> 
> --
> 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/
--
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