From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754547AbbGPJK1 (ORCPT ); Thu, 16 Jul 2015 05:10:27 -0400 Received: from www.sr71.net ([198.145.64.142]:45125 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbbGPJKZ (ORCPT ); Thu, 16 Jul 2015 05:10:25 -0400 Message-ID: <55A774FF.3060208@sr71.net> Date: Thu, 16 Jul 2015 02:10:23 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 CC: torvalds@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, luto@amacapital.net, bp@alien8.de, fenghua.yu@intel.com, hpa@zytor.com, oleg@redhat.com, tglx@linutronix.de, ross.zwisler@linux.intel.com Subject: Re: [RFC][PATCH 2/2] x86, fpu: enlarge xregs_state References: <20150716081332.9413DD5B@viggo.jf.intel.com> <20150716081332.641D2B2F@viggo.jf.intel.com> In-Reply-To: <20150716081332.641D2B2F@viggo.jf.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/16/2015 01:13 AM, Dave Hansen wrote: > +/* > + * The largest xsave buffer known today is 2752 bytes on a system > + * implementing AVX-512. This includes the 512-byte i387 state > + * and 64-byte header. We add a small amount of padding in case > + * an implementation adds some padding or wastes some space. > + * > + * Note, if we overflow this, we will disable XSAVE completely. > + * > + * Also, note that the real size we need is enumerated by > + * cpuid leaves and can not be known at compile time. > + */ > +#define XSTATE_MAX_SIZE (2752 + 256) BTW, this has one big-ish side-effect. It takes the size of task_struct from ~3.5k to ~5.4k for me: slabinfo before: task_struct 198 198 3456 9 8 : ... after: task_struct 166 180 5376 6 8 : ... I'm sure folks on small systems are going to cringe at eating 2k/thread, so we've got to revisit this _somehow_.