diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2014-08-06 19:04:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:14 -0400 |
commit | 25c063fbd5512eb7190bf5af88351109aededb3f (patch) | |
tree | 861c20931ee12c950cc56d64c9965dd630c277bb /mm/slab.c | |
parent | 8a9c61d4381c5e5007cc68e023940b18fa0808d7 (diff) |
slab: move up code to get kmem_cache_node in free_block()
node isn't changed, so we don't need to retreive this structure
everytime we move the object. Maybe compiler do this optimization, but
making it explicitly is better.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -3398,7 +3398,7 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects, | |||
3398 | int node) | 3398 | int node) |
3399 | { | 3399 | { |
3400 | int i; | 3400 | int i; |
3401 | struct kmem_cache_node *n; | 3401 | struct kmem_cache_node *n = get_node(cachep, node); |
3402 | 3402 | ||
3403 | for (i = 0; i < nr_objects; i++) { | 3403 | for (i = 0; i < nr_objects; i++) { |
3404 | void *objp; | 3404 | void *objp; |
@@ -3408,7 +3408,6 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects, | |||
3408 | objp = objpp[i]; | 3408 | objp = objpp[i]; |
3409 | 3409 | ||
3410 | page = virt_to_head_page(objp); | 3410 | page = virt_to_head_page(objp); |
3411 | n = get_node(cachep, node); | ||
3412 | list_del(&page->lru); | 3411 | list_del(&page->lru); |
3413 | check_spinlock_acquired_node(cachep, node); | 3412 | check_spinlock_acquired_node(cachep, node); |
3414 | slab_put_obj(cachep, page, objp, node); | 3413 | slab_put_obj(cachep, page, objp, node); |