Skip to content

Commit

Permalink
slab: remove cachep in struct slab_rcu
Browse files Browse the repository at this point in the history
We can get cachep using page in struct slab_rcu, so 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>
  • Loading branch information
Joonsoo Kim authored and Pekka Enberg committed Oct 24, 2013
1 parent 1ea991b commit 07d417a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ typedef unsigned int kmem_bufctl_t;
*/
struct slab_rcu {
struct rcu_head head;
struct kmem_cache *cachep;
struct page *page;
};

Expand Down Expand Up @@ -1824,7 +1823,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page)
static void kmem_rcu_free(struct rcu_head *head)
{
struct slab_rcu *slab_rcu = (struct slab_rcu *)head;
struct kmem_cache *cachep = slab_rcu->cachep;
struct kmem_cache *cachep = slab_rcu->page->slab_cache;

kmem_freepages(cachep, slab_rcu->page);
if (OFF_SLAB(cachep))
Expand Down Expand Up @@ -2052,7 +2051,6 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
struct slab_rcu *slab_rcu;

slab_rcu = (struct slab_rcu *)slabp;
slab_rcu->cachep = cachep;
slab_rcu->page = page;
call_rcu(&slab_rcu->head, kmem_rcu_free);
} else {
Expand Down

0 comments on commit 07d417a

Please sign in to comment.