From owner-freebsd-arm@FreeBSD.ORG Sat Jun 29 17:21:39 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 2B07ADF8 for ; Sat, 29 Jun 2013 17:21:39 +0000 (UTC) (envelope-from mlfbsd@kanar.ci0.org) Received: from kanar.ci0.org (unknown [IPv6:2a01:e0b:1:150:ca0a:a9ff:fef1:a4c9]) by mx1.freebsd.org (Postfix) with ESMTP id BF6A91DC7 for ; Sat, 29 Jun 2013 17:21:38 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.5/8.14.5) with ESMTP id r5THLERt090937; Sat, 29 Jun 2013 19:21:14 +0200 (CEST) (envelope-from mlfbsd@kanar.ci0.org) Received: (from mlfbsd@localhost) by kanar.ci0.org (8.14.5/8.14.5/Submit) id r5THLDwn090936; Sat, 29 Jun 2013 19:21:13 +0200 (CEST) (envelope-from mlfbsd) Date: Sat, 29 Jun 2013 19:21:13 +0200 From: Olivier Houchard To: Alan Cox Subject: Re: generic_bs_map() Message-ID: <20130629172113.GA90854@ci0.org> References: <51CEED6A.9090802@rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51CEED6A.9090802@rice.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "arm@freebsd.org" , Jeff Roberson 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 17:21:39 -0000 On Sat, Jun 29, 2013 at 09:21:30AM -0500, Alan Cox wrote: > 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 > Hmm you have a point, I don't know how we ended up using kmem_alloc() there, when we rightfully use kmem_alloc_nofault() in pmap_mapdev(). I'll fix this tomorrow if nobody beats me at it. Regards, Olivier