From owner-svn-src-all@FreeBSD.ORG Sun Aug 11 21:21:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB2C64EA; Sun, 11 Aug 2013 21:21:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8C522858; Sun, 11 Aug 2013 21:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7BLL2pg037122; Sun, 11 Aug 2013 21:21:02 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7BLL2H5037121; Sun, 11 Aug 2013 21:21:02 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201308112121.r7BLL2H5037121@svn.freebsd.org> From: Olivier Houchard Date: Sun, 11 Aug 2013 21:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254229 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 21:21:03 -0000 Author: cognet Date: Sun Aug 11 21:21:02 2013 New Revision: 254229 URL: http://svnweb.freebsd.org/changeset/base/254229 Log: Only allocate 2 bounce pages for maps that can only use them for buffers that are unaligned on cache lines boundary, as we will never need more. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Aug 11 21:15:04 2013 (r254228) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Aug 11 21:21:02 2013 (r254229) @@ -425,6 +425,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) || newtag->alignment > 1) newtag->flags |= BUS_DMA_COULD_BOUNCE; + else + maxsize = 2; /* Need at most 2 bounce pages for unaligned access on cache line boundaries */ if ((flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; @@ -519,7 +521,10 @@ static int allocate_bz_and_pages(bus_dma * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. */ - maxpages = MAX_BPAGES; + if (dmat->flags & BUS_DMA_COULD_BOUNCE) + maxpages = MAX_BPAGES; + else + maxpages = 2 * bz->map_count; /* Only need at most 2 pages for buffers unaligned on cache line boundaries */ if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages;