public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Satyam Sharma <satyam@infradead.org>
Cc: Gilboa Davara <gilboad@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Reduce __print_symbol/sprint_symbol stack usage.
Date: Wed, 19 Sep 2007 15:25:15 +0100	[thread overview]
Message-ID: <46F1314B.8040105@grupopie.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0709190610540.26241@enigma.security.iitk.ac.in>

Satyam Sharma wrote:
> On Sat, 15 Sep 2007, Gilboa Davara wrote:
>>  	printk(fmt, buffer);
>> +
>> +	spin_unlock_irqrestore(&symbol_lock, flags);
> 
> But I still don't much like this :-(

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."

  reply	other threads:[~2007-09-19 14:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-15 11:35 [Minor patch] Reduce __print_symbol/sprint_symbol stack usage Gilboa Davara
2007-09-15 13:02 ` Satyam Sharma
2007-09-15 15:15   ` Gilboa Davara
2007-09-15 18:08     ` [PATCH] " Gilboa Davara
2007-09-19  1:00       ` Satyam Sharma
2007-09-19 14:25         ` Paulo Marques [this message]
2007-09-21 12:45           ` Gilboa Davara
2007-09-21 14:21             ` Paulo Marques
2007-09-21 14:57               ` Gilboa Davara
2007-09-21 14:56           ` Steven Rostedt
2007-09-21 15:47             ` Paulo Marques
2007-09-21 12:31         ` Gilboa Davara
2007-09-21 14:28       ` [PATCH] Reduce __print_symbol/sprint_symbol stack usage. (v3) Gilboa Davara
2007-09-21 16:02         ` Paulo Marques
2007-09-21 16:19           ` Gilboa Davara
2007-09-21 14:47 ` [Minor patch] Reduce __print_symbol/sprint_symbol stack usage Steven Rostedt
2007-09-21 14:53   ` Gilboa Davara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F1314B.8040105@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=gilboad@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=satyam@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox