From owner-cvs-all Sat Jun 6 05:30:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA29152 for cvs-all-outgoing; Sat, 6 Jun 1998 05:30:28 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA29145 for ; Sat, 6 Jun 1998 05:30:26 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id FAA14605; Sat, 6 Jun 1998 05:28:56 -0700 (PDT) Message-Id: <199806061228.FAA14605@implode.root.com> To: John Hay cc: cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/sys/vm vm_kern.c From: David Greenman Reply-To: dg@root.com Date: Sat, 06 Jun 1998 05:28:56 -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > It's not that we "keep a limit". The limit is imposed by physical space >constraints in the kernel, specifically the size of the "mb_map" VM map. > The total virtual address space available to the kernel is a limited >resource and it's critical and required that one must do a juggling act >to fit it all in. One cannot just arbitrarily create a huge map so that >near boundless amounts of networking buffers can be allocated; this would >lose on systems that don't need large numbers of network buffers but do >need the space for something else. As a way of reducing the problem, one >could increase the total kernel VA space (and thus give more room to the >individual maps that are allocated from it), but due to bizzare reasons >that of no fault of ours, this would break binary compatibility with BSDI's >BSD/OS. There is one thing I forgot to mention in the above which is necessary before being able to understand the entire problem. The nature of the networking code, specifically the need to allocate memory in an interrupt context, adds additional constraints on how the allocator must work. More specifically, the virtual address space for the allocations must be set aside at system startup time, and for other reasons, can't be extended later. I'll offer this analogy: Imagine the kernel's memory space us a picture that will be made into a puzzle. Once the pieces have been cut, they become autonomous. All one can do is further divide them into smaller pieces. Such is the case with the various kernel maps. One might ask, 'why do we have maps in the first place - why not just make all of the kernel VA space one giant play area?'. The reason we have maps is to group similar allocations into distinct areas, usually to reduce virtual address space fragmentation, but in some instances to also provide controlled access to the area. Such is the case with the mb_map - it's necessary to protect all manipulations of it with spl protection so that the virtual allocations can be done in a device driver interrupt context as well as from other parts of the networking code. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message