Date: Mon, 6 Jan 2003 22:42:50 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: arch@freebsd.org Subject: uarea/kstack/pcb/swapout sillyness Message-ID: <20030106220745.Q2670-100000@gamplex.bde.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030106220745.Q2670-100000>