All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] slip_init and slirp_init using 12K of stack
@ 2006-01-17  0:26 Blaisorblade
  2006-01-17  3:41 ` Jeff Dike
  0 siblings, 1 reply; 3+ messages in thread
From: Blaisorblade @ 2006-01-17  0:26 UTC (permalink / raw)
  To: user-mode-linux-devel

I ran by accident scripts/checkstack.pl and found that slip_init and 
slirp_init are two big offenders.

They are since of such lines:

        *spri = ((struct slip_data)
                { .name         = { '\0' },
                  .addr         = NULL,
                  .gate_addr    = init->gate_addr,
                  .slave        = -1,
                  .slip         = SLIP_PROTO_INIT,
                  .dev          = dev });

This is compiled (as it seems from the assembly, and as I read from a 
discussion on LKML on how badly GCC optimizes that) compiled as "set this up 
on the stack, memcpy it on the stack, and memcpy it on the final area".

struct slip_data (and the same for slirp_data) contains slip_proto, which is 
6K wide (has two large buffers). Having it twice on the stack gives 12k, 
which explains this output:

$ objdump -d
/home/paolo/Admin/kernel/6/VCS/um-linux-2.6.15-build/vmlinux| ./scripts/checkstack.pl 
i386|head -20

0xa021e0a6 _IO_vfwprintf:                               37512
0xa0020d62 slirp_init:                                  12880
0xa0020e8a slirp_init:                                  12880
0xa0020258 slip_init:                                   12112
0xa0020351 slip_init:                                   12112
...
0xa000515c make_umid_setup:                             4144
0xa002bc16 make_tempfile:                               4128
0xa002bd29 make_tempfile:                               4128

(I remember these to store a PATH_MAX char array on the stack). But 
make_umid_setup just disappeared (the rewritten umid abstraction doesn't use 
significant stack space).
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] slip_init and slirp_init using 12K of stack
  2006-01-17  0:26 [uml-devel] slip_init and slirp_init using 12K of stack Blaisorblade
@ 2006-01-17  3:41 ` Jeff Dike
  2006-01-17 14:11   ` Blaisorblade
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Dike @ 2006-01-17  3:41 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-devel

On Tue, Jan 17, 2006 at 01:26:12AM +0100, Blaisorblade wrote:
> I ran by accident scripts/checkstack.pl and found that slip_init and 
> slirp_init are two big offenders.
> 
> They are since of such lines:
> 
>         *spri = ((struct slip_data)
>                 { .name         = { '\0' },
>                   .addr         = NULL,
>                   .gate_addr    = init->gate_addr,
>                   .slave        = -1,
>                   .slip         = SLIP_PROTO_INIT,
>                   .dev          = dev });

Yuck, I guess it's time to initialize that field-by-field.

				Jeff


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] slip_init and slirp_init using 12K of stack
  2006-01-17  3:41 ` Jeff Dike
@ 2006-01-17 14:11   ` Blaisorblade
  0 siblings, 0 replies; 3+ messages in thread
From: Blaisorblade @ 2006-01-17 14:11 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel

On Tuesday 17 January 2006 04:41, Jeff Dike wrote:
> On Tue, Jan 17, 2006 at 01:26:12AM +0100, Blaisorblade wrote:
> > I ran by accident scripts/checkstack.pl and found that slip_init and
> > slirp_init are two big offenders.
> >
> > They are since of such lines:
> >
> >         *spri = ((struct slip_data)
> >                 { .name         = { '\0' },
> >                   .addr         = NULL,
> >                   .gate_addr    = init->gate_addr,
> >                   .slave        = -1,
> >                   .slip         = SLIP_PROTO_INIT,
> >                   .dev          = dev });
>
> Yuck, I guess it's time to initialize that field-by-field.
Yep, done... I'll flush my queue when you're done with yours, there are too 
many conflicts right now. What about getting TLS in in this cycle (after 
-rc1, the freeze is less strict for us in practice)? If yes, I'm going to 
take care at it - I'm cleaning it anyway.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-17 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-17  0:26 [uml-devel] slip_init and slirp_init using 12K of stack Blaisorblade
2006-01-17  3:41 ` Jeff Dike
2006-01-17 14:11   ` Blaisorblade

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.