lkml.org 
[lkml]   [2012]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch 3/7] smpboot: Provide infrastructure for percpu hotplug threads
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




\
 
 \ /
  Last update: 2012-07-21 20:41    [from the cache]
©2003-2011 Jasper Spaans