lkml.org 
[lkml]   [2010]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [BUG] percpu misaligned allocation
From
From: Tejun Heo <tj@kernel.org>
Date: Thu, 18 Mar 2010 18:30:34 +0900

>
> if (!total_profile_count) {
> - buf = (char *)alloc_percpu(perf_trace_t);
> + buf = (char *)__alloc_percpu(sizeof(perf_trace_t),
> + __alignof__(unsigned long));
> if (!buf)
> goto fail_buf;

Why not make perf_trace_t have the proper alignment?

That's better than patching around it like this.

Defining it as an array of char[]'s is just asking
for lots of trouble.


\
 
 \ /
  Last update: 2010-03-19 01:57    [from the cache]
©2003-2011 Jasper Spaans