[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110412235126.63841dfe.shimoda.hiroaki@gmail.com>
Date: Tue, 12 Apr 2011 23:51:26 +0900
From: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>
Cc: Scot Doyle <lkml@...tdoyle.com>,
Stephen Hemminger <shemminger@...tta.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH] inetpeer: reduce stack usage
On Tue, 12 Apr 2011 10:39:40 +0200
Eric Dumazet <eric.dumazet@...il.com> wrote:
> On 64bit arches, we use 752 bytes of stack when cleanup_once() is called
> from inet_getpeer().
>
> Lets share the avl stack to save ~376 bytes.
>
> Before patch :
>
> # objdump -d net/ipv4/inetpeer.o | scripts/checkstack.pl
>
> 0x000006c3 unlink_from_pool [inetpeer.o]: 376
> 0x00000721 unlink_from_pool [inetpeer.o]: 376
> 0x00000cb1 inet_getpeer [inetpeer.o]: 376
> 0x00000e6d inet_getpeer [inetpeer.o]: 376
> 0x0004 inet_initpeers [inetpeer.o]: 112
> # size net/ipv4/inetpeer.o
> text data bss dec hex filename
> 5320 432 21 5773 168d net/ipv4/inetpeer.o
>
> After patch :
>
> objdump -d net/ipv4/inetpeer.o | scripts/checkstack.pl
> 0x00000c11 inet_getpeer [inetpeer.o]: 376
> 0x00000dcd inet_getpeer [inetpeer.o]: 376
> 0x00000ab9 peer_check_expire [inetpeer.o]: 328
> 0x00000b7f peer_check_expire [inetpeer.o]: 328
> 0x0004 inet_initpeers [inetpeer.o]: 112
> # size net/ipv4/inetpeer.o
> text data bss dec hex filename
> 5163 432 21 5616 15f0 net/ipv4/inetpeer.o
>
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
> Cc: Scot Doyle <lkml@...tdoyle.com>
> Cc: Stephen Hemminger <shemminger@...tta.com>
> Cc: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
I couldn't understand that actually cleanup_once() was called
from inet_getpeer() and then the stack overflow was hit,
but this patch surely reduces stack usage.
Reviewed-by: Hiroaki SHIMODA <shimoda.hiroaki@...il.com>
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists