Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3912664imu; Tue, 18 Dec 2018 06:17:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/WyFXK6leZCOko2s93Dzoj3TZ4UnGt4Mcn7hVXtMLeXQcaIeb060RgUIEQR8t76MMict+4n X-Received: by 2002:a17:902:7d82:: with SMTP id a2mr13684091plm.163.1545142620822; Tue, 18 Dec 2018 06:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545142620; cv=none; d=google.com; s=arc-20160816; b=G0/wZY+LhGMqZE/3pTmX8kqYhiGuDE/wUGPXXTYro0H+f8dFKuLn5gBqWtneBiQ60W XcJm6EQXOkogMrcEBoetxkhEeu5xJqvweaEd/su+90A77XreXtFDwTIYcn7cFlV2Uy+5 X290vD0Qkrq3cBfQtuXBvcsB00kicaBKE9KD5J9Tj+LWjfvJC0sjA7QQVDkuvlKpc7Xu Yf+XitFdR1sE9VGXoZi8fespakVzX8Yn9U+CA0fqm+S2Ud94eb7FxghZtt3bOCtmwrnF xxLPTRwa2W63THsVTn2kdP17p7jtRQpCmUeVuD4DcNd786+xsIggkQhXsRzrN9pXNPny tMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=fQv3DbEv1btOkMirLCuSgFhqxTyck0WI3P8XFpJZbdU=; b=pdsvGwKqT5kKCld4UJeVS5O0hcY1Zf/+B88OCEdebiFdFastixTiPyo/x32nGpJAJo F8Whqym1KJkyzpIRBfbmwz2rJYfolrMzqnLYX+EZBmcYPPIcy/h0G/JOqHkdMdYW60xO VmqyNcAxR4SOboDsNr3rREd1fixA7eAkAEN2VZZaHa1+wSPJqTsVeW+AAD81q/2oq1iN sy9bBWhCR8eQDxcRdYXURfoFFR0jLa2tWxLvaFu89fpzwW1rL0MTJ1iAHEjZSYJkdYxB GJIzg2rT0OwaT3U/uKLfMBcm2vubFUja/0B00N3ED4JBsiVrBnEKtRnY0rJrVLH0ULLA N77g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si11124757pgx.178.2018.12.18.06.16.45; Tue, 18 Dec 2018 06:17:00 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbeLROPS (ORCPT + 99 others); Tue, 18 Dec 2018 09:15:18 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:56197 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbeLROPS (ORCPT ); Tue, 18 Dec 2018 09:15:18 -0500 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gZG98-0002vn-Id; Tue, 18 Dec 2018 15:14:54 +0100 Date: Tue, 18 Dec 2018 15:14:53 +0100 (CET) From: Thomas Gleixner To: 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, Aubrey Li Subject: Re: [PATCH v6 1/3] x86/fpu: track AVX-512 usage of tasks In-Reply-To: <20181218042218.8653-1-aubrey.li@intel.com> Message-ID: References: <20181218042218.8653-1-aubrey.li@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, tglx