lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BA2D8A4.2080409@kernel.org>
Date:	Fri, 19 Mar 2010 10:51:32 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	David Miller <davem@...emloft.net>, sparclinux@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [BUG] percpu misaligned allocation

Hello,

On 03/19/2010 10:31 AM, Frederic Weisbecker wrote:
> On Thu, Mar 18, 2010 at 05:54:13PM -0700, David Miller wrote:
>> From: Tejun Heo <tj@...nel.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?

Sure, I just wanted to verify the cause of the problem.

> So, making perf_trace_t as align(8) would do the trick?
> I lack the knowledge about alignment layout for archs that
> need aligned accesses.

If you can't make it a proper type, __alignof__(unsigned long long)
would be better.

> Yeah but we need a generic type. This is because
> our buffer can be of any random type to match all
> the trace event layouts we have, all of them being
> generated by macros.

I hope those macros align properly according to types.

Thanks.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ