diff options
| author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2013-10-23 21:07:40 -0400 |
|---|---|---|
| committer | Pekka Enberg <penberg@iki.fi> | 2013-10-24 13:17:27 -0400 |
| commit | 1ea991b00c26e3a275e2d2e110e5221211fc45b6 (patch) | |
| tree | 9465add4bdd50decc33e6d3b05f6eb52d29e719b /mm | |
| parent | ac2b54edbc4768f4a069fc360e2b4e579e9907cb (diff) | |
slab: remove nodeid in struct slab
We can get nodeid using address translation, so this field is not useful.
Therefore, remove it.
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Pekka Enberg <penberg@iki.fi>
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/slab.c | 11 |
1 files changed, 4 insertions, 7 deletions
| @@ -222,7 +222,6 @@ struct slab { | |||
| 222 | void *s_mem; /* including colour offset */ | 222 | void *s_mem; /* including colour offset */ |
| 223 | unsigned int inuse; /* num of objs active in slab */ | 223 | unsigned int inuse; /* num of objs active in slab */ |
| 224 | kmem_bufctl_t free; | 224 | kmem_bufctl_t free; |
| 225 | unsigned short nodeid; | ||
| 226 | }; | 225 | }; |
| 227 | struct slab_rcu __slab_cover_slab_rcu; | 226 | struct slab_rcu __slab_cover_slab_rcu; |
| 228 | }; | 227 | }; |
| @@ -1099,8 +1098,7 @@ static void drain_alien_cache(struct kmem_cache *cachep, | |||
| 1099 | 1098 | ||
| 1100 | static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) | 1099 | static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) |
| 1101 | { | 1100 | { |
| 1102 | struct slab *slabp = virt_to_slab(objp); | 1101 | int nodeid = page_to_nid(virt_to_page(objp)); |
| 1103 | int nodeid = slabp->nodeid; | ||
| 1104 | struct kmem_cache_node *n; | 1102 | struct kmem_cache_node *n; |
| 1105 | struct array_cache *alien = NULL; | 1103 | struct array_cache *alien = NULL; |
| 1106 | int node; | 1104 | int node; |
| @@ -1111,7 +1109,7 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) | |||
| 1111 | * Make sure we are not freeing a object from another node to the array | 1109 | * Make sure we are not freeing a object from another node to the array |
| 1112 | * cache on this cpu. | 1110 | * cache on this cpu. |
| 1113 | */ | 1111 | */ |
| 1114 | if (likely(slabp->nodeid == node)) | 1112 | if (likely(nodeid == node)) |
| 1115 | return 0; | 1113 | return 0; |
| 1116 | 1114 | ||
| 1117 | n = cachep->node[node]; | 1115 | n = cachep->node[node]; |
| @@ -2630,7 +2628,6 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, | |||
| 2630 | } | 2628 | } |
| 2631 | slabp->inuse = 0; | 2629 | slabp->inuse = 0; |
| 2632 | slabp->s_mem = addr + colour_off; | 2630 | slabp->s_mem = addr + colour_off; |
| 2633 | slabp->nodeid = nodeid; | ||
| 2634 | slabp->free = 0; | 2631 | slabp->free = 0; |
| 2635 | return slabp; | 2632 | return slabp; |
| 2636 | } | 2633 | } |
| @@ -2707,7 +2704,7 @@ static void *slab_get_obj(struct kmem_cache *cachep, struct slab *slabp, | |||
| 2707 | next = slab_bufctl(slabp)[slabp->free]; | 2704 | next = slab_bufctl(slabp)[slabp->free]; |
| 2708 | #if DEBUG | 2705 | #if DEBUG |
| 2709 | slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE; | 2706 | slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE; |
| 2710 | WARN_ON(slabp->nodeid != nodeid); | 2707 | WARN_ON(page_to_nid(virt_to_page(objp)) != nodeid); |
| 2711 | #endif | 2708 | #endif |
| 2712 | slabp->free = next; | 2709 | slabp->free = next; |
| 2713 | 2710 | ||
| @@ -2721,7 +2718,7 @@ static void slab_put_obj(struct kmem_cache *cachep, struct slab *slabp, | |||
| 2721 | 2718 | ||
| 2722 | #if DEBUG | 2719 | #if DEBUG |
| 2723 | /* Verify that the slab belongs to the intended node */ | 2720 | /* Verify that the slab belongs to the intended node */ |
| 2724 | WARN_ON(slabp->nodeid != nodeid); | 2721 | WARN_ON(page_to_nid(virt_to_page(objp)) != nodeid); |
| 2725 | 2722 | ||
| 2726 | if (slab_bufctl(slabp)[objnr] + 1 <= SLAB_LIMIT + 1) { | 2723 | if (slab_bufctl(slabp)[objnr] + 1 <= SLAB_LIMIT + 1) { |
| 2727 | printk(KERN_ERR "slab: double free detected in cache " | 2724 | printk(KERN_ERR "slab: double free detected in cache " |
