Date: Sun, 11 Aug 2013 21:21:02 +0000 (UTC) From: Olivier Houchard <cognet@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254229 - head/sys/arm/arm Message-ID: <201308112121.r7BLL2H5037121@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308112121.r7BLL2H5037121>