From owner-freebsd-current@FreeBSD.ORG Tue Apr 15 07:19:53 2008 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7293106564A for ; Tue, 15 Apr 2008 07:19:53 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from qsrv01ps.mx.bigpond.com (qsrv01ps.mx.bigpond.com [144.140.82.181]) by mx1.freebsd.org (Postfix) with ESMTP id 4D88D8FC20 for ; Tue, 15 Apr 2008 07:19:53 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from nskntotgx02p.mx.bigpond.com ([124.188.162.219]) by nskntmtas04p.mx.bigpond.com with ESMTP id <20080415034408.RGWO26608.nskntmtas04p.mx.bigpond.com@nskntotgx02p.mx.bigpond.com> for ; Tue, 15 Apr 2008 03:44:08 +0000 Received: from areilly.bpa.nu ([124.188.162.219]) by nskntotgx02p.mx.bigpond.com with ESMTP id <20080415034408.UJBN1995.nskntotgx02p.mx.bigpond.com@areilly.bpa.nu> for ; Tue, 15 Apr 2008 03:44:08 +0000 Received: (qmail 96601 invoked by uid 501); 15 Apr 2008 03:43:43 -0000 Date: Tue, 15 Apr 2008 13:43:43 +1000 From: Andrew Reilly To: Roman Divacky Message-ID: <20080415034343.GB87024@duncan.reilly.home> References: <48002444.4030505@elischer.org> <20080412191300.E7693@fledge.watson.org> <20080412181601.GA14472@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080412181601.GA14472@freebsd.org> User-Agent: Mutt/1.4.2.3i X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150205.48042488.0046,ss=1,fgs=0 Cc: Robert Watson , Julian Elischer , FreeBSD Current Subject: Re: stack hogs in kernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 07:19:53 -0000 On Sat, Apr 12, 2008 at 08:16:01PM +0200, Roman Divacky wrote: > On Sat, Apr 12, 2008 at 07:14:21PM +0100, Robert Watson wrote: > > > > On Fri, 11 Apr 2008, Julian Elischer wrote: > > > > >0xc05667e3 kldstat [kernel]: 2100 > > >0xc07214f8 sendsig [kernel]: 1416 > > >0xc04fb426 ugenread [kernel]: 1200 > > >0xc070616b ipmi_smbios_identify [kernel]: 1136 > > >0xc050bd26 usbd_new_device [kernel]: 1128 > > >0xc0525a83 pfs_readlink [kernel]: 1092 > > >0xc04fb407 ugenwrite [kernel]: 1056 > > >0xc055ea33 prison_enforce_statfs [kernel]: 1044 > > > > This one, at least, is due to an issue Roman pointed out on hackers@ in the > > last 24 hours -- a MAXPATHLEN sized buffer on the stack. Looks like > > pfs_readlink() has the same issue. > > I plan to look at some of the MAXPATHLEN usage... I guess we can shave a few > tens of KBs from the kernel (static size and runtime size). Why are single-digit kilobytes of memory space interesting, in this context? Is the concern about L1 data cache footprint, for performance reasons? If that is the case, the MAXPATHLEN bufffer will only really occupy the amount of cache actually touched. I've long wondered about the seemingly fanatical stack size concern in kernel space. In other domains (where I have more experience) you can get good performance benefits from the essentially free memory management and good cache re-use that comes from putting as much into the stack/call-frame as possible. Just curious. Cheers, -- Andrew