Re: [CRYPTO]: Only reschedule if !in_atomic()

From: Herbert Xu
Date: Mon May 23 2005 - 21:22:32 EST


On Mon, May 23, 2005 at 11:28:06PM +0000, Andrew Morton wrote:
>
> This code can cause deadlocks on CONFIG_SMP && !CONFIG_PREEMPT kernels.
>
> Please see http://lkml.org/lkml/2005/3/10/358
>
> You (the programmer) *have* to know what context you're running in before
> doing a voluntary yield. There is simply no way to work this out at
> runtime.

You're right.

Perhaps we should code this into the crypto API instead? For instance,
we can have a tfm flag that says whether we can sleep or not.

Dave & James, What do you think?

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/