From owner-freebsd-questions Fri Jul 12 08:58:05 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA21274 for questions-outgoing; Fri, 12 Jul 1996 08:58:05 -0700 (PDT) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA21265 for ; Fri, 12 Jul 1996 08:58:01 -0700 (PDT) Received: (from root@localhost) by dyson.iquest.net (8.7.5/8.6.9) id KAA02358; Fri, 12 Jul 1996 10:57:14 -0500 (EST) From: John Dyson Message-Id: <199607121557.KAA02358@dyson.iquest.net> Subject: Re: kernel malloc question To: fqueries@jraynard.demon.co.uk (James Raynard) Date: Fri, 12 Jul 1996 10:57:14 -0500 (EST) Cc: jpbelang@crim.ca, freebsd-questions@freebsd.org In-Reply-To: <199607102232.WAA04010@jraynard.demon.co.uk> from "James Raynard" at Jul 10, 96 10:32:41 pm X-Mailer: ELM [version 2.4 PL24 ME8] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > This is a beginner device driver question: > > The kernel malloc returns physical memory (non swappable), right? > > Yes, all memory used by the kernel is non-pageable, although changing > this is on the wish-list. > Well, actually, you can use kmem_alloc_pageable to get pageable kernel memory. You have to be careful to have process context when page faulting. For a complete implementation of how to do kernel pageable memory, I refer you to the sys_pipe.c in -current. The pipe buffers are pageable. Also, the arg list temporary space in kern_exec is also pageable. You are absolutely right about the malloc() stuff being non-pageable though. Sorry that I have not responded sooner, I read my mail at work, file it and am sometimes rude and forget it it :-(. I apologize. John