From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754569AbcFPTj3 (ORCPT ); Thu, 16 Jun 2016 15:39:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45325 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753796AbcFPTj1 (ORCPT ); Thu, 16 Jun 2016 15:39:27 -0400 Date: Thu, 16 Jun 2016 14:39:23 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Andy Lutomirski , "linux-kernel@vger.kernel.org" , X86 ML , Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Linus Torvalds , Vladimir Davydov , Johannes Weiner , Michal Hocko , "linux-mm@kvack.org" Subject: Re: [PATCH 04/13] mm: Track NR_KERNEL_STACK in pages instead of number of stacks Message-ID: <20160616193923.hyma4vcmr7lvklcx@treble> References: <24279d4009c821de64109055665429fad2a7bff7.1466036668.git.luto@kernel.org> <20160616153339.xvlsnhksqmkeusn4@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Jun 2016 19:39:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2016 at 10:39:43AM -0700, Andy Lutomirski wrote: > On Thu, Jun 16, 2016 at 8:33 AM, Josh Poimboeuf wrote: > > On Wed, Jun 15, 2016 at 05:28:26PM -0700, Andy Lutomirski wrote: > >> Currently, NR_KERNEL_STACK tracks the number of kernel stacks in a > >> zone. This only makes sense if each kernel stack exists entirely in > >> one zone, and allowing vmapped stacks could break this assumption. > >> > >> It turns out that the code for tracking kernel stack allocations in > >> units of pages is slightly simpler, so just switch to counting > >> pages. > >> > >> Cc: Vladimir Davydov > >> Cc: Johannes Weiner > >> Cc: Michal Hocko > >> Cc: linux-mm@kvack.org > >> Signed-off-by: Andy Lutomirski > >> --- > >> fs/proc/meminfo.c | 2 +- > >> kernel/fork.c | 3 ++- > >> mm/page_alloc.c | 3 +-- > >> 3 files changed, 4 insertions(+), 4 deletions(-) > > > > You missed another usage of NR_KERNEL_STACK in drivers/base/node.c. > > Thanks. > > The real reason I cc'd you was so you could look at > rewind_stack_do_exit and the sneaky trick I did in no_context in the > last patch, though. :) Both survive objtool, but I figured I'd check > with objtool's author as well. If there was a taint bit I could set > saying "kernel is hosed -- don't try to apply live patches any more", > I'd have extra confidence. I think it all looks fine from an objtool and a live patching standpoint. Other than my previous comment about setting the stack pointer correctly before calling do_exit(), I didn't see anything else which would mess up the stack of a sleeping task, which is all I really care about. -- Josh