Skip to content

Commit dd35f71

Browse files
committed
mm/slab: Finish struct page to struct slab conversion
Change cache_free_alien() to use slab_nid(virt_to_slab()). Otherwise just update of comments and some remaining variable names. Signed-off-by: Vlastimil Babka <[email protected]> Reviewed-by: Hyeonggon Yoo <[email protected]> Reviewed-by: Roman Gushchin <[email protected]>
1 parent 7981e67 commit dd35f71

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mm/slab.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -793,16 +793,16 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp,
793793

794794
static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
795795
{
796-
int page_node = page_to_nid(virt_to_page(objp));
796+
int slab_node = slab_nid(virt_to_slab(objp));
797797
int node = numa_mem_id();
798798
/*
799799
* Make sure we are not freeing a object from another node to the array
800800
* cache on this cpu.
801801
*/
802-
if (likely(node == page_node))
802+
if (likely(node == slab_node))
803803
return 0;
804804

805-
return __cache_free_alien(cachep, objp, node, page_node);
805+
return __cache_free_alien(cachep, objp, node, slab_node);
806806
}
807807

808808
/*
@@ -1612,10 +1612,10 @@ static void slab_destroy_debugcheck(struct kmem_cache *cachep,
16121612
/**
16131613
* slab_destroy - destroy and release all objects in a slab
16141614
* @cachep: cache pointer being destroyed
1615-
* @page: page pointer being destroyed
1615+
* @slab: slab being destroyed
16161616
*
1617-
* Destroy all the objs in a slab page, and release the mem back to the system.
1618-
* Before calling the slab page must have been unlinked from the cache. The
1617+
* Destroy all the objs in a slab, and release the mem back to the system.
1618+
* Before calling the slab must have been unlinked from the cache. The
16191619
* kmem_cache_node ->list_lock is not held/needed.
16201620
*/
16211621
static void slab_destroy(struct kmem_cache *cachep, struct slab *slab)
@@ -2559,7 +2559,7 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep,
25592559
void *freelist;
25602560
size_t offset;
25612561
gfp_t local_flags;
2562-
int page_node;
2562+
int slab_node;
25632563
struct kmem_cache_node *n;
25642564
struct slab *slab;
25652565

@@ -2585,8 +2585,8 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep,
25852585
if (!slab)
25862586
goto failed;
25872587

2588-
page_node = slab_nid(slab);
2589-
n = get_node(cachep, page_node);
2588+
slab_node = slab_nid(slab);
2589+
n = get_node(cachep, slab_node);
25902590

25912591
/* Get colour for the slab, and cal the next value. */
25922592
n->colour_next++;
@@ -2608,7 +2608,7 @@ static struct slab *cache_grow_begin(struct kmem_cache *cachep,
26082608

26092609
/* Get slab management. */
26102610
freelist = alloc_slabmgmt(cachep, slab, offset,
2611-
local_flags & ~GFP_CONSTRAINT_MASK, page_node);
2611+
local_flags & ~GFP_CONSTRAINT_MASK, slab_node);
26122612
if (OFF_SLAB(cachep) && !freelist)
26132613
goto opps1;
26142614

0 commit comments

Comments
 (0)