Re: [PATCH] [1/2] random: SMP locking

From: Andrew Morton (akpm@osdl.org)
Date: Sat Aug 02 2003 - 14:00:23 EST


Matt Mackall <mpm@selenic.com> wrote:
>
> > Are you really sure that all the decisions about where to use spin_lock()
> > vs spin_lock_irq() vs spin_lock_irqsave() are correct? They are
> > non-obvious.
>
> Aside from the put_user stuff below, yes.

Well I see in Linus's current tree:

        ndev->regen_timer.function = ipv6_regen_rndid;

And ipv6_regen_rndid() ends up calling get_random_bytes() which calls
extract_entropy() which now does a bare spin_lock().

So I think if the timer is run while some process-context code on the same
CPU is running get_random_bytes() we deadlock don't we?

Probably, we should make get_random_bytes() callable from any context.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:19 EST