From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 14 20:38:09 2007 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 7D24F16A473 for ; Wed, 14 Nov 2007 20:38:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 2666F13C4C4 for ; Wed, 14 Nov 2007 20:38:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 219323145-1834499 for multiple; Wed, 14 Nov 2007 15:38:53 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id lAEKbwov072725; Wed, 14 Nov 2007 15:37:58 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 14 Nov 2007 15:31:40 -0500 User-Agent: KMail/1.9.6 References: <473B1E3D.30500@charter.net> In-Reply-To: <473B1E3D.30500@charter.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711141531.40481.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 14 Nov 2007 15:37:58 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/4790/Wed Nov 14 13:13:53 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Rob Belics Subject: Re: FreeBSD cache memory allocation 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: Wed, 14 Nov 2007 20:38:09 -0000 On Wednesday 14 November 2007 11:11:41 am Rob Belics wrote: > Someone I can't stand said this about FreeBSD. Though I know C, I don't > know anything about this and would love to respond. My first thought was > 'contigmalloc' but I'm not sure it's equivalent. > [QUOTE]The kernel is really lacking some features. They need a method to > set precise type of memory cache but BSD doesn't provide way to specify > memory cache. > > For that reason MS has the beautiful > MmAllocateContigousMemorySpecifyCache()[/QUOTE] For kernel memory on i386 and amd64 in 6.3 and later you can use pmap_change_attr() to adjust the caching mode of memory after you have allocated it. It is best used only with allocations that are a multiple of the page size. -- John Baldwin