Skip to content

Commit

Permalink
profiling: fix broken profiling regression
Browse files Browse the repository at this point in the history
Impact: fix broken /proc/profile on UP machines

Commit c309b91 "cpumask: convert
kernel/profile.c" broke profiling.  prof_cpu_mask was previously
initialized to CPU_MASK_ALL, but left uninitialized in that commit.
We need to copy cpu_possible_mask (cpu_online_mask is not enough).

Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Hugh Dickins authored and Ingo Molnar committed Feb 9, 2009
1 parent 4c098bc commit acd8957
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ int __ref profile_init(void)
if (!slab_is_available()) {
prof_buffer = alloc_bootmem(buffer_bytes);
alloc_bootmem_cpumask_var(&prof_cpu_mask);
cpumask_copy(prof_cpu_mask, cpu_possible_mask);
return 0;
}

if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))
return -ENOMEM;

cpumask_copy(prof_cpu_mask, cpu_possible_mask);

prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL);
if (prof_buffer)
return 0;
Expand Down

0 comments on commit acd8957

Please sign in to comment.