Re: [PATCH] Make printk lock when appropriate...

Keith Owens (kaos@ocs.com.au)
Sat, 01 Jul 2000 22:49:05 +1000


On Sat, 1 Jul 2000 10:17:50 +0200 (CEST),
Robert de Vries <rhdv@rhdv.cistron.nl> wrote:
>On Sat, 1 Jul 2000, Manfred Spraul wrote:
>> Sorry, but the patch is wrong.
>>
>> "buf" is a static variable, defined in line 28 [printk.c]
>
>However, printk is the only function using it. Why not move it into
>printk? Is 1024 bytes too large for the kernel stack?

You bet your sweet bippy it is too large. With only ~7K of usable
stack, do you really want to grab 1K? Especially when you can go
recursive on error and gobble up 2*1K chunks. What happens when the
stack overflow patch in IKD detects you are running low on stack space
and calls printk to issue a warning?

What about this code instead of spin_lock_irqsave? Pity we do not have
spin_trylock_irqsave();

local_irq_save(flags);
if (!spin_trylock(&console_lock)) {
local_irq_restore(flags);
return(0);
}

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