From owner-freebsd-mips@FreeBSD.ORG Wed May 26 13:12:02 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13909106566B for ; Wed, 26 May 2010 13:12:02 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id C0CB78FC1C for ; Wed, 26 May 2010 13:12:01 +0000 (UTC) Received: from gw ([192.168.10.10] helo=terran) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1OHGOL-0001UN-0Z; Wed, 26 May 2010 16:11:25 +0300 Date: Wed, 26 May 2010 16:13:23 +0300 From: Alexandr Rybalko To: "C. Jayachandran" Message-Id: <20100526161323.ea52370a.ray@dlink.ua> In-Reply-To: References: <20100526122719.5f163434.ray@dlink.ua> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-mips@freebsd.org Subject: Re: Fixes to the new pagetable page allocation code. X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 13:12:02 -0000 On Wed, 26 May 2010 15:37:31 +0530 "C. Jayachandran" wrote: >> On Wed, May 26, 2010 at 2:57 PM, Alexandr Rybalko wrote: >> > Hi, >> > >> > On Wed, 26 May 2010 10:33:58 +0530 >> > "C. Jayachandran" wrote: >> > >> >>> The attached patch (also at >> >>> http://people.freebsd.org/~jchandra/for-review/pmap-alloc-page-fix.diff) >> >>> has two fixes for the new pagetable page allocation code, one to >> >>> handle NULL return from the allocating function, and another to call >> >>> VM_WAIT in cases we can wait. It also removes the variable 'req' left >> >>> over from an earlier change. >> >>> >> >>> Please let me know if you have any comments... >> >>> >> >>> JC. >> > >> >>> +    for (;;) { >> >>> +            m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, >> >>> +                PAGE_SIZE, PAGE_SIZE); >> >>> +            if (m != NULL) >> >>> +                    break; >> >>> +            if ((wait & M_WAITOK) == 0) >> >>> +                    return (NULL); >> >>> +            VM_WAIT; >> >>> +    } >> > >> > So under low memory, subsystem will blocked forever if set M_WAITOK? >> > I don`t think is good idea. >> >> This seems to be standard pattern followed for VM_WAIT usage, I had >> checked a few other architectures for the usage. >> >> Unfortunately, I don't have the sufficient background in FreeBSD VM to >> say why it is so. >> >> JC. OK, then looks good to me too :) -- Alexandr Rybalko aka Alex RAY