summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2013-01-21 09:01:25 +0100
committerPekka Enberg <penberg@kernel.org>2013-04-02 08:42:10 +0200
commit633b076464da52b3c7bf0f62932fbfc0ea23d8b3 (patch)
tree546927d08f30ea3049051b89a55b7c7a56937f7f /arch
parentslub: correctly bootstrap boot caches (diff)
downloadlinux-633b076464da52b3c7bf0f62932fbfc0ea23d8b3.tar.xz
linux-633b076464da52b3c7bf0f62932fbfc0ea23d8b3.zip
slub: correct to calculate num of acquired objects in get_partial_node()
There is a subtle bug when calculating a number of acquired objects. Currently, we calculate "available = page->objects - page->inuse", after acquire_slab() is called in get_partial_node(). In acquire_slab() with mode = 1, we always set new.inuse = page->objects. So, acquire_slab(s, n, page, object == NULL); if (!object) { c->page = page; stat(s, ALLOC_FROM_PARTIAL); object = t; available = page->objects - page->inuse; !!! availabe is always 0 !!! ... Therfore, "available > s->cpu_partial / 2" is always false and we always go to second iteration. This patch correct this problem. After that, we don't need return value of put_cpu_partial(). So remove it. Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions