Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941013AbcJXO4M (ORCPT ); Mon, 24 Oct 2016 10:56:12 -0400 Received: from ec2-52-42-241-221.us-west-2.compute.amazonaws.com ([52.42.241.221]:54708 "EHLO gw.crowfest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932806AbcJXO4J (ORCPT ); Mon, 24 Oct 2016 10:56:09 -0400 Message-ID: <1477317708.8424.3.camel@crowfest.net> Subject: Re: [PATCH 2/2] staging: vc04_services: Replace dmac_map_area with dmac_map_sg From: Michael Zoran To: Greg KH Cc: daniels@collabora.com, eric@anholt.net, noralf@tronnes.org, popcornmix@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Mon, 24 Oct 2016 07:01:48 -0700 In-Reply-To: <20161024132421.GB20116@kroah.com> References: <20161024052932.28259-1-mzoran@crowfest.net> <20161024132421.GB20116@kroah.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1787 Lines: 40 On Mon, 2016-10-24 at 15:24 +0200, Greg KH wrote: > On Sun, Oct 23, 2016 at 10:29:32PM -0700, mzoran@crowfest.net wrote: > > From: Michael Zoran > > > > The original arm implementation uses dmac_map_area which is not > > portable.  Replace it with an architecture neutral version > > which uses dma_map_sg. > > > > As you can see that for larger page sizes, the dma_map_sg > > implementation is faster then the original unportable dma_map_area > > implementation.   > > > > Test                       dmac_map_area   dma_map_page dma_map_sg > > vchiq_test -b 4 10000      51us/iter       76us/iter    76us > > vchiq_test -b 8 10000      70us/iter       82us/iter    91us > > vchiq_test -b 16 10000     94us/iter       118us/iter   121us > > vchiq_test -b 32 10000     146us/iter      173us/iter   187us > > vchiq_test -b 64 10000     263us/iter      328us/iter   299us > > vchiq_test -b 128 10000    529us/iter      631us/iter   595us > > vchiq_test -b 256 10000    2285us/iter     2275us/iter  2001us > > vchiq_test -b 512 10000    4372us/iter     4616us/iter  4123us > > > > For message sizes >= 64KB, dma_map_sg is faster then dma_map_page. > > > > For message size >= 256KB, the dma_map_sg is the fastest > > implementation. > > What is the "normal" message size value when using this driver? > > thanks, > > greg k-h I honestly have no idea. From what I understand, the only code that actually uses this code path is the closed source multimedia drivers which I know nothing about. Obviously, one approach would be to have the kernel collect data on what the typical size is after running some benchmarks.