From owner-freebsd-arm@FreeBSD.ORG Sat Jun 29 14:21:34 2013 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 702C5D2D for ; Sat, 29 Jun 2013 14:21:34 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0301827 for ; Sat, 29 Jun 2013 14:21:33 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id r5TBdONL031903; Sat, 29 Jun 2013 09:21:32 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1d6ep8jt2y-1; Sat, 29 Jun 2013 09:21:32 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 8A0D74600F1; Sat, 29 Jun 2013 09:21:31 -0500 (CDT) Message-ID: <51CEED6A.9090802@rice.edu> Date: Sat, 29 Jun 2013 09:21:30 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: "arm@freebsd.org" Subject: generic_bs_map() X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jeff Roberson , Alan Cox X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2013 14:21:34 -0000 Jeff and I have been looking at the various kmem_alloc() calls throughout the kernel, and when we came to generic_bs_map() on arm, I was a bit puzzled. In short, I believe that generic_bs_map() should be calling kmem_alloc_nofault() instead of kmem_alloc(). It appears to me that generic_bs_map() only wants a virtual address range from kmem_*, which is what kmem_alloc_nofault() does. In contrast, kmem_alloc() also allocates and maps physical memory at the returned address range. In the case of generic_bs_map(), allocating and mapping physical memory is pointless because generic_bs_map() overwrites those mappings with its own. So, the physical pages allocated by kmem_alloc() are wasted. Neither Jeff nor I have arm hardware to verify this change. Could someone here please try it out? Thanks, Alan