Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3808479imm; Mon, 6 Aug 2018 10:57:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdEeSMT93oqnTMSk2ugjfgHalbiW1+seNu+tEQu49b5EDDcHe7L2giKSkkHcDrYZVGp57Ps X-Received: by 2002:a63:4c56:: with SMTP id m22-v6mr15053377pgl.299.1533578246551; Mon, 06 Aug 2018 10:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533578246; cv=none; d=google.com; s=arc-20160816; b=UhkuTR1LeIX4a8t/lrZv0xk2NNVc4a8yt9MEG3YBvazi+HVblgCI52c6y/IC2Ogzoq db6idUAw6sKVDggWWH0j+kUs4M6JVNWFZ2sLUy2Zbuy02BXjnKO1H0s+f49waMcwBGuc CkB0/FrrnqH2cwBu6xVAohAHIEPNWA9R4ObwRAMOuWLmVS6/W1OUUT+IVeBpMEYQIWps eLrluwp/iI/p8vOqSarR07AcO/e0K48hQV1l9uXZHnFwGVxIigWVW8xL6Ik6CPDIiu9E qJ5KrlL/4eJFtuoCm8aRoZEh+r1Ghw4i4Qdd64IRsu+DpExM+9A29KKgnJncxHlHidBc FhRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=VMdbvo4A379Gj3iEtt2iw3KTYzg05+zeUIPhOpCqKLQ=; b=heHh2snE6gNn9Uel0rAHSH14fkvv08J48i4cRGbWJT+8NzXNwTIU077DM5SWwr1xad zUciVJCnKw9IolEfjFMs9902Idw6LICWDLl1zCxvgKLMLKtVt6fRTFQYDgcLFt84uE/t FC/Oo7/bfGXv6+TlnpG6gdBQYSJZ6rMtOzPIn0kgQ0HIVlSaOAP0MpvommuTXUoQVi/J catvb8LQBCuSYtBHbp3tTzQ0UcYmh5rIX/hvzzkoTWgVdLowQoAkzeu7kcsYRBDFVr+a X5Xfzbqq5+MtbkzMZGvAH5uLRDVWJ8Dqkd0wyUNkOKBWiKHuzePoqn/iv/SpfJR1wQKT 80Iw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194-v6si12438234pgf.651.2018.08.06.10.57.12; Mon, 06 Aug 2018 10:57:26 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733127AbeHFSPz (ORCPT + 99 others); Mon, 6 Aug 2018 14:15:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37622 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728626AbeHFSPz (ORCPT ); Mon, 6 Aug 2018 14:15:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CCF640241DA; Mon, 6 Aug 2018 16:06:09 +0000 (UTC) Received: from redhat.com (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with SMTP id AE32D2026D76; Mon, 6 Aug 2018 16:06:05 +0000 (UTC) Date: Mon, 6 Aug 2018 19:06:05 +0300 From: "Michael S. Tsirkin" To: Christoph Hellwig Cc: Anshuman Khandual , Benjamin Herrenschmidt , robh@kernel.org, srikar@linux.vnet.ibm.com, aik@ozlabs.ru, Jason Wang , linuxram@us.ibm.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, paulus@samba.org, joe@perches.com, david@gibson.dropbear.id.au, linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net, haren@linux.vnet.ibm.com Subject: Re: [RFC 0/4] Virtio uses DMA API for all devices Message-ID: <20180806190321-mutt-send-email-mst@kernel.org> References: <20180720035941.6844-1-khandual@linux.vnet.ibm.com> <20180802235332-mutt-send-email-mst@kernel.org> <20180803220812-mutt-send-email-mst@kernel.org> <01c74680c4b3aa25d9b4375a9ab5e10046b7c71b.camel@kernel.crashing.org> <20180805032355-mutt-send-email-mst@kernel.org> <74a1e1b8-81e0-84db-6d0d-d8bd9caebb4a@linux.vnet.ibm.com> <20180806163440-mutt-send-email-mst@kernel.org> <20180806152406.GA29020@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806152406.GA29020@infradead.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 06 Aug 2018 16:06:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 06 Aug 2018 16:06:09 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 06, 2018 at 08:24:06AM -0700, Christoph Hellwig wrote: > On Mon, Aug 06, 2018 at 04:36:43PM +0300, Michael S. Tsirkin wrote: > > On Mon, Aug 06, 2018 at 02:32:28PM +0530, Anshuman Khandual wrote: > > > On 08/05/2018 05:54 AM, Michael S. Tsirkin wrote: > > > > On Fri, Aug 03, 2018 at 08:21:26PM -0500, Benjamin Herrenschmidt wrote: > > > >> On Fri, 2018-08-03 at 22:08 +0300, Michael S. Tsirkin wrote: > > > >>>>>> Please go through these patches and review whether this approach broadly > > > >>>>>> makes sense. I will appreciate suggestions, inputs, comments regarding > > > >>>>>> the patches or the approach in general. Thank you. > > > >>>>> > > > >>>>> Jason did some work on profiling this. Unfortunately he reports > > > >>>>> about 4% extra overhead from this switch on x86 with no vIOMMU. > > > >>>> > > > >>>> The test is rather simple, just run pktgen (pktgen_sample01_simple.sh) in > > > >>>> guest and measure PPS on tap on host. > > > >>>> > > > >>>> Thanks > > > >>> > > > >>> Could you supply host configuration involved please? > > > >> > > > >> I wonder how much of that could be caused by Spectre mitigations > > > >> blowing up indirect function calls... > > > >> > > > >> Cheers, > > > >> Ben. > > > > > > > > I won't be surprised. If yes I suggested a way to mitigate the overhead. > > > > > > Did we get better results (lower regression due to indirect calls) with > > > the suggested mitigation ? Just curious. > > > > I'm referring to this: > > I wonder whether we can support map_sg and friends being NULL, then use > > that when mapping is an identity. A conditional branch there is likely > > very cheap. > > > > I don't think anyone tried implementing this yes. > > I've done something very similar in the thread I posted a few years > ago. Right so that was before spectre where a virtual call was cheaper :( > I plan to get a version of that upstream for 4.20, but it won't > cover the virtio case, just the real direct mapping. I guess this RFC will have to be reworked on top and performance retested. Thanks, -- MST