-
Notifications
You must be signed in to change notification settings - Fork 92
[linux 6.12-y] uosste feature - Add wmark-step #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[linux 6.12-y] uosste feature - Add wmark-step #911
Conversation
Increase global watermark and watermark stepping based on request: 1. If wmark_step_enable=0, global watermark increased 80M. 2. If wmark_step_enable=1, global watermark increased 80M then stepping based on allocation request type (1 step for decreasing 16M): - Maintain current watermark for ALLOC_RESERVES - Apply wmark-step=5 for irq (origin min wmark, highest priority) - Apply wmark-step=3 for kthread (can be set by sysfs) - Apply wmark-step=0 for process (default, can be set to 0-5) Signed-off-by: Winston Wen <[email protected]> Signed-off-by: Fan Jie <[email protected]>
Reviewer's GuideThis patch adds a configurable watermark-step mechanism that lets each memcg and the core allocator adjust zone watermark minima by a programmable step size, exposing controls via cgroup files and a sysfs group, and weaving the new ALLOC_WMARK_STEP flag into the watermark and allocation logic. ER diagram for mem_cgroup and wmark_step sysfs/cgroup fileserDiagram
MEM_CGROUP ||--o{ MEMORY_FILES : exposes
MEMORY_FILES {
string name
int flags
function seq_show
function write
}
MEM_CGROUP {
int swappiness
int wmark_step
}
SYSFS_GROUP ||--o{ WMARK_STEP_ATTRS : contains
WMARK_STEP_ATTRS {
string name
function show
function store
}
SYSFS_GROUP {
string name
attribute[] attrs
}
MEM_CGROUP ||--o{ SYSFS_GROUP : has
Class diagram for mem_cgroup and wmark_step integrationclassDiagram
class mem_cgroup {
int swappiness
#ifdef CONFIG_WMARK_STEP
int wmark_step
#endif
struct cgroup_file events_file
struct cgroup_file events_local_file
}
class cgroup_subsys_state
mem_cgroup --|> cgroup_subsys_state
class kernfs_open_file
class seq_file
mem_cgroup : +memory_wmark_step_show(seq_file*, void*)
mem_cgroup : +memory_wmark_step_write(kernfs_open_file*, char*, size_t, loff_t)
mem_cgroup : +get_wmark_step_value()
class kobject
class kobj_attribute
kobject : +wmark_step_kthread_show()
kobject : +wmark_step_kthread_store()
kobject : +wmark_step_enabled_show()
kobject : +wmark_step_enabled_store()
class attribute_group
attribute_group : +wmark_step_attrs[]
attribute_group : +wmark_step_attr_group
class page_alloc
page_alloc : +__zone_watermark_ok()
page_alloc : +gfp_to_alloc_flags()
page_alloc : +__setup_per_zone_wmarks()
class internal_h
internal_h : +ALLOC_WMARK_STEP
internal_h : +wmark_step_enable
internal_h : +wmark_step_max
internal_h : +wmark_step_irq
internal_h : +wmark_step_kthread
internal_h : +wmark_step_default
internal_h : +wmark_step_size
internal_h : +get_wmark_step_value()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Hi @just-essential. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Enable WMARK_STEP for arm64, x86 and longarch Signed-off-by: Fan Jie <[email protected]>
09a9d98
to
428c4de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a configurable watermark stepping mechanism to memory cgroups and the page allocator to enable fine-tuned reserve adjustments per cgroup and task context.
- Introduces new global watermark step parameters and a CONFIG_WMARK_STEP option.
- Modifies allocation logic to adjust watermarks based on context (e.g., ALLOC_RESERVES vs. ALLOC_WMARK_STEP).
- Adds a sysfs group (wmark_step) and new cgroup file to allow runtime configuration of watermark stepping.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
mm/page_alloc.c | Adds watermark step global variables and adjusts __zone_watermark_ok logic. |
mm/memcontrol.c | Introduces get_wmark_step_value and sysfs support for configuring watermark step. |
mm/internal.h | Declares watermark step symbols and ALLOC_WMARK_STEP flag. |
mm/Kconfig | Adds configuration option for watermark stepping. |
include/linux/memcontrol.h | Exposes wmark_step field within mem_cgroup. |
arch//configs/_defconfig | Enables CONFIG_WMARK_STEP in various architecture specific default configs. |
Comments suppressed due to low confidence (3)
mm/page_alloc.c:3180
- Consider adding a comment here to explain the fallback behavior when free pages (min) are insufficient to apply the watermark step (min <= pages_wmark_step).
if (unlikely(min <= pages_wmark_step)) {
mm/memcontrol.c:4292
- It would be beneficial to add a function comment for get_wmark_step_value to explain its context-specific behavior (IRQ, kthread, and process) and the rationale behind the chosen return values.
int get_wmark_step_value(void)
mm/memcontrol.c:4991
- [nitpick] Consider adding a logging statement or more detailed documentation in this sysfs store function to clarify the behavior when an invalid wmark_step value is provided, which could aid in debugging configuration issues.
if (value > wmark_step_max)
967c085
into
deepin-community:linux-6.12.y
Summary by Sourcery
Add a configurable watermark stepping mechanism to memory cgroups and the page allocator to allow fine-tuned reserve adjustments per cgroup and task context.
New Features:
Enhancements:
Build: