From owner-freebsd-current Tue Mar 21 06:13:26 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id GAA20842 for current-outgoing; Tue, 21 Mar 1995 06:13:26 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id GAA20836 for ; Tue, 21 Mar 1995 06:13:20 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id AAA17502; Wed, 22 Mar 1995 00:09:16 +1000 Date: Wed, 22 Mar 1995 00:09:16 +1000 From: Bruce Evans Message-Id: <199503211409.AAA17502@godzilla.zeta.org.au> To: davidg@Root.COM, terry@cs.weber.edu Subject: Re: Why does kern_lkm.c use kmem_alloc()? Cc: current@FreeBSD.org, wollman@halloran-eldar.lcs.mit.edu Sender: current-owner@FreeBSD.org Precedence: bulk >>Virtually, at least initially, so that the loader can load the code >>contiguously in the address space in which it is to run. > Ahh. Yes, kmem_alloc() is the thing to use in this case. I hope nothing depends on the virtually contiguous memory being physically contiguous here. vm_page_alloc_contig() is the thing to use to get physically contiguous memory. >>Oh, and it wants to load the code page aligned. kmem_alloc returns memory >>statring at the start of a page (or at least it used to and does in > Right, it allocates in terms of pages. Garrett should be able to use the >"size" field of modstat to see how much memory each module consumes (plus >whatever is malloc'd). Ordinary malloc() returns page aligned memory for sizes >= one page. I'd like vmstat to show all kernel *alloc()ed memory. Bruce