Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp25945imu; Fri, 16 Nov 2018 16:37:30 -0800 (PST) X-Google-Smtp-Source: AJdET5eNIDqE2KQYR+i6K40or8PXhRPLTXFXJb+ZVcMi+1xGKxyzI0UhVXfqQ8kNKxQcLi4xm9vr X-Received: by 2002:a63:5765:: with SMTP id h37mr12050527pgm.423.1542415050178; Fri, 16 Nov 2018 16:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542415050; cv=none; d=google.com; s=arc-20160816; b=gqDUh/jWYRZh3lZ8U0Ye0pX9gunp44CWnTgSjK6FBcm5ft66v/dCIqy5kvGd6jpFhn xu7mkQkqiUN64zju+LEysyhLBXuVZgtanYHKhcfK0iklGFqmiJfb5pYVYk1mrnJ+5eHb SHeZVniCRKp5WPQ47NZ5U/J/Tt8RM/oUWTMbqp87WUmzXC5WzNhADCb3oawxczLXaIOH MlZpeAze6HJi/6P7DL15uL2tu21narVH2zlic3tDIuX6XtgkQq6NLHXSiZx6ga3pnXnZ pvCyQHDZzysrXBtPjVXTvWoIHhbEP8d3d6WZg242VNlWdhwOceVcaY97sHjXNJvqk7hb ANpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EM4k3Fumz4bOaM6U6tT5lVK2kUrPWvqHm4zEC+VPdFw=; b=OXz4om+xgHxIhy5bd36Ev+bJBN3p6T+MI8qhbQe5X29guAdfs6/5x+ZzB67PTWwPJn WEDQoL486QK8YGeGBBHlrNw2Ofaw/g431wY390u+k+lD9Cpc6h9cMSlh9UaNvlx1f6NA 0UZlwZR7/SlnzadvgFdRZc3YUMpmthVmyG4uJopW7XXIYvhiMPJ52wFJcgfDF7SQxXe0 zI0j373MEglIXwCyUI+5V7WAtG+8xkUDcJqX8+8NQQq+hbVRtP+aNU7/SnBAzuU+y5qw vu0Hx7W5Lv4pwk//jPTtMoGwpduY7U8+H4Xgj5ANq78Wg0daEmh12LUWAg3bfNeBCM0Q sr9A== 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 u23si31868078pgb.66.2018.11.16.16.37.15; Fri, 16 Nov 2018 16:37:30 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729848AbeKQKvM (ORCPT + 99 others); Sat, 17 Nov 2018 05:51:12 -0500 Received: from mga09.intel.com ([134.134.136.24]:18160 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbeKQKvM (ORCPT ); Sat, 17 Nov 2018 05:51:12 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2018 16:36:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,242,1539673200"; d="scan'208";a="92728333" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.118]) ([10.239.161.118]) by orsmga008.jf.intel.com with ESMTP; 16 Nov 2018 16:36:35 -0800 Subject: Re: [PATCH v3 1/2] x86/fpu: track AVX-512 usage of tasks To: Dave Hansen , Aubrey Li , tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, hpa@zytor.com Cc: ak@linux.intel.com, tim.c.chen@linux.intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org References: <1542236407-4323-1-git-send-email-aubrey.li@intel.com> <6f8a7b97-d889-ce77-b5ad-d03dbf4986b0@intel.com> <88a5d6df-0005-db3e-f3be-83e2a8b63a27@linux.intel.com> From: "Li, Aubrey" Message-ID: Date: Sat, 17 Nov 2018 08:36:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/17 7:10, Dave Hansen wrote: > On 11/15/18 4:21 PM, Li, Aubrey wrote: >> "Core cycles where the core was running with power delivery for license >> level 2 (introduced in Skylake Server microarchitecture). This includes >> high current AVX 512-bit instructions." >> >> I translated license level 2 to frequency drop. > > BTW, the "high" in that text: "high-current AVX 512-bit instructions" is > talking about high-current, not "high ... instructions" or high-numbered > registers. I think that might be the source of some of the confusion > about which XSAVE state needs to be examined. > > Just to be clear: there are 3 AVX-512 XSAVE states: > > XFEATURE_OPMASK, > XFEATURE_ZMM_Hi256, > XFEATURE_Hi16_ZMM, > > I honestly don't know what XFEATURE_OPMASK does. It does not appear to > be affected by VZEROUPPER (although VZEROUPPER's SDM documentation isn't > looking too great). > > But, XFEATURE_ZMM_Hi256 is used for the upper 256 bits of the > registers ZMM0-ZMM15. Those are AVX-512-only registers. The only way > to get data into XFEATURE_ZMM_Hi256 state is by using AVX512 instructions. > > XFEATURE_Hi16_ZMM is the same. The only way to get state in there is > with AVX512 instructions. > > So, first of all, I think you *MUST* check XFEATURE_ZMM_Hi256 and > XFEATURE_Hi16_ZMM. That's without question. No, XFEATURE_ZMM_Hi256 does not request turbo license 2, so it's less interested to us. > > It's probably *possible* to run AVX512 instructions by loading state > into the YMM register and then executing AVX512 instructions that only > write to memory and never to register state. That *might* allow > XFEATURE_Hi16_ZMM and XFEATURE_ZMM_Hi256 to stay in the init state, but > for the frequency to be affected since AVX512 instructions _are_ > executing. But, there's no way to detect this situation from XSAVE > states themselves. > Andi should have more details on this. FWICT, not all AVX512 instructions has high current, those only touching memory do not cause notable frequency drop. Thanks, -Aubrey