Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87052
b: refs/heads/master
c: b621038
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Christoph Lameter committed Mar 7, 2008
1 parent eb0ed76 commit a442888
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c61fc40fc264059ff41a614ed2d899127288281
refs/heads/master: b6210386787728b84db25adc4f1eba70440a4c73
11 changes: 7 additions & 4 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,12 +1856,15 @@ static unsigned long calculate_alignment(unsigned long flags,
* The hardware cache alignment cannot override the specified
* alignment though. If that is greater then use it.
*/
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);
}

if (align < ARCH_SLAB_MINALIGN)
return ARCH_SLAB_MINALIGN;
align = ARCH_SLAB_MINALIGN;

return ALIGN(align, sizeof(void *));
}
Expand Down

0 comments on commit a442888

Please sign in to comment.