From owner-svn-src-head@FreeBSD.ORG Thu May 27 10:05:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16591065677; Thu, 27 May 2010 10:05:40 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9065F8FC1A; Thu, 27 May 2010 10:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4RA5ewY032271; Thu, 27 May 2010 10:05:40 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4RA5eVu032269; Thu, 27 May 2010 10:05:40 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201005271005.o4RA5eVu032269@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 27 May 2010 10:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208589 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 10:05:40 -0000 Author: jchandra Date: Thu May 27 10:05:40 2010 New Revision: 208589 URL: http://svn.freebsd.org/changeset/base/208589 Log: Call VM_WAIT in pmap_ptpgzone_allocf() if M_WAITOK is set. Removed unused variable. Approved by: rrs (mentor) Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu May 27 08:21:52 2010 (r208588) +++ head/sys/mips/mips/pmap.c Thu May 27 10:05:40 2010 (r208589) @@ -969,10 +969,15 @@ pmap_ptpgzone_allocf(uma_zone_t zone, in ("pmap_ptpgzone_allocf: invalid allocation size %d", bytes)); *flags = UMA_SLAB_PRIV; - m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, - PAGE_SIZE, PAGE_SIZE); - if (m == NULL) - return (NULL); + 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; + } paddr = VM_PAGE_TO_PHYS(m); return ((void *)MIPS_PHYS_TO_KSEG0(paddr)); @@ -1039,8 +1044,10 @@ pmap_pinit(pmap_t pmap) * allocate the page directory page */ ptdpg = pmap_alloc_pte_page(pmap, NUSERPGTBLS, M_WAITOK, &ptdva); - pmap->pm_segtab = (pd_entry_t *)ptdva; + if (ptdpg == NULL) + return (0); + pmap->pm_segtab = (pd_entry_t *)ptdva; pmap->pm_active = 0; pmap->pm_ptphint = NULL; for (i = 0; i < MAXCPU; i++) { @@ -1062,13 +1069,11 @@ _pmap_allocpte(pmap_t pmap, unsigned pte { vm_offset_t pteva; vm_page_t m; - int req; KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - req = VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ; /* * Find or fabricate a new pagetable page */