From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933541AbaE3PzP (ORCPT ); Fri, 30 May 2014 11:55:15 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44982 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413AbaE3PzN (ORCPT ); Fri, 30 May 2014 11:55:13 -0400 Message-ID: <5388A935.9050506@zytor.com> Date: Fri, 30 May 2014 08:52:21 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Linus Torvalds CC: Dave Chinner , Minchan Kim , Dave Jones , Jens Axboe , Linux Kernel Mailing List , Andrew Morton , linux-mm , Ingo Molnar , Peter Zijlstra , Mel Gorman , Rik van Riel , Johannes Weiner , Hugh Dickins , Rusty Russell , "Michael S. Tsirkin" , Dave Hansen , Steven Rostedt , PJ Waskiewicz Subject: Re: [RFC 2/2] x86_64: expand kernel stack to 16K References: <20140528223142.GO8554@dastard> <20140529013007.GF6677@dastard> <20140529072633.GH6677@dastard> <20140529235308.GA14410@dastard> <20140530000649.GA3477@redhat.com> <20140530002113.GC14410@dastard> <20140530003219.GN10092@bbox> <20140530013414.GF14410@dastard> <5388A2D9.3080708@zytor.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2014 08:41 AM, Linus Torvalds wrote: > On Fri, May 30, 2014 at 8:25 AM, H. Peter Anvin wrote: >> >> If we removed struct thread_info from the stack allocation then one >> could do a guard page below the stack. Of course, we'd have to use IST >> for #PF in that case, which makes it a non-production option. > > We could just have the guard page in between the stack and the > thread_info, take a double fault, and then just map it back in on > double fault. > Oh, duh. Right, much better. Similar to the espfix64 hack, too. > That would give us 8kB of "normal" stack, with a very loud fault - and > then an extra 7kB or so of stack (whatever the size of thread-info is) > - after the first time it traps. > > That said, it's still likely a non-production option due to the page > table games we'd have to play at fork/clone time. Still, seems much more tractable. I would still like struct thread_info off the stack allocation for other reasons (as we have discussed in the past.) -hpa