From owner-freebsd-current Wed Aug 15 16:11:57 2001 Delivered-To: freebsd-current@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 33C4337B40A for ; Wed, 15 Aug 2001 16:11:48 -0700 (PDT) (envelope-from julian@elischer.org) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA14234 for ; Wed, 15 Aug 2001 16:00:51 -0700 (PDT) Date: Wed, 15 Aug 2001 16:00:50 -0700 (PDT) From: Julian Elischer To: current@freebsd.org Subject: Kernel stack hogs list available Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I ported the code to allow gcc to report functions that use too much of our 3.4KB kernel stacks. I tried it ou ton a compile of GENERIC. it produced some 360 functions that allocate over 100 bytes on the stack. The list is available at: http://people.freebsd.org/~julian/stack-hogs It's quite interesting reading. I set the limit size to 100 bytes per frame as that seems a reasonable size to do must things. (remember the catch-phrase in teh kernel is "no big structures on the stack") Consider that many functions call each other, and some can even be recursive, I find it easy to believe that some of teh off crashes I've seen over the years may have come from teh 3.5KB being exhusted and the stack wandering into the u-area where results would be 'dodgy' at best. Please take a look and see if any of your pet projects is listed here.. for a quick example here are teh files where over 1K is being allocated on the stack! dev/ata/atapi-cd.c:1804: 2068 byte frame dev/ata/ata-raid.c:524: 2056 byte frame dev/ata/atapi-cd.c:1055: 1756 byte frame net/if_sl.c:778: 1540 byte frame dev/usb/ugen.c:694: 1168 byte frame dev/an/if_an.c:1572: 1112 byte frame dev/wi/if_wi.c:1647: 1096 byte frame dev/usb/usb_subr.c:897: 1088 byte frame kern/imgact_elf.c:668: 1072 byte frame dev/usb/ums.c:358: 1056 byte frame dev/usb/ukbd.c:182: 1048 byte frame dev/awi/awi_wicfg.c:328: 1044 byte frame netinet6/nd6.c:2225: 1040 byte frame dev/usb/uhid.c:252: 1040 byte frame dev/awi/awi_wicfg.c:626: 1040 byte frame dev/usb/uscanner.c:322: 1036 byte frame dev/usb/urio.c:439: 1036 byte frame dev/usb/ulpt.c:333: 1036 byte frame dev/usb/if_cue.c:554: 1036 byte frame dev/usb/if_aue.c:752: 1036 byte frame dev/usb/urio.c:508: 1032 byte frame dev/usb/urio.c:290: 1032 byte frame dev/usb/ugen.c:767: 1032 byte frame dev/wi/if_wi.c:2345: 1028 byte frame dev/wi/if_wi.c:2258: 1028 byte frame dev/usb/umass.c:968: 1028 byte frame dev/usb/ugen.c:228: 1028 byte frame dev/usb/if_kue.c:511: 1028 byte frame netinet6/nd6.c:2151: 1024 byte frame Remember these are only in GENERIC. Julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message