Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933173AbcKNLND (ORCPT ); Mon, 14 Nov 2016 06:13:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:37715 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753521AbcKNLM5 (ORCPT ); Mon, 14 Nov 2016 06:12:57 -0500 Date: Mon, 14 Nov 2016 12:12:55 +0100 From: Petr Mladek To: Oleg Nesterov Cc: Thomas Gleixner , Andy Lutomirski , Roman Pen , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Tejun Heo , "linux-kernel@vger.kernel.org" , Chunming Zhou , Alex Deucher Subject: Re: [PATCH 1/1] kthread: don't abuse kthread_create_on_cpu() in __kthread_create_worker() Message-ID: <20161114111255.GB32499@pathway.suse.cz> References: <20161026155155.GA28832@redhat.com> <20161028161106.GA8933@redhat.com> <20161031200729.GA19430@redhat.com> <20161031200823.GC19430@redhat.com> <20161109172743.GB26446@redhat.com> <20161110171957.GA28264@redhat.com> <20161110172030.GB28264@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161110172030.GB28264@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1082 Lines: 26 On Thu 2016-11-10 18:20:31, Oleg Nesterov wrote: > kthread_create_on_cpu() sets KTHREAD_IS_PER_CPU and kthread->cpu, this > only makes sense if this kthread can be parked/unparked by cpuhp code. > kthread workers never call kthread_parkme() so this has no effect. Yes. > Change __kthread_create_worker() to simply call kthread_bind(task, cpu). > The very fact that kthread_create_on_cpu() doesn't accept a generic fmt > shows that it should not be used outside of smpboot.c. > > Now, the only reason we can not unexport this helper and move it into > smpboot.c is that it sets kthread->cpu and struct kthread is not exported. > And the only reason we can not kill kthread->cpu is that kthread_unpark() > is used by drivers/gpu/drm/amd/scheduler/gpu_scheduler.c and thus we can > not turn _unpark into kthread_unpark(struct smp_hotplug_thread *, cpu). > > Signed-off-by: Oleg Nesterov The change looks fine to me. Feel free to add one or both of these: Reviewed-by: Petr Mladek Tested-by: Petr Mladek Best Regards, Petr