From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965196AbcJYPoi (ORCPT ); Tue, 25 Oct 2016 11:44:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938482AbcJYPoh (ORCPT ); Tue, 25 Oct 2016 11:44:37 -0400 Date: Tue, 25 Oct 2016 17:43:02 +0200 From: Oleg Nesterov To: Roman Pen Cc: Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Tejun Heo , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] kthread: allocate kthread structure using kmalloc Message-ID: <20161025154301.GA12015@redhat.com> References: <20161025110508.9052-1-roman.penyaev@profitbricks.com> <20161025140333.GB4326@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161025140333.GB4326@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Oct 2016 15:44:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/25, Oleg Nesterov wrote: > > On 10/25, Roman Pen wrote: > > > > This patch avoids allocation of kthread structure on a stack, and simply > > uses kmalloc. > > Oh. I didn't even read this patch, but I have to admit I personally do not > like it. I can be wrong, but imo this is the step to the wrong direction. And after I tried to actually read it I dislike it even more, sorry Roman. Starting from the fact it moves kthread_create_info into struct kthread. > struct kthread is already bloated, we should not bloat it more. Instead > we should kill it. And to_kthread() too, at least in its current form. Yes, but even if we can't or do not want to do this, even if we want to kmalloc struct kthread, I really think it should not be refcounted separately from task_struct. something like the patch in http://marc.info/?l=linux-kernel&m=146715459127804 Either way to_live_kthread() must go away. Currently we can't avoid it because we abuse vfork_done, but as I already said we no longer need this. Oleg.