From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424901AbcFMQDo (ORCPT ); Mon, 13 Jun 2016 12:03:44 -0400 Received: from smtprelay0095.hostedemail.com ([216.40.44.95]:49447 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1424288AbcFMQDm (ORCPT ); Mon, 13 Jun 2016 12:03:42 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3870:3871:3872:3873:3874:4250:4385:5007:6261:6742:7875:7903:9707:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12438:12517:12519:12740:13439:14096:14097:14181:14659:14721:21080:21326:30012:30041:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: neck20_76a25dc689d28 X-Filterd-Recvd-Size: 4302 Date: Mon, 13 Jun 2016 12:03:33 -0400 From: Steven Rostedt To: Petr Mladek Cc: Andrew Morton , Oleg Nesterov , Tejun Heo , Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 02/12] kthread: Kthread worker API cleanup Message-ID: <20160613120333.47141cd9@gandalf.local.home> In-Reply-To: <20160613151353.GA2725@pathway.suse.cz> References: <1465480326-31606-1-git-send-email-pmladek@suse.com> <1465480326-31606-3-git-send-email-pmladek@suse.com> <20160609110710.510c7c67@gandalf.local.home> <20160610152905.e99933d99108fa6d9f8d4dca@linux-foundation.org> <20160613151353.GA2725@pathway.suse.cz> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jun 2016 17:13:53 +0200 Petr Mladek wrote: > OK, all wants to keep DEFINE stuff as is: > > DEFINE_KTHREAD_WORKER() stay > DEFINE_KTHREAD_WORK() stay > DEFINE_KTHREAD_WORKER_ONSTACK() stay > DEFINE_KTHREAD_WORKER_ONSTACK() stay > > > Nobody was against renaming the non-init functions: > > insert_kthread_work() -> kthread_insert_work() > queue_kthread_work() -> kthread_queue_work() > flush_kthread_work() -> kthread_flush_work() > flush_kthread_worker() -> kthread_flush_worker() Yep. > > > > Now, the question seem to be the init() functions. > Andrew would prefer: > > __init_kthread_worker() -> __kthread_worker_init() > init_kthread_worker() -> kthread_worker_init() > init_kthread_work() -> kthread_work_init() > > AFAIK, Steven would prefer to keep it > > __init_kthread_worker() stay as is > init_kthread_worker() stay as is > init_kthread_work() stay as is > > I would personally prefer the way from this patch: > > __init_kthread_worker() -> __kthread_init_worker() > init_kthread_worker() -> kthread_init_worker() > init_kthread_work() -> kthread_init_work() > > > I have several reasons: > > 1. The init functions will be used close to the other functions in > the code. It will be easier if all functions use the same > naming scheme. Here are some snippets: > > kthread_init_work(&w_data->balancing_work, clamp_balancing_func); > kthread_init_delayed_work(&w_data->idle_injection_work, > clamp_idle_injection_func); > kthread_queue_work(w_data->worker, &w_data->balancing_work); > > or > > kthread_init_delayed_work(&kmemleak_scan_work, kmemleak_scan_func); > kmemleak_scan_worker = kthread_create_worker(0, "kmemleak"); > > > 2. We are going to add kthread_destroy_worker() which would need > to be another exception. Also this function will be used together > with the others, for example: > > kthread_cancel_delayed_work_sync(&rb_producer_hammer_work); > kthread_destroy_worker(rb_producer_worker); > > Also here the same naming scheme will help. > > > 3. It is closer to the workqueues API, so it reduces confusion. Using workqueues as an example of "reduces confusion" is not the most convincing argument ;-) > > 4. Note that there are already several precedents, for example: > > amd_iommu_init_device() > free_area_init_node() > jump_label_init_type() > regmap_init_mmio_clk() > > > Andrew, Steven, are you really so strongly against my version > of the init functions, please? > > I don't really have that strong opinion on the "init" part. I was much more concerned about the DEFINE/DECLARE macros. -- Steve