Yesss. May I suggest simply SLEEPS()? (Chances are, we know it's a
function.)
> This macro then checks whether we're currently holding any
> locks, and if so printk's the names of locks held, and where they were taken.
And then oopes?
> When I came up with the idea[1] I envisioned some linked-lists frobbing,
> but in more recent times, we can now check the preempt_count for a
> quick-n-dirty implementation (without the additional info of which locks
> we hold, lock-taker, etc).
Spin_lock just has to store the address/location of the lock in a
per-cpu vector, and the assert prints that out when it oopses. Such
bugs won't live too long under those conditions.
Any idea how one might implement NEVER_SLEEPS()? Maybe as:
NEVER_ [code goes here] _SLEEPS
which inc/dec the preeempt count, triggering a BUG in schedule().
-- Daniel - 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/