Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-06 Thread Joe Perches
On Wed, 2007-12-05 at 16:01 -0800, Andrew Morton wrote: > No, I think print_hex_dump() is too low-level to be doing allocations. > For example, one could easily choose to call print_hex_dump() at oops time, > and then what happens if we oops in kmalloc() (as we often do...)? > > You could trim li

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Andrew Morton
On Thu, 6 Dec 2007 00:58:38 -0500 Kyle Moffett <[EMAIL PROTECTED]> wrote: > On Dec 05, 2007, at 21:42:35, Joe Perches wrote: > > On Wed, 2007-12-05 at 18:18 -0800, Randy Dunlap wrote: > >> Joe Perches wrote: > >>> Maybe just eliminate the 16 or 32 byte width option and force it > >>> to only 16

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Kyle Moffett
On Dec 05, 2007, at 21:42:35, Joe Perches wrote: On Wed, 2007-12-05 at 18:18 -0800, Randy Dunlap wrote: Joe Perches wrote: Maybe just eliminate the 16 or 32 byte width option and force it to only 16 byte widths. Have you checked users (callers)? I'm pretty sure that one of the callers wante

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Joe Perches
On Wed, 2007-12-05 at 18:18 -0800, Randy Dunlap wrote: > Joe Perches wrote: > > Maybe just eliminate the 16 or 32 byte width option and > > force it to only 16 byte widths. > Have you checked users (callers)? I'm pretty sure that one of the > callers wanted 32 and that's why it's there. I did. T

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Randy Dunlap
Joe Perches wrote: On Wed, 2007-12-05 at 16:01 -0800, Andrew Morton wrote: You could trim linebuf[] to 80 chars or so. Extra points for making it very clear when someone tries to exceed that - strcpy(linebuf, "stop being stupid"). Maybe just eliminate the 16 or 32 byte width option and force

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Joe Perches
On Wed, 2007-12-05 at 16:01 -0800, Andrew Morton wrote: > You could trim linebuf[] to 80 chars or so. Extra points for making it > very clear when someone tries to exceed that - strcpy(linebuf, "stop being > stupid"). Maybe just eliminate the 16 or 32 byte width option and force it to only 16 byt

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-12-05 Thread Andrew Morton
On Thu, 29 Nov 2007 15:28:42 -0800 Joe Perches <[EMAIL PROTECTED]> wrote: > On Thu, 2007-11-29 at 22:07 +0100, Jan Engelhardt wrote: > > I'd add GFP_ATOMIC here. Who knows whether tomorrow, the oops dumper > > or warn_on will use print_hex_dump. > > Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-11-29 Thread Joe Perches
On Thu, 2007-11-29 at 22:07 +0100, Jan Engelhardt wrote: > I'd add GFP_ATOMIC here. Who knows whether tomorrow, the oops dumper > or warn_on will use print_hex_dump. Signed-off-by: Joe Perches <[EMAIL PROTECTED]> diff --git a/lib/hexdump.c b/lib/hexdump.c index 70e23fb..be94934 100644 --- a/lib/h

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-11-29 Thread Jan Engelhardt
On Nov 29 2007 13:02, Randy Dunlap wrote: >> @@ -140,13 +140,20 @@ EXPORT_SYMBOL(hex_dump_to_buffer); >> * Example output using %DUMP_PREFIX_ADDRESS and 4-byte mode: >> * 88089af0: 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~. >> */ >> + >> +#define HEX_LINE_SIZE 200 >> + >>

Re: [PATCH] Reduce stack used by lib/hexdump.c

2007-11-29 Thread Randy Dunlap
Joe Perches wrote: 200 bytes on stack might be a bit much. Size goes up to textdata bss dec hex filename 1142 0 01142 476 lib/hexdump.o Without the WARN_ON 1053 0 01053 41d lib/hexdump.o Before this patch 1004 0 0

[PATCH] Reduce stack used by lib/hexdump.c

2007-11-29 Thread Joe Perches
200 bytes on stack might be a bit much. Size goes up to textdata bss dec hex filename 1142 0 01142 476 lib/hexdump.o Without the WARN_ON 1053 0 01053 41d lib/hexdump.o Before this patch 1004 0 01004 3ec lib/hex