Hello all, Satyam, This is my second stab at solving the "stack over flow due to dump_strace when close to stack-overflow is detected by do_IRQ" problem. (Hopefully) this patch is creates less noise then the previous one. [snip]- Gilboa --- linux-2.6/kernel/kallsyms.orig 2007-09-15 11:46:54.000000000 +0300 +++ linux-2.6/kernel/kallsyms.c 2007-09-15 21:06:55.000000000 +0300 @@ -306,13 +306,14 @@ int lookup_symbol_attrs(unsigned long ad return lookup_module_symbol_attrs(addr, size, offset, modname, name); } -/* Look up a kernel symbol and return it in a text buffer. */ -int sprint_symbol(char *buffer, unsigned long address) +/* Internal version: + Look up a kernel symbol and module name and return them to the + caller's buffer/namebuf buffers. */ +int __sprint_symbol(char *buffer, char *namebuf, unsigned long address) { - char *modname; - const char *name; unsigned long offset, size; - char namebuf[KSYM_NAME_LEN]; + const char *name; + char *modname; name = kallsyms_lookup(address, &size, &offset, &modname, namebuf); if (!name) @@ -325,14 +326,35 @@ int sprint_symbol(char *buffer, unsigned return sprintf(buffer, "%s+%#lx/%#lx", name, offset, size); } +/* Exported version: + Look up a kernel symbol and return it in a text buffer. */ +int sprint_symbol(char *buffer, unsigned long address) +{ + char namebuf[KSYM_NAME_LEN]; + + return __sprint_symbol(buffer, namebuf, address); +} + +static DEFINE_SPINLOCK(symbol_lock); + /* Look up a kernel symbol and print it to the kernel messages. */ void __print_symbol(const char *fmt, unsigned long address) { - char buffer[KSYM_SYMBOL_LEN]; + /* Use static buffers instead of char array to reduce + stack footprint in i386/4KSTACKS. + Buffers must be protected against re-entry. */ + static char namebuf[KSYM_NAME_LEN]; + static char buffer[KSYM_SYMBOL_LEN]; + unsigned long flags; + - sprint_symbol(buffer, address); + spin_lock_irqsave(&symbol_lock, flags); + + __sprint_symbol(buffer, namebuf, address); printk(fmt, buffer); + + spin_unlock_irqrestore(&symbol_lock, flags); } /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ -
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Andrew Morton | Re: 2.6.23-rc6-mm1 |
| Luciano Rocha | usb hdd problems with 2.6.27.2 |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
