[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrXhED=5LHJsooOFsMEODDxocr=eJ_MvuS+oP8K85Nb6Yg@mail.gmail.com>
Date: Thu, 16 Jul 2015 15:57:43 -0700
From: Andy Lutomirski <luto@...capital.net>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Dave Hansen <dave@...1.net>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, X86 ML <x86@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] x86, fpu: dynamically allocate 'struct fpu'
On Thu, Jul 16, 2015 at 3:42 PM, H. Peter Anvin <hpa@...or.com> wrote:
> On 07/16/2015 12:14 PM, Dave Hansen wrote:
>> The FPU rewrite removed the dynamic allocations of 'struct fpu'.
>> But, this potentially wastes massive amounts of memory (2k per
>> task on systems that do not have AVX-512 for instance).
>>
>> Instead of having a separate slab, this patch just appends the
>> space that we need to the 'task_struct' which we dynamically
>> allocate already. This saves from doing an extra slab allocation
>> at fork(). The only real downside here is that we have to stick
>> everything and the end of the task_struct. But, I think the
>> BUILD_BUG_ON()s I stuck in there should keep that from being too
>> fragile.
>>
>> This survives a quick build and boot in a VM. Does anyone see any
>> real downsides to this?
>>
>
> No. I have also long advocated for merging task_struct and thread_info
> into a common structure and get it off the stack; it would improve
> security and avoid weird corner cases in the irqstack handling.
>
In tip/x86/asm, entry_64.S only references thread_info in two places,
both in the syscall code. I'm hoping that we can move that code into
C soon and that we can do the same thing to the 32-bit code. If we do
that, then we could just move ti->flags into thread_struct.
Everything else should be easy, and then thread_info would be empty.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists