Rev 1554 | Rev 1682 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1554 | Rev 1677 | ||
---|---|---|---|
Line 592... | Line 592... | ||
592 | if (cache->size < SLAB_INSIDE_SIZE) |
592 | if (cache->size < SLAB_INSIDE_SIZE) |
593 | cache->flags |= SLAB_CACHE_SLINSIDE; |
593 | cache->flags |= SLAB_CACHE_SLINSIDE; |
594 | 594 | ||
595 | /* Minimum slab order */ |
595 | /* Minimum slab order */ |
596 | pages = ((cache->size-1) >> PAGE_WIDTH) + 1; |
596 | pages = ((cache->size-1) >> PAGE_WIDTH) + 1; |
- | 597 | /* We need the 2^order >= pages */ |
|
- | 598 | if (pages == 1) |
|
- | 599 | cache->order = 0; |
|
- | 600 | else |
|
597 | cache->order = fnzb(pages); |
601 | cache->order = fnzb(pages-1)+1; |
598 | 602 | ||
599 | while (badness(cache) > SLAB_MAX_BADNESS(cache)) { |
603 | while (badness(cache) > SLAB_MAX_BADNESS(cache)) { |
600 | cache->order += 1; |
604 | cache->order += 1; |
601 | } |
605 | } |
602 | cache->objects = comp_objects(cache); |
606 | cache->objects = comp_objects(cache); |