From owner-freebsd-hackers Wed Oct 3 12:22:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.121.50]) by hub.freebsd.org (Postfix) with ESMTP id 977BA37B406 for ; Wed, 3 Oct 2001 12:22:32 -0700 (PDT) Received: from dialup-209.245.142.238.dial1.sanjose1.level3.net ([209.245.142.238] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.32 #2) id 15orb5-0002SU-00; Wed, 03 Oct 2001 12:22:23 -0700 Message-ID: <3BBB65A0.65FE804B@mindspring.com> Date: Wed, 03 Oct 2001 12:23:12 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Dwayne.MacKinnon@xwave.com Cc: freebsd-hackers@freebsd.org Subject: Re: Memory allocation question References: <3BBA29C0.5E125DAF@xwave.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dwayne wrote: > I'm creating an app where I want to use memory to store data so I > can get at it quickly. The problem is, I can't afford the delays that > would occur if the memory gets swapped out. Is there any way in FreeBSD > to allocate memory so that the VM system won't swap it out? Allocate it at boot time in machdep.c; that's one way, but that's mostly for use in the kernel (though you could set the PG_U bit on the pages, which would double map them in both the kernel and all user space processes. Another way is to put it in a System V shared memory segment, and set the sysctl option that wires it down. Have you read the madvise() man page? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message