lkml.org 
[lkml]   [2011]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFD 3/9] Display /proc/stat information per cgroup
On 09/27/2011 06:52 PM, Peter Zijlstra wrote:
> On Fri, 2011-09-23 at 19:20 -0300, Glauber Costa wrote:
>> + root_task_group.cpustat = alloc_percpu(struct kernel_stat);
>> + /* Failing that early an allocation means we're screwed anyway */
>> + BUG_ON(!root_task_group.cpustat);
>> + for_each_possible_cpu(i) {
>> + kstat = per_cpu_ptr(root_task_group.cpustat, i);
>> + kstat->cpustat[IDLE] = 0;
>> + kstat->cpustat[IDLE_BASE] = 0;
>> + kstat->cpustat[IOWAIT_BASE] = 0;
>> + kstat->cpustat[IOWAIT] = 0;
>
> so alloc_percpu() will actually zero your memory for you, which you rely
> on for all other fields as well, so why reset these ones?

Just to be style-consistent with the non-root initialization, in which
we actually put values on that. But I can easily remove it.

>
>> + }
>
>



\
 
 \ /
  Last update: 2011-09-28 17:19    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site