Re: Gut crypto_yeild() when CONFIG_PREEMPT is defined?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 14, 2004 at 10:35:03PM -0700, Adam J. Richter wrote:
> --- linux-2.6.7/crypto/internal.h	2004-06-15 22:18:52.000000000 -0700
> +++ linux/crypto/internal.h	2004-07-14 22:20:39.000000000 -0700
> @@ -39,8 +39,10 @@
>  
>  static inline void crypto_yield(struct crypto_tfm *tfm)
>  {
> +#ifndef CONFIG_PREEMPT
>  	if (!in_softirq())
>  		cond_resched();
> +#endif
>  }

Hmm, smells like void crypto_cond_resched(void). How about this?

#ifdef CONFIG_PREEMPT
static inline void crypto_yield(struct crypto_tfm *tfm)
{
	if (!in_softirq() && current->lock_depth == 1) {
		unlock_kernel();
		lock_kernel();
	}
}
#else
static inline void crypto_yield(struct crypto_tfm *tfm)
{
	if (!in_softirq())
		cond_resched();
}
#endif

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux