Re: [PATCH] workqueue: Fix alignment calculation in alloc_cwqs()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Monday, October 25, 2010 - 2:43 pm

On Mon, Oct 25, 2010 at 2:27 PM, David Howells <dhowells@redhat.com> wrote:

No it doesn't. Those bits really require that many bytes of alignment.

Think about it: if the low 8 bits of the pointer are used for flags,
then the actual pointer itself needs to be aligned to a 256-byte
boundary.

So the code is right. If needs to ask for "1 << WORK_STRUCT_FLAG_BITS"
alignment, and if it doesn't get it (because the allocator is somehow
broken - percpu allocator issues?), things will break.

                     Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] workqueue: Fix alignment calculation in alloc_ ..., Linus Torvalds, (Mon Oct 25, 2:43 pm)