From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 12 18:37:54 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F30F816A4CE for ; Tue, 12 Apr 2005 18:37:53 +0000 (GMT) Received: from marlena.vvi.at (marlena.vvi.at [208.252.225.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3429F43D5A for ; Tue, 12 Apr 2005 18:37:52 +0000 (GMT) (envelope-from www@marlena.vvi.at) Received: from marlena.vvi.at (localhost.marlena.vvi.at [127.0.0.1]) by marlena.vvi.at (8.12.10/8.12.9) with ESMTP id j3CIc0h3022761; Tue, 12 Apr 2005 11:38:04 -0700 (PDT) (envelope-from www@marlena.vvi.at) Received: (from www@localhost) by marlena.vvi.at (8.12.10/8.12.10/Submit) id j3CIbqnh022760; Tue, 12 Apr 2005 11:37:52 -0700 (PDT) (envelope-from www) Date: Tue, 12 Apr 2005 11:37:52 -0700 (PDT) Message-Id: <200504121837.j3CIbqnh022760@marlena.vvi.at> To: marcolz@stack.nl From: "ALeine" cc: des@des.no cc: killing@multiplay.co.uk cc: freebsd-hackers@freebsd.org Subject: Re: kernel killing processes when out of swap X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2005 18:37:54 -0000 marcolz@stack.nl wrote: > On Tue, Apr 12, 2005 at 06:46:45PM +0200, Dag-Erling Smrgrav > wrote: > > There is no "large process detection". The first process that > > tries to fault in a new page after the system runs out of swap > > gets killed. > > Are you suggesting that vm_pageout_pmap_collect() is no longer in > use ? > > That has a FOREACH_PROC_IN_SYSTEM(p) ... find biggest unlocked > ... > kill-kill-kill... The largest process gets killed in vm_pageout_scan() according to the latest sources: http://fxr.watson.org/fxr/source/vm/vm_pageout.c#L1168 1168 /* 1169 * If we are critically low on one of RAM or swap and low on 1170 * the other, kill the largest process. However, we avoid 1171 * doing this on the first pass in order to give ourselves a 1172 * chance to flush out dirty vnode-backed pages and to allow 1173 * active pages to be moved to the inactive queue and reclaimed. 1174 * 1175 * We keep the process bigproc locked once we find it to keep anyone 1176 * from messing with it; however, there is a possibility of 1177 * deadlock if process B is bigproc and one of it's child processes 1178 * attempts to propagate a signal to B while we are waiting for A's 1179 * lock while walking this list. To avoid this, we don't block on 1180 * the process lock but just skip a process if it is already locked. 1181 */ http://fxr.watson.org/fxr/source/vm/vm_pageout.c?v=RELENG4#L1112 1112 /* 1113 * If we are out of swap and were not able to reach our paging 1114 * target, kill the largest process. 1115 */ ALeine ___________________________________________________________________ WebMail FREE http://mail.austrosearch.net