Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1026629imm; Wed, 8 Aug 2018 09:30:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZO3Rtgzc0LB7demKQ+uAnmOfa+F+DQRx6ymz1d8p8SNOnuIv/f11+3rzJQO8N8CGNZwdv X-Received: by 2002:a62:4494:: with SMTP id m20-v6mr3681125pfi.205.1533745822605; Wed, 08 Aug 2018 09:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533745822; cv=none; d=google.com; s=arc-20160816; b=vvBR3RcYt/p/jJEB7FOeI+0Efe740Ejk6VueoXbKCfBisubhDkEMahoYkKUE+61dl2 pf2B4+ZX4fCIDpFNI/TjN/7A6MmQyfUDz+2SUyOJuCMZejOtTh5EqwSicG8lu5FruE9s KIEOZs6JDxme6dnrcjU720zaW71VKqpXEcQjs8DCxcZLC5883yWkhxhAsCH/GjFyzoZQ SgaDGq0R5ppuDxpJp4nShXRuFhJsLVGtokqcM7llBEQAF0msjrFt5HkEw4Cx753MByCt BTQKvI7fSSLTrfG903yryE3q05Ft201vLid5VmW8ABgUZ2o3jYtqBAFtoQejtq6IA4OP 0NPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=c4aG9S+P6qHJ+LF4J6q6NTKioRqfs9B17s0YLTLIgak=; b=A6b2+Td6sJ8HkEpw7jzXHdXYlBrCQyAO4MiXs7qPr3FhG3iFFuuMaKUAWAH4lDAe0c 8voK8K9/hrpYg35Z0lql4+qKxbDokileNottBaxIeSKKiP6UZxwnxLwnAKzpbsdrQ8U2 arSTeRH/JUNcpwLdoeKzeSj41rdtY/z/QGEICxmtkaCLElI6CnWFdphZpFGq2xRUUYLW Ua7gTTwRkjtEGwT5KB9UmAW2IZrdbxYhHZGjG3w5rVV+A4Uv8LB2jdU7eKSlhfX9UaAi H48RprO/XMyuQGTcEqhDvzS4J1qB/j27duCDZZ8laFL/4bVeQ6fk9it/O5WfL9xncfws 5a2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="kl/sKrCm"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125-v6si4562677pgc.424.2018.08.08.09.30.08; Wed, 08 Aug 2018 09:30:22 -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 header.i=@chromium.org header.s=google header.b="kl/sKrCm"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729267AbeHHSsX (ORCPT + 99 others); Wed, 8 Aug 2018 14:48:23 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:35167 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbeHHSsW (ORCPT ); Wed, 8 Aug 2018 14:48:22 -0400 Received: by mail-yw1-f68.google.com with SMTP id s68-v6so1988706ywg.2 for ; Wed, 08 Aug 2018 09:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c4aG9S+P6qHJ+LF4J6q6NTKioRqfs9B17s0YLTLIgak=; b=kl/sKrCmOF1rJHYAutIa03UorDMEIJXEaufAAAQvKICoXQLGwGav4ws1Um3VNBAgHw pLX2nrV4W5UT7OXErREoKnDb8mfY7DZWQhxfI1F9usVFe0eojF4/9IysrYQFU8HD4RXE VWajuxv/iyGvptQipKPn35Ka+5uFkpEOsEIJ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c4aG9S+P6qHJ+LF4J6q6NTKioRqfs9B17s0YLTLIgak=; b=SxG2W38Ifv7gJBkOAGvioDBv1Ps3cgYsC25pBWqCr3JVawMaWzVI7cUHo0yw9KMrd+ XbQJDJBEvx+jK08dLNQD1UTfxW2VyBk3oox5jWGiVPOZHfJfr1LdzzlZMZ57Y5EqYP+T OUnbooWQKlA764iTYvFVH8EX16Xe8FkF/THml49e3R7sGeJbwvpHk4PlOQeLZqlrMe0i aeh5scbKeGNyAwqblPnHtmMfX8kopa9C13SWC/1/AGtQqcNsXvOTTmUXFBvq9icNACIf 6aSi8NrJ3zc+bPPV4qAo0jgAM4tO7HrcrXuU6PLwnvLo4LHsdkmgG0zVtatJaaJ3rojJ K43Q== X-Gm-Message-State: AOUpUlG3ZcMGWB5hReBy0rk0lTY8449M4BEJDVpMaT19vjF6xNSbTzHr JZ2l+jgqG1u1FbGPtQoGWT3TYoNcZds= X-Received: by 2002:a0d:e9c1:: with SMTP id s184-v6mr1870506ywe.506.1533745675913; Wed, 08 Aug 2018 09:27:55 -0700 (PDT) Received: from mail-yw1-f46.google.com (mail-yw1-f46.google.com. [209.85.161.46]) by smtp.gmail.com with ESMTPSA id 203-v6sm2202587ywv.34.2018.08.08.09.27.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 09:27:55 -0700 (PDT) Received: by mail-yw1-f46.google.com with SMTP id s68-v6so1988633ywg.2 for ; Wed, 08 Aug 2018 09:27:54 -0700 (PDT) X-Received: by 2002:a81:5403:: with SMTP id i3-v6mr1745919ywb.365.1533745674387; Wed, 08 Aug 2018 09:27:54 -0700 (PDT) MIME-Version: 1.0 References: <1959555.Z0pJAWgXVZ@avalon> In-Reply-To: <1959555.Z0pJAWgXVZ@avalon> From: Tomasz Figa Date: Thu, 9 Aug 2018 01:27:42 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v1] media: uvcvideo: Cache URB header data before processing To: Laurent Pinchart 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" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 9, 2018 at 1:21 AM Laurent Pinchart wrote: > > Hello, > > 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? Best regards, Tomasz