From owner-freebsd-arch Mon Jan 6 3:42:36 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1221537B401 for ; Mon, 6 Jan 2003 03:42:35 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BDA043EB2 for ; Mon, 6 Jan 2003 03:42:33 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA30703 for ; Mon, 6 Jan 2003 22:42:26 +1100 Date: Mon, 6 Jan 2003 22:42:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: arch@freebsd.org Subject: uarea/kstack/pcb/swapout sillyness Message-ID: <20030106220745.Q2670-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kernel stack pages don't seem to be handled by vm_proc_swap{in,out}. Only the upages are swapped. This makes having a user area separate from the proc struct even less useful than it used to be. We have considerable complications to support the dubious feature of swapping the user area. Swapping it out saves a whole 1 page per process (UAREA_PAGE is 1 for all arches). OTOH, we don't bother swapping out the much larger kernel stacks. There are 4 pages per stack on some arches and there may be multiple stacks per process (1 per thread). Having a separate user area actually wastes memory in the usual (?) case where the user area is not swapped. The user area now contains only struct sigacts, which has size 2688, and struct pstats, which has size 224, so 4096 - 2688 - 224 = 1184 bytes per process is wasted for the struct (not counting costs for indirections). There seems to be even less point to keeping the pcb separate from the thread struct. It saves space only by stealing stack space, and costs indirections. Some PS_INMEM checks are now bogus because the pcb is not in the user area so it doesn't get swapped. I use "options NO_SWAPPING" to prevent swapping of upages, and would like to make this the default and later remove its code and merge the structs. Swapping of upages seems to be least useful on large systems where it would save the most memory, since such systems might actually want to spend time running the processes instead of swapping the them see the long message for the commit that introduced NO_SWAPPING in 1996). With today's larger memories and bloated processes and kernel stacks, I think the space/time savings (positive or negative) don't matter and we just have useless complications to swap upages. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message