Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2401422imc; Tue, 12 Mar 2019 13:05:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqznjW9VMlFh67ZTUd4DrNQIAoFap1ysKt2cgfyEmmYojBo4PfTpDHm30ZTwm+vJNttiS6jC X-Received: by 2002:a63:1b4f:: with SMTP id b15mr17441487pgm.83.1552421133226; Tue, 12 Mar 2019 13:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552421133; cv=none; d=google.com; s=arc-20160816; b=nWJlENYNfpqhDPqdGR9RYNu6XVJedBNOeZzz/FW+iUg0a5cc1FznHkK2n7mRpgPppy r4CUl1qo2vvKVClvvywiXcdhI4JWUYq93gz2dNI01A8aOXmV214gUKiEhw52cCrXbhTT Yytx7LANYl22IfuP8TBqeb7tJsNTHGqpePGrPNttdO5BhJy5lY9d1k71LXEa1wVVe5gN cW6QMmhiZ1t8BGGNJx6glo1QP3aEEG7lzgD/6PhulyeV773rNmkamempCqse+yvCvLH/ BZLeTy9XokRNnQ0gwApuOrFGdjM4anpq+DaY/NKy5afB0NRBN3SkcYoXRGalbwLPykRL E19w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=akxVDaqCkmLREnINvadIYFkfVvDbWfWA451PFdxqjq4=; b=bWWo5WE1ZmYHdxRAhiddlYDyu/c92NMg55RpkwsKE7nknjBvQSJWve8C6VQB9ZN8qy jViSroX9z/ZDPOjO7tyhPUfENnlRXYFq/5XOgItrPHzUMWa/EkzTZeUiAtashZ4CU36X Du4FiahWgbLQaRlHNe+GOYpVbXKISMVaVrU0/06/TBg/82yOQsGF3jMUnloVOlxV+Tt5 V9YD4wmZcRH2WN2QbIACqLnxpLMtItx8bSvy/kEzFM0iacNz7yFjAjxr5C1XVIdwFmEc 8lBEx2guFiHx3/zYAMsLfoxnfFlyFI/xkaxSv/Kr/KqxbrDYtElAC/9UxXe6wn2V0Wel QEWA== 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 e2si7704972pgv.511.2019.03.12.13.05.16; Tue, 12 Mar 2019 13:05:33 -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 S1727135AbfCLUEy (ORCPT + 99 others); Tue, 12 Mar 2019 16:04:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfCLUEy (ORCPT ); Tue, 12 Mar 2019 16:04:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C82453086203; Tue, 12 Mar 2019 20:04:53 +0000 (UTC) Received: from sky.random (ovpn-121-1.rdu2.redhat.com [10.10.121.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20E951001DFA; Tue, 12 Mar 2019 20:04:51 +0000 (UTC) Date: Tue, 12 Mar 2019 16:04:50 -0400 From: Andrea Arcangeli To: James Bottomley Cc: "Michael S. Tsirkin" , Jason Wang , David Miller , hch@infradead.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, peterx@redhat.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org Subject: Re: [RFC PATCH V2 0/5] vhost: accelerate metadata access through vmap() Message-ID: <20190312200450.GA25147@redhat.com> References: <20190308141220.GA21082@infradead.org> <56374231-7ba7-0227-8d6d-4d968d71b4d6@redhat.com> <20190311095405-mutt-send-email-mst@kernel.org> <20190311.111413.1140896328197448401.davem@davemloft.net> <6b6dcc4a-2f08-ba67-0423-35787f3b966c@redhat.com> <20190311235140-mutt-send-email-mst@kernel.org> <76c353ed-d6de-99a9-76f9-f258074c1462@redhat.com> <20190312075033-mutt-send-email-mst@kernel.org> <1552405610.3083.17.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1552405610.3083.17.camel@HansenPartnership.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 12 Mar 2019 20:04:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 12, 2019 at 08:46:50AM -0700, James Bottomley wrote: > On Tue, 2019-03-12 at 07:54 -0400, Michael S. Tsirkin wrote: > > On Tue, Mar 12, 2019 at 03:17:00PM +0800, Jason Wang wrote: > > > > > > On 2019/3/12 上午11:52, Michael S. Tsirkin wrote: > > > > On Tue, Mar 12, 2019 at 10:59:09AM +0800, Jason Wang wrote: > [...] > > > At least for -stable, we need the flush? > > > > > > > > > > Three atomic ops per bit is way to expensive. > > > > > > > > > Yes. > > > > > > Thanks > > > > See James's reply - I stand corrected we do kunmap so no need to > > flush. > > Well, I said that's what we do on Parisc. The cachetlb document > definitely says if you alter the data between kmap and kunmap you are > responsible for the flush. It's just that flush_dcache_page() is a no- > op on x86 so they never remember to add it and since it will crash > parisc if you get it wrong we finally gave up trying to make them. > > But that's the point: it is a no-op on your favourite architecture so > it costs you nothing to add it. Yes, the fact Parisc gave up and is doing it on kunmap is reasonable approach for Parisc, but it doesn't move the needle as far as vhost common code is concerned, because other archs don't flush any cache on kunmap. So either all other archs give up trying to optimize, or vhost still has to call flush_dcache_page() after kunmap. Which means after we fix vhost to add the flush_dcache_page after kunmap, Parisc will get a double hit (but it also means Parisc was the only one of those archs needed explicit cache flushes, where vhost worked correctly so far.. so it kinds of proofs your point of giving up being the safe choice). Thanks, Andrea