[lkml]   [2012]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH 6/6] workqueue: use kmalloc_align() instead of hacking
On Wed, 21 Mar 2012, Lai Jiangshan wrote:

> Yes, I don't want to build a complex kmalloc_align(). But after I found
> that SLAB/SLUB's kmalloc-objects are natural/automatic aligned to
> a proper big power of two. I will do nothing if I introduce kmalloc_align()
> except just care the debugging.

They are not guaranteed to be aligned to the big power of two! There are
kmalloc caches that are not power of two. Debugging and other
necessary meta data may change alignment in both SLAB and SLUB. SLAB needs
a metadata structure in each page even without debugging that may cause
alignment issues.

> And kmalloc_align() can be used in the following case:
> o a type object need to be aligned with cache-line for it contains a frequent
> update-part and a frequent read-part.
> o The total number of these objects in a given type is not much, creating
> a new slab cache for a given type will be overkill.
> This is a RFC patch and it seems mm gurus don't like it. I'm sorry I
> bother all of you.

Ideas are always welcome. Please do not get offended by our problems with
your patch.

 \ /
  Last update: 2012-03-21 14:47    [W:0.134 / U:59.000 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site