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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1247237995.7529.43.camel@twins>
Date:	Fri, 10 Jul 2009 16:59:55 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] sched: Move the sleeping while atomic checks early
 in cond_resched()

On Fri, 2009-07-10 at 16:49 +0200, Frederic Weisbecker wrote:

> index 0cb0d8d..e357dc7 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -2279,11 +2279,13 @@ extern int _cond_resched(void);
>  #ifdef CONFIG_PREEMPT_BKL
>  static inline int cond_resched(void)
>  {
> +	might_sleep();
>  	return 0;
>  }
>  #else
>  static inline int cond_resched(void)
>  {
> +	might_sleep();
>  	return _cond_resched();
>  }
>  #endif

# define might_resched() _cond_resched()

# define might_sleep() \
	do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)


Doesn't seem to make it any better that, but yeah, moving that
__might_sleep() did occur to me earlier today when I touched that code.

> diff --git a/kernel/sched.c b/kernel/sched.c
> index 87ecac1..c22804b 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -6605,9 +6605,6 @@ SYSCALL_DEFINE0(sched_yield)
>  
>  static void __cond_resched(void)
>  {
> -#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
> -	__might_sleep(__FILE__, __LINE__);
> -#endif
>  	/*
>  	 * The BKS might be reacquired before we have dropped
>  	 * PREEMPT_ACTIVE, which could trigger a second



--
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