Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4733598img; Tue, 26 Mar 2019 15:57:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCrOiZMj5y/iqyobs8sE0fYFjBULgzRIadcj3rZXfEN5o2CnqyJ9xvMitYu+VpEZkIKAp/ X-Received: by 2002:a63:7141:: with SMTP id b1mr4488119pgn.331.1553641049033; Tue, 26 Mar 2019 15:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553641049; cv=none; d=google.com; s=arc-20160816; b=Q8ilm7zVSKWkErbC/omnPZicduXG8Sk0Rw8la/jbVNDFH4HcCLeGqqsbVm+xI9/vic kYBTy1MrPPsi4PfhqhKnXQLlxTHWKpajfzSmeQXmyyk0VV6HiNahIfXJyJ07NGbF8aUf MImjV8ouTFKZmij1dVUE+X0/ZtJlQl4gq6HG0gOW/+qb/J15OHQyUMtRsmoU+KHzTSSK rp/hijNoaUvZZfptHV6iUdXuv7wVbILatiabC6xdOWkeCaD5LWy5Diu+QSoqagsQsGR5 wJmFKYUt84z2NbGUbGLh0mCV54vs5dXS4ZKSMaBBu6idMktbbYCmsHoBGUZcnYMIBThO 0hmg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2+gCR5jb96inIfvtwpmHTJNElA4TChi2F/Po1kWxACw=; b=KKtp1ALjUtHijJL/8OeIdyE14RN+tBUlF+NWVIy6ujY04JgfsynnaQ5g7S60wgNT0e e1UvntKWMhB6c2AWQ8oT9+D2L0oPhRd5seJiYoKKRxX2D+sYZDkhy57miSxjZkb0XPD3 x1vaKaWm7AzPip32EznP+5JXNznkCxZo4coRIzQlOKNzSdvJdCvBMacKfUJsK488YNJA S8d6SI4CHh7R3iIz/ycxhJmw4dv4zxNXYJHRLBs8hgG1ts6Q2qP1sQDI8ynvuicUOXC/ IIqV4vzMs67wmHn1TsUNVGSeoPGfUu1h+j+M9BHcsv8XYQkkJ12bhjB6/FDRliLkUHB6 6GTA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si17173386plo.371.2019.03.26.15.57.13; Tue, 26 Mar 2019 15:57:29 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731824AbfCZW4j (ORCPT + 99 others); Tue, 26 Mar 2019 18:56:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:60624 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbfCZW4j (ORCPT ); Tue, 26 Mar 2019 18:56:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 15:56:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,274,1549958400"; d="scan'208";a="144145558" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by FMSMGA003.fm.intel.com with ESMTP; 26 Mar 2019 15:56:38 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 59A7C301BD4; Tue, 26 Mar 2019 15:56:38 -0700 (PDT) Date: Tue, 26 Mar 2019 15:56:38 -0700 From: Andi Kleen To: Thomas Gleixner Cc: "Chang S. Bae" , Ingo Molnar , Andy Lutomirski , "H . Peter Anvin" , Ravi Shankar , LKML , Andrew Cooper , x86@kernel.org, Linus Torvalds , Greg KH , Arjan van de Ven Subject: Re: New feature/ABI review process [was Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64:..] Message-ID: <20190326225638.GQ18020@tassilo.jf.intel.com> References: <1552680405-5265-1-git-send-email-chang.seok.bae@intel.com> <1552680405-5265-5-git-send-email-chang.seok.bae@intel.com> <20190326003804.GK18020@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > If you want to advocate the more complex design of mixed SWAPGS/FSGSBASE > then provide numbers and not hand-waving. Numbers of real-world workloads, > not numbers of artificial test cases which exercise the rare worst case. Well you're proposing the much more complicated solution, not me. SWAPGS is simple and it works everywhere except for paranoid. > Yes, it's extra work and it's well spent. If the numbers are not > significantly different then the simpler and consistent design is a clear > win. As long as everything is cache hot it's likely only a couple of cycles difference (as Intel CPUs are very good executing crappy code too), but if it's not then you end up with a huge cache miss cost, causing jitter. That's a problem for real time for example. > > Accessing user GSBASE needs a couple of SWAPGS operations. It is > > avoidable if the user GSBASE is saved at kernel entry, being updated as > > changes, and restored back at kernel exit. However, it seems to spend > > more cycles for savings and restorations. Little or no benefit was > > measured from experiments. > > So little or no benefit was measured. I don't see how that maps to your > 'SWAPGS will be a lot faster' claim. One of those claims is obviously > wrong. If everything is cache hot it won't make much difference, but if you have a cache miss you end up eating the cost. > > Aside of this needs more than numbers: > > 1) Proper documentation how the mixed bag is managed. How SWAPGS is managed? Like it always was since 20+ years when the x86_64 port was originally born. The only case which has to do an two SWAPGS is the context switch when it switches the base. Everything else just does SWAPGS at the edges for kernel entries. > You have a track record of not caring much about either of these, but I > very much care for good reasons. I've been bitten by glued on and half > baked patches from Intel in the past 10 years so many times, that I'm > simply refusing to take anything which is not properly structured and > documented. In this case you're proposing the change, the Intel patch just leaves SWAPGS alone. So you have to describe why it's a good idea. At least what you proposed on this wasn't convincing and would be rejected by a proper code review. -Andi