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: Tue, 28 Jul 2015 13:40:58 -0400 Message-ID: <20150728174058.GF5322@mtj.duckdns.org> References: <1438094371-8326-1-git-send-email-pmladek@suse.com> <1438094371-8326-14-git-send-email-pmladek@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1438094371-8326-14-git-send-email-pmladek-IBi9RG/b67k@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 On Tue, Jul 28, 2015 at 04:39:30PM +0200, Petr Mladek wrote: ... > +/* > + * set_kthread_worker_user_nice - set scheduling priority for the kthread worker > + * @worker: target kthread_worker > + * @nice: niceness value > + */ > +void set_kthread_worker_user_nice(struct kthread_worker *worker, long nice) > +{ > + struct task_struct *task = worker->task; > + > + WARN_ON(!task); > + set_user_nice(task, nice); > +} > +EXPORT_SYMBOL(set_kthread_worker_user_nice); kthread_worker is explcitly associated with a single kthread. Why do we want to create explicit wrappers for kthread operations? This is encapsulation for encapsulation's sake. It doesn't buy us anything at all. Just let the user access the associated kthread and operate on it. Thanks. -- tejun