Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2064003imu; Wed, 12 Dec 2018 08:56:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/WycuBb9CM/ERqTEDZ6pPllwozzZMmfXeYY8qn3maFEul28rJnallNe47FR6sBiCKoN+Jeo X-Received: by 2002:a63:c447:: with SMTP id m7mr412302pgg.27.1544633778717; Wed, 12 Dec 2018 08:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544633778; cv=none; d=google.com; s=arc-20160816; b=BNkI+z76okDeGZIB9AsGr72joEjFMYzxy0ByhYh2iw1V3aHs6dSYpRd36Y2yPlLZh5 mNLb3fHQ2jnbFNCc1Rahw5Llai/wXsdiJIQyqM9YuRIiqXx2bKpfC3iopeWl8C339MMy a2fBonnI5FJ+lO1yuLKGrPlmwLPayhbhYKhgJlK8hwbKI3lsU+lEGD+CIlddlJD+xM+U Y5vNh3ZI1reESBSPkXxCNryYsFXH9uAvNHGuM9aDbsz6AR4dv3jipgRnZrxd26XeqlX2 X3ZRyxGYrU8/HuUE5G+7pN/je0p5JpGPOyAi531XHMHldnCEUpQ6r0F/IkF5KUiHJk4B 4WUA== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=e5O8yuZPZ+MYa4ZqMGuB3M9Ylg0MsIURNC70qWfR8nU=; b=SDkPA5GNz/HgbkDto43YdzWwzBgF2wOtg8rJchmQaKgljYdXgIO+EP28QP+CRsoUIL K87ROl/P2H7DmZ19fYdc2jj7VCGvYDyrgp7iRzfZtmw/97hSfegf9j4vRk49yka9G6lo w7sFpkU6acJRalpcJ3S05LU7oxk6IdrGbRn3R9ncgomV6/9bcIKgLoJh1b6mU4cmNck9 JIUMqwTb0R5JnBB2iNWNk4M35lkf2jzvbnJobzhwLDVxEZR8/qH+a8BvnlbMrodY1Hd1 OlA83456uz/c2/p8n9+14e5C07U762Ou6ysbRz+qBHri0uosPvUVTAZ8PjPuKRdE6POZ IKJg== 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 s8si14567532pgl.503.2018.12.12.08.56.03; Wed, 12 Dec 2018 08:56:18 -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 S1727867AbeLLQzK convert rfc822-to-8bit (ORCPT + 99 others); Wed, 12 Dec 2018 11:55:10 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:27171 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbeLLQzJ (ORCPT ); Wed, 12 Dec 2018 11:55:09 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-163-4NpIjPwqOC6IG_9isv_0zg-1; Wed, 12 Dec 2018 16:55:06 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 12 Dec 2018 16:55:17 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 12 Dec 2018 16:55:17 +0000 From: David Laight To: '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" , "dave.hansen@intel.com" , "arjan@linux.intel.com" , "linux-kernel@vger.kernel.org" , Aubrey Li Subject: RE: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks Thread-Topic: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks Thread-Index: AQHUkSUo7xJBKZwc2k62yoB0IvRxl6V7UyiQ Date: Wed, 12 Dec 2018 16:55:17 +0000 Message-ID: References: <20181211002448.3520-1-aubrey.li@intel.com> In-Reply-To: <20181211002448.3520-1-aubrey.li@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: 4NpIjPwqOC6IG_9isv_0zg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aubrey Li > Sent: 11 December 2018 00:25 > > User space tools which do automated task placement need information > about AVX-512 usage of tasks, because AVX-512 usage could cause core > turbo frequency drop and impact the running task on the sibling CPU. > > The XSAVE hardware structure has bits that indicate when valid state > is present in registers unique to AVX-512 use. Use these bits to > indicate when AVX-512 has been in use and add per-task AVX-512 state > tracking to context switch. Isn't a thread likely to clear the AVX registers at the end of a function that uses them. In particular this removes the massive overhead on certain cpus of switching between two AVX modes. So it is actually unlikely that XSAVE will need to save them at all? As I've also said before the registers are caller saved and since systems calls are normal function calls the application code would have to save them across a system call. This allows the kernel to zero the registers on system call entry again meaning that XSAVE won't normally have to save them. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)