Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Satyam Sharma <satyam@...>
Cc: Gilboa Davara <gilboad@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Wednesday, September 19, 2007 - 10:25 am

Satyam Sharma wrote:

I must say I agree with Satyam here.

Locking in the panic path might leave us without some critical debug 
information, which is much more important than all this.

Maybe it would be better to change the print_symbol interface to avoid 
having a "char buffer[KSYM_SYMBOL_LEN];" at all.

Most print_symbol callers use something like "yada yada %s" as the 
format string, with an optional "\n" in the end.

if we change the interface from "print_symbol(fmt, addr)" to 
"print_symbol(prefix, addr, int newline)" we can simply do:

printk(prefix);
printk_symbol(addr);
if (newline)
	printk("\n");

where "printk_symbol" is a new function that does the same as 
sprint_symbol, but does "printk" instead of "sprintf".

This should reduce immensely the stack usage of print_symbol without the 
need for locking.

Of course this requires changing _all_ callers of print_symbol to use 
the new interface, but these are less than 100 ;)

Comments?

-- 
Paulo Marques - www.grupopie.com

"You're just jealous because the voices only talk to me."
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage., Paulo Marques, (Wed Sep 19, 10:25 am)
Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage., Steven Rostedt, (Fri Sep 21, 10:56 am)