Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3975994imu; Tue, 18 Dec 2018 07:12:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xt1CUx302WdqSpkmNVUC4lbUIYyWKOlEcMb+rIRd2b8aj2wBswKK8cshBnbL2D5EyWsVpJ X-Received: by 2002:a17:902:b60a:: with SMTP id b10mr15644685pls.303.1545145971728; Tue, 18 Dec 2018 07:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545145971; cv=none; d=google.com; s=arc-20160816; b=blIL4tzNhaigXWdD5dWGdPGCFy/qZmTgx2UwRuSIWqZltV4ySg9iMlCy2Ywr6aNzvh lQuWrVWs6LWWiau99KD81PwdgQ7d6xbci1ny3DoTHP3LkbcbHnh06IGHRxKQ/6YVdliT qRkgY4JK4ZO1QQ9bvyUjQuFvIfBwcLgEaKQCipL5llKTjwBqm3ca/PFbTZRrTV1P2Wt2 kNcEFIfQP+JX8mAV5UAtobWFqieSnV3nZR1L7jUWI7LPx9Yx0jgMNjxpgXLmiXaxCVeM FqvoXQ5NXNH9LicFNCbmWNFkRtcstEtbm9DQBPYh66lz+UxiKoJTLl9FpMzZL5KMWT1Z SJ0Q== 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=E4x5HQDodtHrheYx0JmZLKF0ZRdFFeIYLSi8p2eBj+g=; b=MJN/OPnLHBXR5kFFaVYNHow7B6mCU3Mh5TPQPFNHc61rKwRRVzpohujFpf/IrLYL8p 2DheuPFIsXo0r9/QK2ZKZ87o8ncyfgctssJe/0tZLo8BoZyOLKCCQ9Y0vW0IwDFE0Yc1 28chhhj5DZGkCW4aryOD0cAZYcHpXqfuf62fMe9YU+UwygF9SM6fKFv+JGnRwfshu30D Oam0272/CEB/F/BbGi5rbBDx62QPVJHQ5kkpbwkB3iseotkTJ4vmQhVtosXPaBwxG62U asMkdaD+/Srerm5Zwi4TEs0ndo7tgBVlbAZlsLuza4XGl/Kgf9Ii0Jfi8Q2a/cZagsQS o/mQ== 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 30si3558045pgv.191.2018.12.18.07.12.34; Tue, 18 Dec 2018 07:12:51 -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 S1726726AbeLRPLn (ORCPT + 99 others); Tue, 18 Dec 2018 10:11:43 -0500 Received: from mga14.intel.com ([192.55.52.115]:23191 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbeLRPLn (ORCPT ); Tue, 18 Dec 2018 10:11:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2018 07:11:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,368,1539673200"; d="scan'208";a="119805608" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.118]) ([10.239.161.118]) by orsmga001.jf.intel.com with ESMTP; 18 Dec 2018 07:11:40 -0800 Subject: Re: [PATCH v6 1/3] x86/fpu: track AVX-512 usage of tasks To: Thomas Gleixner , Aubrey Li Cc: mingo@redhat.com, peterz@infradead.org, hpa@zytor.com, ak@linux.intel.com, tim.c.chen@linux.intel.com, dave.hansen@intel.com, arjan@linux.intel.com, linux-kernel@vger.kernel.org References: <20181218042218.8653-1-aubrey.li@intel.com> From: "Li, Aubrey" Message-ID: <62997df2-0817-b54d-b11e-00a567f1d67c@linux.intel.com> Date: Tue, 18 Dec 2018 23:11:39 +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/12/18 22:14, Thomas Gleixner wrote: > On Tue, 18 Dec 2018, Aubrey Li wrote: >> diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h >> index a38bf5a1e37a..8778ac172255 100644 >> --- a/arch/x86/include/asm/fpu/internal.h >> +++ b/arch/x86/include/asm/fpu/internal.h >> @@ -411,6 +411,13 @@ static inline int copy_fpregs_to_fpstate(struct fpu *fpu) >> { >> if (likely(use_xsave())) { >> copy_xregs_to_kernel(&fpu->state.xsave); >> + >> + /* >> + * AVX512 state is tracked here because its use is >> + * known to slow the max clock speed of the core. >> + */ >> + if (fpu->state.xsave.header.xfeatures & XFEATURE_MASK_AVX512) >> + fpu->avx512_timestamp = jiffies_64; > > Even if unlikely this is incorrect when running a 32 bit kernel because > there jiffies_64 cannot be atomically loaded vs. a concurrent update. See > the comment in include/linux/jiffies.h right above the jiffies_64 > declaration. > Yeah, I noticed this, because this is under use_xsave() condition, also need valid AVX512 state, so a 32 bit kernel won't enter this branch. Thanks, -Aubrey