From owner-cvs-all@FreeBSD.ORG Mon Jul 7 22:58:03 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28F9E37B401 for ; Mon, 7 Jul 2003 22:58:03 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id D175143FBD for ; Mon, 7 Jul 2003 22:58:00 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 51557 invoked from network); 8 Jul 2003 05:57:59 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 8 Jul 2003 05:57:59 -0000 X-pair-Authenticated: 209.68.2.70 Date: Tue, 8 Jul 2003 00:57:40 -0500 (CDT) From: Mike Silbersack To: Don Lewis In-Reply-To: <20030708000257.D6158@odysseus.silby.com> Message-ID: <20030708004340.T6733@odysseus.silby.com> References: <200307080457.h684vRM7009343@gw.catspoiler.org> <20030708000257.D6158@odysseus.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern subr_param.c sys_pipe.c src/sys/sys pipe.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2003 05:58:03 -0000 On Tue, 8 Jul 2003, Mike Silbersack wrote: > If I spend more time working on pipes, there are a bunch of other changes > I'll be working on first. > > Mike "Silby" Silbersack Let me explain this statement a little better, as it helps explain why I didn't do per-user limits in the initial commit. As pipes are implemented now (which basically still follows John's original design), for each side of a pipe we allocate: 1 VM object which is linked to 16KB of address space from the kernel map; this is pageable, and acquires backing as it is filled. For large writes which align on page boundaries, the pages are wired into kernel memory, and shown directly to the reading end of the pipe. Naturally, this memory isn't pageable, and is even more important to limit. (However, as stated in my commit message, this _can_ be limited without any nasty sideeffects.) As a result of all this memory usage (which is optimized for performance), and the small size of the kernel map (which I don't think we can expand too much on i386 without running out of KVA), the limit on pipes is far less than our limit on sockets or files. So, there are a few things that could be done to improve our memory usage, thereby allowing the quantity of pipes to grow substantially. 1. Reduce the number of vm objects required, perhaps down to 1. This should reduce the pressure on the vm system. (May be incompatible with how page flipping is done, however.) 2. Reduce the # of actual pages + address space used by pipe writes. It might not be a bad idea to start all pipes as 4K and size and have them grow as larger writes are handed to them. Additionally, the code could be made more aggressive in freeing pages after the read is complete. #1 & #2 would probably best be accomplished by moving pipe storage into a UMA zone once Jeff has the support for pageable backing done. :) 3. Perhaps the page flipping case can be improved so that it does not require wiring the pages in question into the kernel, thereby reducing memory pressure. But anyway, that's just theory, I don't think I'll end up doing any of that. However, if someone is looking for something to do, that might be an interesting project. Mike "Silby" Silbersack