From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [RFC PATCH 13/14] kthread_worker: Add set_kthread_worker_user_nice() Date: Wed, 29 Jul 2015 11:12:02 -0400 Message-ID: <20150729151202.GB3504@mtj.duckdns.org> References: <1438094371-8326-1-git-send-email-pmladek@suse.com> <1438094371-8326-14-git-send-email-pmladek@suse.com> <20150728174058.GF5322@mtj.duckdns.org> <20150729112354.GK2673@pathway.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20150729112354.GK2673-KsEp0d+Q8qECVLCxKZUutA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Petr Mladek 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 Hello, On Wed, Jul 29, 2015 at 01:23:54PM +0200, Petr Mladek wrote: > My plan is to make the API cleaner and hide struct kthread_worker > definition into kthread.c. It would prevent anyone doing any hacks > with it. BTW, we do the same with struct workqueue_struct. I think obsessive attachment to cleanliness tends to worse code in general like simple several liner wrappers which don't do anything other than increasing interface surface and obscuring what's going on. Let's please take a reasonable trade-off. It shouldn't be nasty but we don't want to be paying unnecessary complexity for perfect purity either. > Another possibility would be to add helper function to get the > associated task struct but this might cause inconsistencies when > the worker is restarted. A kthread_worker would be instantiated on the create call and released on destroy and the caller is natrually expected to synchronize creation and destruction against all other operations. Nothing seems complicated or subtle to me. Thanks. -- tejun