mbox series

[v3,0/2] vmscan: enforce mems_effective during demotion

Message ID 20250419053824.1601470-1-gourry@gourry.net (mailing list archive)
Headers show
Series vmscan: enforce mems_effective during demotion | expand

Message

Gregory Price April 19, 2025, 5:38 a.m. UTC
Change reclaim to respect cpuset.mems_effective during demotion when
possible. Presently, reclaim explicitly ignores cpuset.mems_effective
when demoting, which may cause the cpuset settings to violated.

Implement cpuset_node_allowed() to check the cpuset.mems_effective
associated wih the mem_cgroup of the lruvec being scanned.

This requires renaming the existing cpuset_node_allowed() to be
cpuset_current_now_allowed() - which is more descriptive anyway - to
implement the new cpuset_node_allowed() which takes a target cgroup.

v3:
- remove cgroup indirection, call cpuset directly from memcontrol
- put mem_cgroup_node_allowed in memcontrol.c to reduce cpuset.h
  include scope
- return true if mems_effective is empty, and don't walk the parents
  as recommended by Waiman Long.

Gregory Price (2):
  cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed
  vmscan,cgroup: apply mems_effective to reclaim

 .../ABI/testing/sysfs-kernel-mm-numa          | 14 ++++---
 include/linux/cpuset.h                        |  9 +++-
 include/linux/memcontrol.h                    |  6 +++
 kernel/cgroup/cpuset.c                        | 25 ++++++++++-
 mm/memcontrol.c                               |  6 +++
 mm/page_alloc.c                               |  4 +-
 mm/vmscan.c                                   | 41 +++++++++++--------
 7 files changed, 78 insertions(+), 27 deletions(-)

Comments

Tejun Heo April 19, 2025, 5:21 p.m. UTC | #1
On Sat, Apr 19, 2025 at 01:38:22AM -0400, Gregory Price wrote:
> Change reclaim to respect cpuset.mems_effective during demotion when
> possible. Presently, reclaim explicitly ignores cpuset.mems_effective
> when demoting, which may cause the cpuset settings to violated.
> 
> Implement cpuset_node_allowed() to check the cpuset.mems_effective
> associated wih the mem_cgroup of the lruvec being scanned.
> 
> This requires renaming the existing cpuset_node_allowed() to be
> cpuset_current_now_allowed() - which is more descriptive anyway - to
> implement the new cpuset_node_allowed() which takes a target cgroup.
> 
> v3:
> - remove cgroup indirection, call cpuset directly from memcontrol
> - put mem_cgroup_node_allowed in memcontrol.c to reduce cpuset.h
>   include scope
> - return true if mems_effective is empty, and don't walk the parents
>   as recommended by Waiman Long.
> 
> Gregory Price (2):
>   cpuset: rename cpuset_node_allowed to cpuset_current_node_allowed
>   vmscan,cgroup: apply mems_effective to reclaim

From cgroup POV:

 Acked-by: Tejun Heo <tj@kernel.org>

Given that the operative changes are mostly in mm, it'd probably be best to
route through -mm, but please let me know if you wanna go through the cgroup
tree.

Thanks.