From owner-freebsd-mips@FreeBSD.ORG Tue Jun 8 04:07:30 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C694B1065676; Tue, 8 Jun 2010 04:07:30 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 56AFF8FC08; Tue, 8 Jun 2010 04:07:30 +0000 (UTC) Received: by vws4 with SMTP id 4so3052837vws.13 for ; Mon, 07 Jun 2010 21:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=o012yGSwoqZdSldTKjmi3vo06v9wTC8YW22yZmdJX/U=; b=czE985MbNSVXZ5WtP3XxBr3crx+Rg8zGNn+Qk7cr6xngE3CBFAfwaN7SVfbwGXuZAu /snM4DqliUIbjDW1dYGQvB0ylM7FvF+E7ma1qJFnjP34TMc/PWx8FyCuKP8TzxUaEvCm pB0fO2kTxxVFA8zDBWolTUSPjhe2X91hWexaw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=o1uti1jNuLKgz4/Qtcyq9l1lOUnbpYouwfL7xPo+RdZw4f7OubWVthdp9GqMScrOCi yxQvr3RRi6NF9ttA9plSdWmrw8kS1JDHTo1uohoZqd7h/9GWN2YIBScfF6z+SZ/3SQjI SdJXyKm+UOqBBdvF78C2Ge3X4F+vLfcMkgBl8= MIME-Version: 1.0 Received: by 10.224.87.169 with SMTP id w41mr9572124qal.292.1275970049603; Mon, 07 Jun 2010 21:07:29 -0700 (PDT) Received: by 10.220.189.13 with HTTP; Mon, 7 Jun 2010 21:07:29 -0700 (PDT) In-Reply-To: <4C0D64B7.7060604@cs.rice.edu> References: <4C07E07B.9060802@cs.rice.edu> <4C09345F.9040300@cs.rice.edu> <4C0D2BEA.6060103@cs.rice.edu> <4C0D3F40.2070101@cs.rice.edu> <20100607202844.GU83316@deviant.kiev.zoral.com.ua> <4C0D64B7.7060604@cs.rice.edu> Date: Tue, 8 Jun 2010 09:37:29 +0530 Message-ID: From: "C. Jayachandran" To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov , "Jayachandran C." , mips@freebsd.org Subject: Re: svn commit: r208589 - head/sys/mips/mips 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: Tue, 08 Jun 2010 04:07:30 -0000 On Tue, Jun 8, 2010 at 2:59 AM, Alan Cox wrote: > On 6/7/2010 3:28 PM, Kostik Belousov wrote: >> >> Selecting a random message in the thread to ask my question. >> Is the issue that page table pages should be allocated from the specific >> physical region of the memory ? If yes, doesn't i386 PAE has similar >> issue with page directory pointer table ? I see a KASSERT in i386 >> pmap that verifies that the allocated table is below 4G, but I do not >> understand how uma ensures the constraint (I suspect that it does not). >> > > For i386 PAE, the UMA backend allocator uses kmem_alloc_contig() to ensur= e > that the memory is below 4G. =A0The crucial difference between i386 PAE a= nd > MIPS is that for i386 PAE only the top-level table needs to be below a > specific address threshold. =A0Moreover, this level is allocated in a pla= ce, > pmap_pinit(), where we are allowed to sleep. Yes. I saw the PAE top level page table code and thought I could use that mechanism for allocating MIPS page table pages in the direct mapped memory. The other reference I used was pmap_alloc_zeroed_contig_pages() function in sun4v/sun4v/pmap.c which uses the vm_phys_alloc_contig() and VM_WAIT. I had also thought of using the VM_FREEPOOL_DIRECT which seemed to be for a similar purpose, but could find see any usage in the kernel. JC.