[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100621133321.6215b85b.randy.dunlap@oracle.com>
Date: Mon, 21 Jun 2010 13:33:21 -0700
From: Randy Dunlap <randy.dunlap@...cle.com>
To: Tejun Heo <tj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andy Walls <awalls@...metrocast.net>,
Daniel Walker <dwalker@...eaurora.org>, mingo@...e.hu,
linux-kernel@...r.kernel.org, jeff@...zik.org,
rusty@...tcorp.com.au, cl@...ux-foundation.org,
dhowells@...hat.com, arjan@...ux.intel.com,
johannes@...solutions.net, oleg@...hat.com, axboe@...nel.dk,
mst@...hat.com, samudrala.sridhar@...il.com
Subject: Re: [PATCH] kthread: implement kthread_worker
On Sat, 19 Jun 2010 17:53:55 +0200 Tejun Heo wrote:
> include/linux/kthread.h | 63 +++++++++++++++++++++++++
> kernel/kthread.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 181 insertions(+)
>
> Index: work/kernel/kthread.c
> ===================================================================
> --- work.orig/kernel/kthread.c
> +++ work/kernel/kthread.c
> @@ -247,3 +249,119 @@ int kthreadd(void *unused)
>
> return 0;
> }
> +
> +/**
> + * kthread_worker_fn - kthread function to process kthread_worker
> + * @data: pointer to initialized kthread_worker
s/data/worker_ptr/
> + *
> + * This function can be used as @threadfn to kthread_create() or
> + * kthread_run() with @data argument pointing to an initialized
ditto.
> + * kthread_worker. The started kthread will process work_list until
> + * the it is stopped with kthread_stop(). A kthread can also call
> + * this function directly after extra initialization.
> + *
> + * Different kthreads can be used for the same kthread_worker as long
> + * as there's only one kthread attached to it at any given time. A
> + * kthread_worker without an attached kthread simply collects queued
> + * kthread_works.
> + */
> +int kthread_worker_fn(void *worker_ptr)
> +{
> + struct kthread_worker *worker = worker_ptr;
> + struct kthread_work *work;
> +
> + WARN_ON(worker->task);
> + worker->task = current;
> +repeat:
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists