Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754616AbcJUIIL (ORCPT ); Fri, 21 Oct 2016 04:08:11 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50823 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbcJUIII (ORCPT ); Fri, 21 Oct 2016 04:08:08 -0400 Date: Fri, 21 Oct 2016 10:05:08 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Andy Lutomirski , Roman Pen , Andy Lutomirski , Josh Poimboeuf , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Ingo Molnar , Tejun Heo , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] x86/dumpstack: on oops do not rewind stack for kthread In-Reply-To: <20161021055630.GA3102@twins.programming.kicks-ass.net> Message-ID: References: <20160921154350.13128-1-roman.penyaev@profitbricks.com> <20161021055630.GA3102@twins.programming.kicks-ass.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 804 Lines: 26 On Fri, 21 Oct 2016, Peter Zijlstra wrote: > We need to preserve the entire struct kthread on the stack, kthread just > abuses that pointer to stash an on-stack kthread descriptor. See > kthread(): > > current->vfork_done = &self.exited; > > Its a horrible horrible thing kthread does. I suppose there might have > been some intent by keeping that exited completion last in the > structure, but *shudder*. > > But yes, leaving enough stack to not clobber that might keep this horror > show working. > > ISTR talk about alternative schemes for this a long time ago, but I > cannot recall :-( The simplest solution would be to stick struct kthread into task_struct, but that's bloat. But we can allocate it seperately along with kthread_create_info. That's pretty straight forward. Thanks, tglx