Received: by 10.223.164.202 with SMTP id h10csp503209wrb; Thu, 9 Nov 2017 09:36:59 -0800 (PST) X-Google-Smtp-Source: ABhQp+S35cTDvo1QEQumvXq6JpW2oXFFoQB2R0qxW7oW9biYSEUt8qKhi1PIcEOXR85xGK/r/Pyi X-Received: by 10.99.107.6 with SMTP id g6mr1169484pgc.215.1510249019021; Thu, 09 Nov 2017 09:36:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510249018; cv=none; d=google.com; s=arc-20160816; b=st2mfynYep/lZxpoqfdE57d4k4RiTFZ4OZZxp477stLBVOWphWplt6IqJEMiddwlCI 85ZxmDioY7M1a/MfVlyrHm7xC+kw1zaaarTGVr4BX/r96OFzRLExcjJCvJ6+Y37LyAX2 t9ZJb2cOIoAiRLJbKpgjEGzt3JgdULABtO2v1qSmxFp3NV6uUIEeKsGrr7M2jtcPW0XZ FPo8Cmignou5nNxy9a84jjZMFY1pwnwLxNu8OxhxGJ578Py1OtuAaQvdty/Unyz02FJK ZuAVqsUZHMkg+gQmAshoza1fmQ0GhTLSPGKSTQxWLyLmW0rTWNvzi470sFFBaYgryVYm k/PQ== 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=7CNjXaT1aq20tCe08Rhr1chRPqZHm1/nt96Zd88rn6Y=; b=TT+3uQ4MPoVZbECdjcpY2lcME5prcDoMgJS8opRRix1hY8w90DP5yC0h8VhStknpOW 3B6wZAXKko+rwSOiCC4phq2sSlTsFzFe6iiSU+P2SXb+Z+NfViCEvSuNsalochaHDs1Z G2PaaBC84WStMx3+Pj2E+xhrXgaUWOziYWV4FxH+cCWg/+MxAaiJ+Oiqq8+mnpwZSyo/ T1JUmET+/jRyM3TpnpRwlCMM9eKclmU5Lyfg+iJ8V3pv546+wD259QvXbsNiR+ktos5R YOsv+x3hrqjBJSEf2nW5jFzcv56AZnKnwtLNtGJhkGjN69jYhEbS6QVNCPnKNgc6JSVR lLug== 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 x14si5099001pgx.254.2017.11.09.09.36.47; Thu, 09 Nov 2017 09:36:58 -0800 (PST) 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 S1755086AbdKIRf1 (ORCPT + 81 others); Thu, 9 Nov 2017 12:35:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54510 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754232AbdKIRfZ (ORCPT ); Thu, 9 Nov 2017 12:35:25 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 035965F7B8; Thu, 9 Nov 2017 17:35:25 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 45AC86BF7F; Thu, 9 Nov 2017 17:35:13 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Thu, 09 Nov 2017 18:35:12 +0100 Date: Thu, 9 Nov 2017 18:35:12 +0100 From: Radim Krcmar To: Peter Zijlstra Cc: Pankaj Gupta , Wanpeng Li , Eduardo Valentin , Paolo Bonzini , Matt Wilson , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Waiman Long , kvm , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Jan H . Schoenherr" , Anthony Liguori Subject: Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set Message-ID: <20171109173512.GH20859@flask> References: <1509999980-10828-1-git-send-email-eduval@amazon.com> <789734192.29237413.1510242805535.JavaMail.zimbra@redhat.com> <20171109160536.GE20859@flask> <20171109161701.y3eqqrvs5jpg46lr@hirez.programming.kicks-ass.net> <20171109164523.GF20859@flask> <20171109171241.43zpahj24mhzzp3y@hirez.programming.kicks-ass.net> <20171109171511.gckh2lt7xksmiern@hirez.programming.kicks-ass.net> <20171109172854.ajiayvfu7jdai37v@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171109172854.ajiayvfu7jdai37v@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 09 Nov 2017 17:35:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-09 18:28+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 06:15:11PM +0100, Peter Zijlstra wrote: > > On Thu, Nov 09, 2017 at 06:12:41PM +0100, Peter Zijlstra wrote: > > > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote: > > > > 2017-11-09 17:17+0100, Peter Zijlstra: > > > > > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote: > > > > > > 2017-11-09 10:53-0500, Pankaj Gupta: > > > > > > > 2] PV TLB should also behave as per option PV_DEDICATED for better performance. > > > > > > > > > > > > Right, > > > > > > > > > > Shouldn't KVM do flush_tlb_other() in any case? Not sure how > > > > > PV_DEDICATED can help with that. > > > > > > > > It will, the suggestion was based on recent extension of the > > > > flush_tlb_others implementaion, https://lkml.org/lkml/2017/11/8/1146. > > > > > > > > PV_TLB_FLUSH allows a guest to set a flush bit instead of sending flush > > > > IPI if the target VCPU is not running. This would be a waste of time > > > > with PV_DEDICATED as all VCPUs are expected to always running. > > > > > > > > With PV_DEDICATED, the guest should keep using native_flush_tlb_others. > > > > > > Is saving that for_each_cpu() really worth the effort compared to the > > > cost of actually doing the IPIs and CR3 write? > > > > > > Also, you should not put cpumask_t on stack, that's 'broken'. > > > > Also, you'll want to use __cpumask_clear_cpu() there. > > Also^2, that patch split is crazy, after patch 2/3 your machine is > broken due to lost TLB flushes. You have to first add the SHOULD_FLUSH > handling and then clear CPUs from the native_flush_tlb_other() mask. That should be fixed in v2 -- [2/3] must not enable this feature if the host has not exposed it and [3/3] has to expose it. (The ordering of those two doesn't matter as they are separate kernel.) From 1583610511705482996@xxx Thu Nov 09 17:31:12 +0000 2017 X-GM-THRID: 1583352031107436177 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread