lkml.org 
[lkml]   [2012]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v7 1/3] trace: Make removal of ring buffer pages atomic
On Tue, May 8, 2012 at 8:38 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> BTW, why the two loops and not just:
>
>                for_each_buffer_cpu(buffer, cpu) {
>                        cpu_buffer = buffer->buffers[cpu];
>                        if (!cpu_buffer->nr_pages_to_update)
>                                continue;
>
>                        if (cpu_online(cpu))
>                                schedule_work_on(cpu, &cpu_buffer->update_pages_work);
>                        else
>                                rb_update_pages(cpu_buffer);
>                }
>
> ??
>
>
>>
>>               /* wait for all the updates to complete */
>>               for_each_buffer_cpu(buffer, cpu) {
>>                       cpu_buffer = buffer->buffers[cpu];
>> -                     if (cpu_buffer->nr_pages_to_update) {
>> -                             update_pages_handler(cpu_buffer);
>> -                     }
>> +                     if (!cpu_buffer->nr_pages_to_update||
>
>                              !cpu_buffer->nr_pages_to_update ||

This schedules work for all online CPUs and the offline CPUs resizing
(if any) can occur concurrently. It might not be too much of big deal
to just make it one loop.



Vaibhav Nagarnaik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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