From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 7 03:24:53 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9780E10656AB for ; Tue, 7 Sep 2010 03:24:53 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF168FC0A for ; Tue, 7 Sep 2010 03:24:53 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L8C00700XHGAO00@smtpauth2.wiscmail.wisc.edu> for freebsd-hackers@freebsd.org; Mon, 06 Sep 2010 22:24:52 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.68.10]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L8C005NWXHECS00@smtpauth2.wiscmail.wisc.edu> for freebsd-hackers@freebsd.org; Mon, 06 Sep 2010 22:24:51 -0500 (CDT) Date: Mon, 06 Sep 2010 22:24:49 -0500 From: Nathan Whitehorn In-reply-to: <4C8593E1.5080000@freebsd.org> To: freebsd-hackers@freebsd.org Message-id: <4C85B081.3040100@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.68.10 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.9.7.31215, SenderIP=76.210.68.10 X-Enigmail-Version: 1.0.1 References: <4C8593E1.5080000@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100729 Thunderbird/3.0.6 Subject: Re: PS3 livelock and pmap_remove() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 03:24:53 -0000 On 09/06/10 20:22, Nathan Whitehorn wrote: > Now that my SLB allocation issue is solved, with help with Matthew and > Alan, I have another VM puzzler. > > I have a simple program that tries to use all the memory on the system, > which isn't very much on the PS3, so I use it to test swap as well. > Shortly after it begins paging, the system locks up completely. I > managed to duplicate this behavior on an emulator, and found out what it > is actually doing. Somehow pmap_remove() is being called with arguments > pmap_remove(userpmap, PAGE_SIZE, VM_MAXUSER_ADDRESS = USRSTACK). For > powerpc64, VM_MAXUSER_ADDRESS is 0x7ffffffffffff000, so there are 10^15 > pages to unmap in that range and it was busy taking until the end of > time unmapping them all. > > Here's the trace from KDB: > > moea64_remove() > pmap_remove() > vm_daemon() > fork_exit() > fork_trampoline() > ----end----- > > Does anyone have any idea why this is happening? > > The culprit here is lines 703-706 of vm/vm_pageout.c: if (desired == 0 && nothingwired) { pmap_remove(vm_map_pmap(map), vm_map_min(map), vm_map_max(map)); } It would be much better if it did this in sections, the way vm_map_delete does. I'll take a crack at this, though any suggestions for proper implementation would be appreciated. -nathan