linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Petr Mladek <pmladek@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>, Tejun Heo <tj@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jiri Kosina <jkosina@suse.cz>, Borislav Petkov <bp@suse.de>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, Vlastimil Babka <vbabka@suse.cz>,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 02/12] kthread: Kthread worker API cleanup
Date: Thu, 9 Jun 2016 11:07:10 -0400	[thread overview]
Message-ID: <20160609110710.510c7c67@gandalf.local.home> (raw)
In-Reply-To: <1465480326-31606-3-git-send-email-pmladek@suse.com>

On Thu,  9 Jun 2016 15:51:56 +0200
Petr Mladek <pmladek@suse.com> wrote:

> A good practice is to prefix the names of functions and macros
> by the name of the subsystem.
> 
> The kthread worker API is a mix of classic kthreads and workqueues.
> Each worker has a dedicated kthread. It runs a generic function
> that process queued works. It is implemented as part of
> the kthread subsystem.
> 
> This patch renames the existing kthread worker API to use
> the corresponding name from the workqueues API prefixed by
> kthread_/KTHREAD_:
> 
> DEFINE_KTHREAD_WORKER()		-> KTHREAD_DECLARE_WORKER()
> DEFINE_KTHREAD_WORK()		-> KTHREAD_DECLARE_WORK()
> DEFINE_KTHREAD_WORKER_ONSTACK()	-> KTHREAD_DECLARE_WORKER_ONSTACK()
> DEFINE_KTHREAD_WORKER_ONSTACK()	-> KTHREAD_DECLARE_WORKER_ONSTACK()
> __init_kthread_worker()		-> __kthread_init_worker()
> init_kthread_worker()		-> kthread_init_worker()
> init_kthread_work()		-> kthread_init_work()
> insert_kthread_work()		-> kthread_insert_work()
> queue_kthread_work()		-> kthread_queue_work()
> flush_kthread_work()		-> kthread_flush_work()
> flush_kthread_worker()		-> kthread_flush_worker()
> 

I know that Andrew suggested this, but I didn't get a chance to respond
to his email due to traveling.

Does this mean we are going to change all APIs like this? Because we
pretty much use this type of naming everywhere. That is, we start with
"DEFINE_*" and "DECLARE_*" commonly. As well as "init_*".

For example DEFINE_PER_CPU(), DEFINE_SPINLOCK(), DEFINE_LGLOCK(),
DEFINE_MUTEX(), DEFINE_RES_MEME(), DEFINE_TIMER(), DEFINE_IDA(),
DEFINE_NFS4_*(), and the list goes on. Just do a grep in
include/linux/*.h for DEFINE_ and DECLARE_.

Also, are you sure that we should change the DEFINE to a DECLARE,
because DEFINE is used to create the object in question, DECLARE is for
header files:

X.h:

DECLARE_PER_CPU(int, x);


X.c


DEFINE_PER_CPU(int, x);


-- Steve

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-06-09 15:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 13:51 [PATCH v8 00/12] kthread: Kthread worker API improvements Petr Mladek
2016-06-09 13:51 ` [PATCH v8 01/12] kthread: Rename probe_kthread_data() to kthread_probe_data() Petr Mladek
2016-06-09 13:51 ` [PATCH v8 02/12] kthread: Kthread worker API cleanup Petr Mladek
2016-06-09 15:07   ` Steven Rostedt [this message]
2016-06-10 22:29     ` Andrew Morton
2016-06-13 15:13       ` Petr Mladek
2016-06-13 16:03         ` Steven Rostedt
2016-06-09 17:22   ` Peter Zijlstra
2016-06-09 13:51 ` [PATCH v8 03/12] kthread/smpboot: Do not park in kthread_create_on_cpu() Petr Mladek
2016-06-09 13:51 ` [PATCH v8 04/12] kthread: Allow to call __kthread_create_on_node() with va_list args Petr Mladek
2016-06-09 13:51 ` [PATCH v8 05/12] kthread: Add kthread_create_worker*() Petr Mladek
2016-06-09 13:52 ` [PATCH v8 06/12] kthread: Add kthread_drain_worker() Petr Mladek
2016-06-09 13:52 ` [PATCH v8 07/12] kthread: Add kthread_destroy_worker() Petr Mladek
2016-06-09 13:52 ` [PATCH v8 08/12] kthread: Detect when a kthread work is used by more workers Petr Mladek
2016-06-09 13:52 ` [PATCH v8 09/12] kthread: Initial support for delayed kthread work Petr Mladek
2016-06-09 13:52 ` [PATCH v8 10/12] kthread: Allow to cancel " Petr Mladek
2016-06-09 13:52 ` [PATCH v8 11/12] kthread: Allow to modify delayed " Petr Mladek
2016-06-09 13:52 ` [PATCH v8 12/12] kthread: Better support freezable kthread workers Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160609110710.510c7c67@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=jkosina@suse.cz \
    --cc=josh@joshtriplett.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox