Re: On "ratelimit: Use per ratelimit context locking"

From: Stefan Richter
Date: Mon Dec 28 2009 - 21:02:25 EST


Ingo Molnar wrote:
> There used to be a global lock:
>
> static DEFINE_SPINLOCK(ratelimit_lock);
>
> which is now per ratelimit context. The case i was after was to use the
> ratelimit state from NMI context. With NMIs we can lock up if an NMI hits when
> some other code uses the ratelimit code. It's a small but existing race
> window.

Ah, I see.

> OTOH, IRQ context use of printk ratelimit was safe before (and after) this
> commit - so i think your code should be safe too.

Thanks for the explanation; that's reassuring.
--
Stefan Richter
-=====-==--= ==-- ===-=
http://arcgraph.de/sr/
--
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/