login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Gilboa Davara <gilboad@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, September 18, 2007 - 9:00 pm

Hi Gilboa,


On Sat, 15 Sep 2007, Gilboa Davara wrote:

/*
 * ...
 * ...
 */

is the general coding style here ...


ditto.


Hmm, don't we intend to push this array out of the stack too?

+	static char namebuf[KSYM_NAME_LEN];
+	static DEFINE_SPINLOCK(namebuf_lock);

here ?


And you'd need to wrap spin_lock_irqsave()/spin_unlock_irqrestore()
around this call.




Try to keep the declarations of a lock, and the data that it protects,
close together. Since this lock is being used to protect "buffer", it
makes sense to ...



... have it:

+	static DEFINE_SPINLOCK(buffer_lock);

here (note the name that exactly describes what the lock protects).

And the namebuf array isn't required here, it's already there in
sprint_symbol(), which you can call from ...


here ... sprint_symbol() ?


But I still don't much like this :-(

More importantly, if a panic occurs *below* this callchain (and let's
say we ended up in this callchain because somebody put in a dump_stack()
somewhere for debugging purposes), then we'd have a deadlock on our hands,
and nothing gets printed for that panic.

I don't know who maintains this part of kernel code, but you can try
resubmitting (with the changes suggested above) to someone appropriate ...


Satyam
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage., Satyam Sharma, (Tue Sep 18, 9:00 pm)
Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage., Steven Rostedt, (Fri Sep 21, 10:56 am)
speck-geostationary