From owner-cvs-src@FreeBSD.ORG Sun Jul 13 22:16:24 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0579437B404; Sun, 13 Jul 2003 22:16:23 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1BEF43F93; Sun, 13 Jul 2003 22:16:21 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h6E5GFLv027909; Sun, 13 Jul 2003 22:16:16 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h6E5GCxx027908; Sun, 13 Jul 2003 22:16:12 -0700 (PDT) (envelope-from das@FreeBSD.org) Date: Sun, 13 Jul 2003 22:16:12 -0700 From: David Schultz To: Bosko Milekic Message-ID: <20030714051612.GA27609@HAL9000.homeunix.com> Mail-Followup-To: Bosko Milekic , "Alan L. Cox" , Mike Silbersack , Don Lewis , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org References: <200307080457.h684vRM7009343@gw.catspoiler.org> <20030708000257.D6158@odysseus.silby.com> <20030708004340.T6733@odysseus.silby.com> <3F0B199E.A3C980D2@imimic.com> <20030710182436.GA6484@HAL9000.homeunix.com> <3F0DBC39.891A91A@imimic.com> <20030710153734.GA1101@technokratis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030710153734.GA1101@technokratis.com> cc: "Alan L. Cox" cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: Mike Silbersack cc: Don Lewis 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-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 05:16:24 -0000 On Thu, Jul 10, 2003, Bosko Milekic wrote: > > On Thu, Jul 10, 2003 at 02:19:21PM -0500, Alan L. Cox wrote: > [...] > > > That would alleviate the KVA pressure, since the mapping would be > > > very temporary and you could even get away with just a single > > > page. However, it would still tie up the associated physical > > > memory until the pipe is read, which may not be soon at all. Is > > > there a reason for the memory to be wired, other than that the > > > data is easier to track down while the sending process' PTEs are > > > still there? I would expect that you could instead just look up > > > the appropriate vm_object and lazily fault in the appropriate pages > > > on the receiver's side, modulo a few details such as segfault handling. > > > But perhaps I'm missing something... > > > > It's a matter of priorities. With the growth trend in physical memory > > sizes (and PAE), I see more problems due to KVA pressure than > > unnecessarily wired memory. A recent, and fairly visible example, was > > the vnode autosizing problems that had to be fixed prior to 5.1-RELEASE. > > With the recent bug reporting regarding kmem_map being too small > coming in, I'd have to say that I agree with that assertion. Address > space has become more expensive than memory, at least on ia32, and > it's gotten to the point where we need to re-evaluate some of our > autosizing and max size constants (for example, see VM_KMEM_SIZE_MAX). /me returns from vaction to a flood of email. phk's proposal to decouple the buffer cache from the kernel address space will probably be a great help here, but you're right that VM_KMEM_SIZE_MAX should be reevaluated. It doesn't make sense to have kmem_map and mb_map capped in the 200MB range when you've configured 2 GB of KVA and have 4 GB of physical memory. Do you think a default max of half of KVA would make sense? As for priorities, it's true that more people are hitting KVA limits, not physical memory limits. On the other hand, I tend to view the KVA limitation as a temporary problem (at least in the mainstream PC and server markets) and physical memory limitations as a permanent problem. I expect most of the people who are hitting those limits today will be using 64-bit architectures within the next 4 years, and that's before FreeBSD 6.0 will be ready. So yes, some work on KVA issues is needed right now, but we don't need an industrial-strength solution that involves rewriting FreeBSD as a microkernel. ;-) On the other hand, physical memory is cheap enough that it may not be worth bothering over a few wired pages. Alan is probably right; the wired memory for large pipe writes may amount to very little. It's certainly true that it no longer makes sense to be stingy about memory, and yet sloppiness doesn't fly either. The reason for having pageable memory in the first place is that people will always want to solve problems that are larger than the amount of memory they have. But as I've admitted, large pipes---even if they aren't consumed immediately---probably don't amount to much wired memory. Actually, pipes could be the least of our worries in terms of both KVA and wired memory. >>> Start reading here <<< So philosophizing aside, pushing the pmap_qenter() into the receiver sounds like a deceptively simple and perfectly reasonable optimization.