slub: use N_NORMAL_MEMORY in can_free_to_pcs to handle remote frees
Subsystems (2)
Hao Li
reviewerPATCH 1/1 slub: use N_NORMAL_MEMORY in can_free_to_pcs to handle remote frees
Memory hotplug now keeps N_NORMAL_MEMORY up to date correctly, so make can_free_to_pcs() use it.
As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.
---
Hi Vlastimil, this patch depends on a prerequisite patch[1] from a few days ago. I'm not sure how this should be handled. I wonder if Andrew might put them in the same tree.
[1] https://lore.kernel.org/linux-mm/[email protected]/
--- mm/slub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mm/slub.c +3 -2
@@ -6022,14 +6022,15 @@ static __always_inline bool can_free_to_pcs(struct slab *slab) goto check_pfmemalloc;/* -* Freed object isn't from this cpu's node, but that node is memoryless. +* Freed object isn't from this cpu's node, but that node is memoryless +* or only has ZONE_MOVABLE memory, which slab cannot allocate from. * Proceed as it's better to cache remote objects than falling back to * the slowpath for everything. The allocation side can never obtain * a local object anyway, if none exist. We don't have numa_mem_id() to * point to the closest node as we would on a proper memoryless node * setup. */ -if (unlikely (!node_state (numa_node,N_MEMORY ))) +if (unlikely (!node_state (numa_node,N_NORMAL_MEMORY ))) goto check_pfmemalloc;#endif
Signature · 1 line
2.50.1
Quoted 9 lines · Hao Li
Memory hotplug now keeps
N_NORMAL_MEMORYup to date correctly, so makecan_free_to_pcs()use it.As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in
ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.Signed-off-by Hao Li <[email protected]>---
Quoted 4 lines
Hi Vlastimil, this patch depends on a prerequisite patch[1] from a few days ago. I'm not sure how this should be handled.
I wonder if Andrew might put them in the same tree.
But it also depends on the patch series
"[PATCH 0/3] slab: support memoryless nodes with sheaves".
So perhaps better send it to Linus after 7.1-rc1?
Thanks!
Quoted 1 line
Signature · 2 lines
Cheers, Harry / Hyeonggon
Vlastimil Babka (SUSE)
maintainerQuoted 16 lines · Harry Yoo (Oracle)
Quoted 9 lines · Hao Li
Memory hotplug now keeps
N_NORMAL_MEMORYup to date correctly, so makecan_free_to_pcs()use it.As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in
ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.Signed-off-by Hao Li <[email protected]>---
Quoted 2 lines
Hi Vlastimil, this patch depends on a prerequisite patch[1] from a few days ago. I'm not sure how this should be handled.
Quoted 6 lines
Quoted 1 line
I wonder if Andrew might put them in the same tree.
But it also depends on the patch series
"[PATCH 0/3] slab: support memoryless nodes with sheaves".So perhaps better send it to Linus after 7.1-rc1?
[1] is in mm-hotfixes so it should get to mainline before 7.0 final, so then it's fine to add this to slab updates PR for 7.1-rc1
Quoted 4 lines
Thanks!
Quoted 1 line
Hao Li
reviewerQuoted 5 lines · Vlastimil Babka (SUSE)
Quoted 4 lines · Harry Yoo (Oracle)
Quoted 3 lines · Hao Li
Memory hotplug now keeps
N_NORMAL_MEMORYup to date correctly, so makecan_free_to_pcs()use it.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in
ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.Signed-off-by Hao Li <[email protected]>---
Thanks for Ack!
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Hi Vlastimil, this patch depends on a prerequisite patch[1] from a few days ago. I'm not sure how this should be handled.
I wonder if Andrew might put them in the same tree.
Quoted 7 lines
Quoted 4 lines
But it also depends on the patch series
"[PATCH 0/3] slab: support memoryless nodes with sheaves".So perhaps better send it to Linus after 7.1-rc1?
[1] is in mm-hotfixes so it should get to mainline before 7.0 final, so then it's fine to add this to slab updates PR for 7.1-rc1
Sounds good, thanks!
Quoted 6 lines
Quoted 5 lines
Thanks!
Quoted 1 line
Signature · 2 lines
Thanks, Hao
Harry Yoo (Oracle)
maintainerQuoted 17 lines · Vlastimil Babka (SUSE)
Quoted 16 lines · Harry Yoo (Oracle)
Quoted 9 lines · Hao Li
Memory hotplug now keeps
N_NORMAL_MEMORYup to date correctly, so makecan_free_to_pcs()use it.As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in
ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.Signed-off-by Hao Li <[email protected]>---
Quoted 2 lines
Hi Vlastimil, this patch depends on a prerequisite patch[1] from a few days ago. I'm not sure how this should be handled.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
I wonder if Andrew might put them in the same tree.
But it also depends on the patch series
"[PATCH 0/3] slab: support memoryless nodes with sheaves".So perhaps better send it to Linus after 7.1-rc1?
[1] is in mm-hotfixes so it should get to mainline before 7.0 final,
Right.
Quoted 1 line
so then it's fine to add this to slab updates PR for 7.1-rc1
Sounds great!
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Signature · 2 lines
Cheers, Harry / Hyeonggon
Quoted 8 lines · Hao Li
Memory hotplug now keeps
N_NORMAL_MEMORYup to date correctly, so makecan_free_to_pcs()use it.As a result, when freeing objects on memoryless nodes, or on nodes that have memory but only in
ZONE_MOVABLE, the objects can be freed to the sheaf instead of going through the slow path.Signed-off-by Hao Li <[email protected]>