From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Rusty Russell <rusty@rustcorp.com.au>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [Patch 3/7] smpboot: Provide infrastructure for percpu hotplug threads
Date: Sat, 21 Jul 2012 23:31:16 +0530 [thread overview]
Message-ID: <500AEE6C.8060506@linux.vnet.ibm.com> (raw)
In-Reply-To: <500A75D7.3070706@linux.vnet.ibm.com>
On 07/21/2012 02:56 PM, Srivatsa S. Bhat wrote:
> On 07/16/2012 04:12 PM, Thomas Gleixner wrote:
>> Provide a generic interface for setting up and tearing down percpu
>> threads.
>>
>> On registration the threads for already online cpus are created and
>> started. On deregistration (modules) the threads are stoppped.
>>
>> During hotplug operations the threads are created, started, parked and
>> unparked. The datastructure for registration provides a pointer to
>> percpu storage space and optional setup, cleanup, park, unpark
>> functions. These functions are called when the thread state changes.
>>
>> Each implementation has to provide a function which is queried and
>> returns whether the thread should run and the thread function itself.
>>
>> The core code handles all state transitions and avoids duplicated code
>> in the call sites.
>>
>> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>
> Elegant design and very beautiful code!
> It was such a pleasure to read and review it :-)
>
> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>
Of course, the preempt imbalance needs to get resolved, as pointed out
by Paul... Your patchset + his fix worked fine, without throwing any
scheduling-while-atomic splats.
Regards,
Srivatsa S. Bhat
> [ A minor nit below ]
>
>> ---
>> include/linux/smpboot.h | 43 +++++++++
>> kernel/cpu.c | 10 +-
>> kernel/smpboot.c | 229 ++++++++++++++++++++++++++++++++++++++++++++++++
>> kernel/smpboot.h | 4
>> 4 files changed, 285 insertions(+), 1 deletion(-)
>>
>> +
>> +/**
>> + * smpboot_thread_fn - percpu hotplug thread loop function
>> + * @void: thread data pointer
>
> s/void/data
>
>> + *
>> + * Checks for thread stop and park conditions. Calls the necessary
>> + * setup, cleanup, park and unpark functions for the registered
>> + * thread.
>> + *
>> + * Returns 1 when the thread should exit, 0 otherwise.
>> + */
>> +static int smpboot_thread_fn(void *data)
>> +{
>> + struct smpboot_thread_data *td = data;
>> + struct smp_hotplug_thread *ht = td->ht;
>> +
>
> Regards,
> Srivatsa S. Bhat
>
--
Regards,
Srivatsa S. Bhat
IBM Linux Technology Center
next prev parent reply other threads:[~2012-07-21 18:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 10:42 [Patch 0/7] Per cpu thread hotplug infrastructure - V3 Thomas Gleixner
2012-07-16 10:42 ` [Patch 1/7] rcu: Yield simpler Thomas Gleixner
2012-08-13 15:07 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-07-16 10:42 ` [Patch 3/7] smpboot: Provide infrastructure for percpu hotplug threads Thomas Gleixner
2012-07-21 9:26 ` Srivatsa S. Bhat
2012-07-21 18:01 ` Srivatsa S. Bhat [this message]
2012-07-21 17:12 ` Paul E. McKenney
2012-08-13 15:10 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-09-19 21:47 ` [Patch 3/7] " Sasha Levin
2012-10-12 1:39 ` Sasha Levin
2012-07-16 10:42 ` [Patch 2/7] kthread: Implement park/unpark facility Thomas Gleixner
2012-07-21 9:31 ` Srivatsa S. Bhat
2012-08-13 15:08 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-07-16 10:42 ` [Patch 4/7] softirq: Use hotplug thread infrastructure Thomas Gleixner
2012-07-21 17:21 ` Paul E. McKenney
2012-07-23 21:15 ` Paul E. McKenney
2012-07-25 14:21 ` JoonSoo Kim
2012-08-13 15:12 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-07-16 10:42 ` [Patch 6/7] rcu: Use smp_hotplug_thread facility for RCUs per-CPU kthread Thomas Gleixner
2012-07-16 16:59 ` Paul E. McKenney
2012-08-13 15:13 ` [tip:smp/hotplug] " tip-bot for Paul E. McKenney
2012-07-16 10:42 ` [Patch 5/7] watchdog: Use hotplug thread infrastructure Thomas Gleixner
2012-08-13 15:13 ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-08-14 7:20 ` viresh kumar
2012-08-14 8:42 ` Thomas Gleixner
2012-07-16 10:42 ` [Patch 7/7] infiniband: ehca: " Thomas Gleixner
2012-07-17 0:27 ` Rusty Russell
2012-08-13 15:14 ` [tip:smp/hotplug] infiniband: Ehca: " tip-bot for Thomas Gleixner
2012-07-16 15:22 ` [Patch 0/7] Per cpu thread hotplug infrastructure - V3 Paul E. McKenney
2012-07-18 17:36 ` Srivatsa S. Bhat
2012-07-18 23:54 ` Paul E. McKenney
2012-07-20 13:17 ` Srivatsa S. Bhat
2012-07-20 14:35 ` Paul E. McKenney
2012-07-20 15:00 ` Srivatsa S. Bhat
2012-07-20 17:53 ` Paul E. McKenney
2012-07-20 18:28 ` Srivatsa S. Bhat
2012-07-25 12:25 ` Srivatsa S. Bhat
2012-07-25 14:25 ` JoonSoo Kim
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=500AEE6C.8060506@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.