Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp967278imm; Wed, 19 Sep 2018 09:43:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY3RfOGXwfih1+N/VsxLyg1vm+fEvCsjZuotTuxNRZDvDjlQZiBS0NaMjf3xyeMk1MHIf5O X-Received: by 2002:a17:902:b58a:: with SMTP id a10-v6mr35783618pls.306.1537375427629; Wed, 19 Sep 2018 09:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537375427; cv=none; d=google.com; s=arc-20160816; b=rru7jo8MnoegGsY+sZRp0b551MmDYhnA18LyKZ/hZkIUSl7doPwKj5WMFkQoDfLXx6 gdESkX6HsE3x568W3liiUyGcUBu4wKg2KIEau8Qr+HFUUfAhMLesc7UUjkOy5ac0iKAT r+aw8sKlHokZCrCDAkrN3T/H6qZGvX37jYSZW7kQ4qOKIZNUCGFYNOxZwZhZ9MZUAjiq CJ7q6i6jF+xgpeVnoAgwAqpshb7TIzbrysFkIPbgEmmaGf52K/HqRZyDANwndlTvOaoC t7RS2IDGKiu+5GHZvaSNVkSIrgbF6FYS3C7XzMAE4Rfjgc7ZHCRjBoasX+bTxHZ83UXm qq2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id; bh=Y34lOjty8kR+hOvKxbEM6T9o0ua0xGS8Nqm0/g4szfg=; b=DZ70jmlVGZxmgrltxSnRfOVsnPYiN/a6kXzpcmrMpNrp9pxqVakmmaxiXV/vvBSwa2 crG9PiXBz69GTQVXSfagm+YsUFPjXldsH5bztbz7LieRkAHZ9gXsj+NGMQYTcd0BZTzH YRIpuBAibJ6NUed0ShLnGsCMcOgSXMq9MS/wieMmq4owTKsWl0i3xfV9YCgAfa/XoeGf He72AUTiWhNfzm586oiHXYt0Pxgv9DLKmc/qDStgKVm2V5YKGwadp/MGRfispMemX4iX KdOwuohaKVYJklwTYU7Rbw9/rGhYloEZsfaC6N1fHPl/V1kEX1YkgB9bmOZaHWzdnQND A5YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si4493932plh.469.2018.09.19.09.43.25; Wed, 19 Sep 2018 09:43:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731963AbeISVvc (ORCPT + 99 others); Wed, 19 Sep 2018 17:51:32 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39264 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731902AbeISVvb (ORCPT ); Wed, 19 Sep 2018 17:51:31 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 9B71B26068F Message-ID: <5216fc0a31c472f260517e78ff3481376b8d88d7.camel@collabora.com> Subject: Re: [PATCH v5 2/2] media: usb: pwc: Don't use coherent DMA buffers for ISO transfer From: Ezequiel Garcia To: "Matwey V. Kornilov" , Linux Media Mailing List , open list Cc: Tomasz Figa , Laurent Pinchart , Alan Stern , Hans de Goede , Hans Verkuil , Mauro Carvalho Chehab , Steven Rostedt , mingo@redhat.com, Mike Isely , Bhumika Goyal , Colin King , Kieran Bingham , keiichiw@chromium.org Date: Wed, 19 Sep 2018 13:12:45 -0300 In-Reply-To: References: <20180821170629.18408-1-matwey@sai.msu.ru> <20180821170629.18408-3-matwey@sai.msu.ru> Organization: Collabora Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-09-11 at 21:58 +0300, Matwey V. Kornilov wrote: > вт, 28 авг. 2018 г. в 10:17, Matwey V. Kornilov : > > > > вт, 21 авг. 2018 г. в 20:06, Matwey V. Kornilov : > > > > > > DMA cocherency slows the transfer down on systems without hardware > > > coherent DMA. > > > Instead we use noncocherent DMA memory and explicit sync at data receive > > > handler. > > > > > > Based on previous commit the following performance benchmarks have been > > > carried out. Average memcpy() data transfer rate (rate) and handler > > > completion time (time) have been measured when running video stream at > > > 640x480 resolution at 10fps. > > > > > > x86_64 based system (Intel Core i5-3470). This platform has hardware > > > coherent DMA support and proposed change doesn't make big difference here. > > > > > > * kmalloc: rate = (2.0 +- 0.4) GBps > > > time = (5.0 +- 3.0) usec > > > * usb_alloc_coherent: rate = (3.4 +- 1.2) GBps > > > time = (3.5 +- 3.0) usec > > > > > > We see that the measurements agree within error ranges in this case. > > > So theoretically predicted performance downgrade cannot be reliably > > > measured here. > > > > > > armv7l based system (TI AM335x BeagleBone Black @ 300MHz). This platform > > > has no hardware coherent DMA support. DMA coherence is implemented via > > > disabled page caching that slows down memcpy() due to memory controller > > > behaviour. > > > > > > * kmalloc: rate = (114 +- 5) MBps > > > time = (84 +- 4) usec > > > * usb_alloc_coherent: rate = (28.1 +- 0.1) MBps > > > time = (341 +- 2) usec > > > > > > Note, that quantative difference leads (this commit leads to 4 times > > > acceleration) to qualitative behavior change in this case. As it was > > > stated before, the video stream cannot be successfully received at AM335x > > > platforms with MUSB based USB host controller due to performance issues > > > [1]. > > > > > > [1] https://www.spinics.net/lists/linux-usb/msg165735.html > > > > > > Signed-off-by: Matwey V. Kornilov > > > > Ping > > We are already using slab buffers in em28xx, so I think this change makes sense, until we have proper a non-coherent allocation API. Acked-by: Ezequiel Garcia Thanks a lot Matwey for your work.