Re: [patch 4/4] increase traffic on linux-kernel

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu Sep 26 2002 - 20:31:17 EST


In article <3D928864.23666D93@digeo.com>,
Andrew Morton <akpm@digeo.com> wrote:
>
>Infrastructure to detect sleep-inside-spinlock bugs. Really only
>useful if compiled with CONFIG_PREEMPT=y. It prints out a whiny
>message and a stack backtrace if someone calls a function which might
>sleep from within an atomic region.

This is in my BK tree now, along with Ingo's symbolic backtraces, which
makes it possibly less tedious to read the output.

I would suggest that all developers for a while run with

        CONFIG_PREEMPT=y
        CONFIG_DEBUG_KERNEL=y
        CONFIG_KALLSYMS=y

and see if something shows up in their subsystem (but be careful about
the backtraces, since they often contain old crud, especially since gcc
does a horrible job at keeping the stack together and thus leaves unused
"holes" in the stack frame which then show old and stale info).

It shows clearly that at least the sound PCM code does locking
completely the wrong way around, apparently at least partly because of
bad abstraction macros that hide the fact that some locks are semaphores
and others are spinlocks.

[ Rant: abstraction like this is _bad_, for christ sake! Don't hide what
  locks you're using just to make the code look simpler. Hint: trying
  to do a "down()" within a spinlock is stupid and not produtive. ]

Thanks,

                Linus
-
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 Sep 30 2002 - 22:00:29 EST