Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1349676imm; Wed, 8 Aug 2018 15:35:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwFH+csx3N9cnEJ/87qwCbG6q0q/mC9yTuioGA/yX7kFLp9qw4rQf1UzVkzhI/ewGkutL+b X-Received: by 2002:a63:3c0c:: with SMTP id j12-v6mr4137301pga.440.1533767711703; Wed, 08 Aug 2018 15:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533767711; cv=none; d=google.com; s=arc-20160816; b=rTGf2wRSmqiu5twqHWdvMpomjRb/1MHHUOnEnnFM8QWJ36ZToswWnnXU01zi68AqQg ouL5zblOES96bvFs0AKCmOsgetjwtVTl1/QTWSI17jBQhkQ3DK0mEOPQ9fiGgTshsv42 P7Nys1qZmQ3srGnPluBNs/Vsxzqqar9cUPZDdAi2puNhvkE+l2uklsAqOLApScisWYj4 jjsVB2sdeUXIz5h/P/A1IGgAISlWBqGpZeSWPC2gkIm/5xf7iZxWhu3ad3/EBl57bAEK +42KMTYf/jL6pCOB+G7lDD6XWokhVmEROPlQJcg5TpzAO7iqqWpquuAvK0nXFrZDN44j Jeog== 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 :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=hxsmigDdc6+N0gJhnrImydHqXdllHTt4MjHARONaVNg=; b=mGab0oQm8vn6gWIMNLfDXv3IYd4lwRSPvbzsvuN+G2QDnuksjVNW/Zj4XAUJFjLoo5 gi8nqyaaO2zjzOdQrWvXkPqGyPP/WyTBiWCqK4fMqxHthoRmRLlpwLv4tBSjEisUmTpw g8galbiBZoNARCsD/yUsuXRtf2P6iF0QAJULmrV/E62o6AYHmWqkvK4H/LdZiVJ2cd/v 1/jl4DV+4qsJ93+H8J99SiDFU/QOpUR1SDdqTzUQGfQK7quqYBRYWAYX3Rybl0hBbZOB qufTNxsS/OkU/LT6f9SKzEgEtPmmF36Z2gFslEoGj40TNR2REbQfQ5FsUQF9Z7zDR9z3 xmmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=cwNb5dOZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11-v6si4200070plq.265.2018.08.08.15.34.57; Wed, 08 Aug 2018 15:35:11 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=cwNb5dOZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731652AbeHIAym (ORCPT + 99 others); Wed, 8 Aug 2018 20:54:42 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:38702 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729732AbeHIAym (ORCPT ); Wed, 8 Aug 2018 20:54:42 -0400 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D1D0CD; Thu, 9 Aug 2018 00:32:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1533767577; bh=OGV+QoYUNbMdZ4OvRzrkPaa/vYJOdi4cr76XsPNEZIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwNb5dOZvOChyyw4hFH6eBbk2koWGdPOjEULZDbH/pLEIkWxaerxuVWW9D55UL9ek trUOKZMwuZmMIp0cGbiwSwWp4uBxmNSmkVA0dnsoTTnfYfxzysRCvXjLd9z3XB24Jx PtCaDAEgfdzQ8ZTw/mMZvetr0IKUQUj75Z4MMb70= From: Laurent Pinchart To: Tomasz Figa Cc: Alan Stern , keiichiw@chromium.org, Linux Kernel Mailing List , Mauro Carvalho Chehab , Linux Media Mailing List , Kieran Bingham , Douglas Anderson , Ezequiel Garcia , "Matwey V. Kornilov" Subject: Re: [RFC PATCH v1] media: uvcvideo: Cache URB header data before processing Date: Thu, 09 Aug 2018 01:33:40 +0300 Message-ID: <2414943.eZ5QIXTjLV@avalon> Organization: Ideas on Board Oy In-Reply-To: References: <1959555.Z0pJAWgXVZ@avalon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On Wednesday, 8 August 2018 19:27:42 EEST Tomasz Figa wrote: > On Thu, Aug 9, 2018 at 1:21 AM Laurent Pinchart wrote: > > On Wednesday, 8 August 2018 17:20:21 EEST Alan Stern wrote: > >> On Wed, 8 Aug 2018, Keiichi Watanabe wrote: > >>> Hi Laurent, Kieran, Tomasz, > >>> > >>> Thank you for reviews and suggestions. > >>> I want to do additional measurements for improving the performance. > >>> > >>> Let me clarify my understanding: > >>> Currently, if the platform doesn't support coherent-DMA (e.g. ARM), > >>> urb_buffer is allocated by usb_alloc_coherent with > >>> URB_NO_TRANSFER_DMA_MAP flag instead of using kmalloc. > >> > >> Not exactly. You are mixing up allocation with mapping. The speed of > >> the allocation doesn't matter; all that matters is whether the memory > >> is cached and when it gets mapped/unmapped. > >> > >>> This is because we want to avoid frequent DMA mappings, which are > >>> generally expensive. However, memories allocated in this way are not > >>> cached. > >>> > >>> So, we wonder if using usb_alloc_coherent is really fast. > >>> In other words, we want to know which is better: > >>> "No DMA mapping/Uncached memory" v.s. "Frequent DMA mapping/Cached > >>> memory". > > > > The second option should also be split in two: > > > > - cached memory with DMA mapping/unmapping around each transfer > > - cached memory with DMA mapping/unmapping at allocation/free time, and > > DMA sync around each transfer > > > > The second option should in theory lead to at least slightly better > > performances, but tests with the pwc driver have reported contradictory > > results. I'd like to know whether that's also the case with the uvcvideo > > driver, and if so, why. > > I thought that the results from retesting on pwc, after making sure > that cpu frequency stays the same all the time, actually clarified > this and indeed map once, sync repeatedly was the fastest? I had missed that, thank you for the information. I've now caught up with the pwc thread. -- Regards, Laurent Pinchart