From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 12 17:52:10 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 482C91065692 for ; Thu, 12 Feb 2009 17:52:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2373B8FC1D for ; Thu, 12 Feb 2009 17:52:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B942246B53; Thu, 12 Feb 2009 12:52:09 -0500 (EST) Date: Thu, 12 Feb 2009 17:52:09 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ed Schouten In-Reply-To: <20090212163344.GR79178@hoeg.nl> Message-ID: References: <200902121717.47841.max@love2party.net> <20090212163344.GR79178@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD Hackers Subject: Re: pahole - Finding holes in kernel structs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 17:52:10 -0000 On Thu, 12 Feb 2009, Ed Schouten wrote: > * Max Laier wrote: >> So to answer your first question, submitting 101 patches to rearrange 101 >> structs is certainly a wasted effort. However, if you take a good look at the >> 2000 holes, identify an interesting subset and submit a patch to fix that >> subset ... that would be a worthwhile effort ... IMHO. > > I guess it's also a wasted effort to reduce struct tty from 8xx to 7xx > bytes, because it still allocates 1024 bytes of memory using malloc(9). I > guess we should mainly focus on structures that are allocated using uma(9) > or are slightly bigger than 2^n. There are two things we can do: we can allocate using a specific UMA zone, but we could also retune our malloc buckets to waste less space while avoiding commiting memory to specific types where it's unhelpful (when UMA is used, we populate caches of pre-initialized instances, so we don't want to use UMA for things allocated, say, six times). Robert N M Watson Computer Laboratory University of Cambridge