lkml.org 
[lkml]   [2008]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [rfc][patch 1/3] slub: fix small HWCACHE_ALIGN alignment
    Hi Nick,

    On Mon, Mar 3, 2008 at 11:34 AM, Nick Piggin <npiggin@suse.de> wrote:
    > SLUB should pack even small objects nicely into cachelines if that is what
    > has been asked for. Use the same algorithm as SLAB for this.

    The patches look good but this changelog is missing context. Why do we
    want to do this?

    On Mon, Mar 3, 2008 at 11:34 AM, Nick Piggin <npiggin@suse.de> wrote:
    > @@ -1896,12 +1896,15 @@ static unsigned long calculate_alignment
    > * specified alignment though. If that is greater
    > * then use it.
    > */

    You might want to fix the above comment too.

    > - if ((flags & SLAB_HWCACHE_ALIGN) &&
    > - size > cache_line_size() / 2)
    > - return max_t(unsigned long, align, cache_line_size());
    > + if (flags & SLAB_HWCACHE_ALIGN) {
    > + unsigned long ralign = cache_line_size();
    > + while (size <= ralign / 2)
    > + ralign /= 2;
    > + align = max(align, ralign);
    > + }


    \
     
     \ /
      Last update: 2008-03-03 10:47    [W:4.128 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site