Re: spinlock assertion macros

From: Arnd Bergmann (arnd@bergmann-dalldorf.de)
Date: Fri Jul 12 2002 - 14:24:40 EST


Daniel Phillips wrote:

> Any idea how one might implement NEVER_SLEEPS()? Maybe as:

Why would you want that? AFAICS there are two kinds of "never
sleeping" functions: 1. those that don't sleep but don't care
about it and 2. those that must not sleep because a lock is
held.

For 1. no point marking it because it might change without
being a bug. You also don't want to mark every function
in the kernel SLEEPS() or NEVER_SLEEPS().

For 2. we already have MUST_HOLD(foo) or similar, which implicitly
means it can never sleep. The same is true for functions
with spinlocks or preempt_disable around their body.

        Arnd <><
-
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 : Mon Jul 15 2002 - 22:00:23 EST