Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941385AbcJXRIn (ORCPT ); Mon, 24 Oct 2016 13:08:43 -0400 Received: from mail-ua0-f179.google.com ([209.85.217.179]:40434 "EHLO mail-ua0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933711AbcJXRIm (ORCPT ); Mon, 24 Oct 2016 13:08:42 -0400 MIME-Version: 1.0 In-Reply-To: <20161024160814.3126-1-roman.penyaev@profitbricks.com> References: <20161024160814.3126-1-roman.penyaev@profitbricks.com> From: Andy Lutomirski Date: Mon, 24 Oct 2016 10:08:20 -0700 Message-ID: Subject: Re: [PATCH v2 1/2] kthread: allocate kthread structure using kmalloc To: Roman Pen Cc: Andy Lutomirski , Oleg Nesterov , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Tejun Heo , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 627 Lines: 13 On Mon, Oct 24, 2016 at 9:08 AM, Roman Pen wrote: > This patch avoids allocation of kthread structure on a stack, and simply > uses kmalloc. Allocation on a stack became a huge problem (with memory > corruption and all other not nice consequences) after the commit 2deb4be28 > by Andy Lutomirski, which rewinds the stack on oops, thus ooopsed kthread > steps on a garbage memory while completion of task->vfork_done structure > on the following path: This is IMO a *huge* improvement. Shouldn't the patch also remove the try_get_task_stack() / put_task_stack() hackery in kthread.c, though?