From owner-freebsd-current Sun Dec 30 5: 2:42 2001 Delivered-To: freebsd-current@freebsd.org Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by hub.freebsd.org (Postfix) with ESMTP id A281537B41A; Sun, 30 Dec 2001 05:02:34 -0800 (PST) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.33 #1) id 16KfdQ-000NBQ-00; Sun, 30 Dec 2001 15:04:16 +0200 From: Sheldon Hearn To: Maxim Konovalov Cc: Poul-Henning Kamp , current@FreeBSD.ORG, chad@FreeBSD.org Subject: Re: Junior Kernel Hacker Task: ccdinit stack usage. In-reply-to: Your message of "Sun, 30 Dec 2001 15:28:23 +0300." <20011230152238.H14718-100000@news1.macomnet.ru> Date: Sun, 30 Dec 2001 15:04:16 +0200 Message-ID: <89119.1009717456@axl.seasidesoftware.co.za> 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 [Chad David copied for last comment in message.] On Sun, 30 Dec 2001 15:28:23 +0300, Maxim Konovalov wrote: > > sys/dev/ccd/ccd.c:ccdinit() has a couple of very large items on > > the stack. > > > > Rewrite ccdinit() to allocate them with MALLOC(9) instead. > > tmppath is a rather big one but I can't find the second item. What > about this patch: I think the others are the partinfo and ccdgeom structures. Note that you don't need to (and shouldn't as per style(9)) initialize tmppath to NULL. Also, your bzero() is unnecessary if you use the M_ZERO flag to MALLOC(9). As an aside, what's the undocumented M_DEVBUF flag for? Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message