From: Petr Mladek Subject: Re: [RFC PATCH 06/14] kthread: Add kthread_worker_created() Date: Wed, 29 Jul 2015 12:07:37 +0200 Message-ID: <20150729100737.GJ2673@pathway.suse.cz> References: <1438094371-8326-1-git-send-email-pmladek@suse.com> <1438094371-8326-7-git-send-email-pmladek@suse.com> <20150728172657.GC5322@mtj.duckdns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20150728172657.GC5322-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tejun Heo Cc: Andrew Morton , Oleg Nesterov , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Vlastimil Babka , live-patching-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On Tue 2015-07-28 13:26:57, Tejun Heo wrote: > Hello, > > On Tue, Jul 28, 2015 at 04:39:23PM +0200, Petr Mladek wrote: > > I would like to make cleaner kthread worker API and hide the definition > > of struct kthread_worker. It will prevent any custom hacks and make > > the API more secure. > > > > This patch provides an API to check if the worker has been created > > and hides the implementation details. > > Maybe it'd be a better idea to make create_kthread_worker() allocate > and return pointer to struct kthread_worker? You're adding > create/destroy interface anyway, it won't need a separate created > query function and the synchronization rules would be self-evident. Makes sense. I actually did it this way in one temporary version and reverted it from some ugly reason. Best Regards, Petr