From owner-freebsd-current Thu Feb 4 19:15:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA14113 for freebsd-current-outgoing; Thu, 4 Feb 1999 19:15:32 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from iquest3.iquest.net (iquest3.iquest.net [209.43.20.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA14107 for ; Thu, 4 Feb 1999 19:15:31 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 10624 invoked from network); 5 Feb 1999 03:15:26 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 5 Feb 1999 03:15:26 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id WAA00836; Thu, 4 Feb 1999 22:15:16 -0500 (EST) Message-Id: <199902050315.WAA00836@y.dyson.net> Subject: Re: swap_page_getswapspace failed (don't do stupid things with /dev/mem) In-Reply-To: <199902021706.JAA36791@apollo.backplane.com> from Matthew Dillon at "Feb 2, 99 09:06:37 am" To: dillon@apollo.backplane.com (Matthew Dillon) Date: Thu, 4 Feb 1999 22:15:16 -0500 (EST) Cc: robert@cyrus.watson.org, current@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon said: > :Matt, > : > :Does datasize limit the number of backed pages, or the amount of address > :space used by a process? I.e., can I grow myself a large chunk of address > :space using mmap to the same region of a file, and then read into that > :large chunk (presumably larger than the cache size if I want to be nasty)? > :If datasize only affects backed pages, then we can still do nasty large > :copies; if it affects address space, then nasty large copies are limited > :to the size of the writable address space (if using readv) or the size of > :the largest contiguous writable space (if using read). > : > : Robert N Watson > : > :robert@fledge.watson.org http://www.watson.org/~robert/ > :PGP key fingerprint: 03 01 DD 8E 15 67 48 73 25 6D 10 FC EC 68 C1 1C > > The 'datasize' limit does not effect mmap(), only brk/sbrk. So, > in fact, I believe you can bypass the datasize limit by allocating > anonymous memory using mmap(). > > This is probably a bug. We should either limit the mmap()able space to > about the same size as the data segment limit, or keep track of the > amount of anonymous mapped memory and count that in the datasize > limit. > FYI, the information that provides the virtual space used by a map (process) is in the vm_map data structure (so you don't need to reinvent it.) It is now used by PS also. -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message