* [PATCH 0/2] docs/ksm: fix advisor documentation and comment
@ 2026-07-31 8:35 Jinjiang Tu
2026-07-31 8:35 ` [PATCH 1/2] docs: ksm: fix typos in sysfs knob names Jinjiang Tu
2026-07-31 8:35 ` [PATCH 2/2] mm/ksm: fix advisor_min_pages_to_scan description Jinjiang Tu
0 siblings, 2 replies; 7+ messages in thread
From: Jinjiang Tu @ 2026-07-31 8:35 UTC (permalink / raw)
To: akpm, david, xu.xin16, chengming.zhou, ljs, liam, vbabka, rppt,
surenb, mhocko, corbet, skhan, shr, linux-mm, linux-doc
Cc: wangkefeng.wang, sunnanyong, tujinjiang
Fix typos and misleading description of advisor_min_pages_to_scan.
Jinjiang Tu (2):
docs: ksm: fix typos in sysfs knob names
mm/ksm: fix advisor_min_pages_to_scan description
Documentation/admin-guide/mm/ksm.rst | 8 ++++----
mm/ksm.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] docs: ksm: fix typos in sysfs knob names
2026-07-31 8:35 [PATCH 0/2] docs/ksm: fix advisor documentation and comment Jinjiang Tu
@ 2026-07-31 8:35 ` Jinjiang Tu
2026-07-31 9:11 ` David Hildenbrand (Arm)
2026-07-31 8:35 ` [PATCH 2/2] mm/ksm: fix advisor_min_pages_to_scan description Jinjiang Tu
1 sibling, 1 reply; 7+ messages in thread
From: Jinjiang Tu @ 2026-07-31 8:35 UTC (permalink / raw)
To: akpm, david, xu.xin16, chengming.zhou, ljs, liam, vbabka, rppt,
surenb, mhocko, corbet, skhan, shr, linux-mm, linux-doc
Cc: wangkefeng.wang, sunnanyong, tujinjiang
The sysfs knob names in mm/ksm.c are "advisor_max_cpu" and
"advisor_max_pages_to_scan", but the ksm.rst documentation spelled
both as "adivsor_*", fix the two typos.
Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
---
Documentation/admin-guide/mm/ksm.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index ad8e7a41f3b5..c9f533b10f6f 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -174,7 +174,7 @@ advisor_mode
The section about ``advisor`` explains in detail how the scan time
advisor works.
-adivsor_max_cpu
+advisor_max_cpu
specifies the upper limit of the cpu percent usage of the ksmd
background thread. The default is 70.
@@ -186,7 +186,7 @@ advisor_min_pages_to_scan
specifies the lower limit of the ``pages_to_scan`` parameter of the
scan time advisor. The default is 500.
-adivsor_max_pages_to_scan
+advisor_max_pages_to_scan
specifies the upper limit of the ``pages_to_scan`` parameter of the
scan time advisor. The default is 30000.
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] mm/ksm: fix advisor_min_pages_to_scan description
2026-07-31 8:35 [PATCH 0/2] docs/ksm: fix advisor documentation and comment Jinjiang Tu
2026-07-31 8:35 ` [PATCH 1/2] docs: ksm: fix typos in sysfs knob names Jinjiang Tu
@ 2026-07-31 8:35 ` Jinjiang Tu
[not found] ` <33b55954-71e7-4e8d-868a-0440c1b28ae8@kernel.org>
1 sibling, 1 reply; 7+ messages in thread
From: Jinjiang Tu @ 2026-07-31 8:35 UTC (permalink / raw)
To: akpm, david, xu.xin16, chengming.zhou, ljs, liam, vbabka, rppt,
surenb, mhocko, corbet, skhan, shr, linux-mm, linux-doc
Cc: wangkefeng.wang, sunnanyong, tujinjiang
Both Documentation/admin-guide/mm/ksm.rst and the comment next to the
variable definition in mm/ksm.c describe advisor_min_pages_to_scan as a
lower limit of the pages_to_scan parameter, but that is not how the
scan-time advisor actually uses it. commit 4e5fa4f5eff6 ("mm/ksm: add ksm
advisor") only uses it to initialize ksm_thread_pages_to_scan when the
scan-time advisor is enabled. This will mislead the users.
The semantics of advisor_min_pages_to_scan was updated in the v2 patchset
[1], but the documention wasn't updated.
Update the documentation and comment to match the semantics of
advisor_min_pages_to_scan.
Link: https://lore.kernel.org/linux-mm/20231028000945.2428830-2-shr@devkernel.io/ [1]
Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
Fixes: 66790e9a735b ("mm/ksm: add sysfs knobs for advisor")
Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
---
Documentation/admin-guide/mm/ksm.rst | 4 ++--
mm/ksm.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index c9f533b10f6f..c329ca747b8c 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -183,8 +183,8 @@ advisor_target_scan_time
pages. The default value is 200 seconds.
advisor_min_pages_to_scan
- specifies the lower limit of the ``pages_to_scan`` parameter of the
- scan time advisor. The default is 500.
+ specifies the initial value of the ``pages_to_scan`` parameter of
+ the scan time advisor. The default is 500.
advisor_max_pages_to_scan
specifies the upper limit of the ``pages_to_scan`` parameter of the
diff --git a/mm/ksm.c b/mm/ksm.c
index 7d5b76478f0b..1e3a9c657a64 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -342,7 +342,7 @@ static enum ksm_advisor_type ksm_advisor;
* Only called through the sysfs control interface:
*/
-/* At least scan this many pages per batch. */
+/* Initial number of pages to scan per batch when the scan-time advisor is enabled. */
static unsigned long ksm_advisor_min_pages_to_scan = 500;
static void set_advisor_defaults(void)
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] docs: ksm: fix typos in sysfs knob names
2026-07-31 8:35 ` [PATCH 1/2] docs: ksm: fix typos in sysfs knob names Jinjiang Tu
@ 2026-07-31 9:11 ` David Hildenbrand (Arm)
2026-07-31 9:22 ` Jinjiang Tu
0 siblings, 1 reply; 7+ messages in thread
From: David Hildenbrand (Arm) @ 2026-07-31 9:11 UTC (permalink / raw)
To: Jinjiang Tu, akpm, xu.xin16, chengming.zhou, ljs, liam, vbabka,
rppt, surenb, mhocko, corbet, skhan, shr, linux-mm, linux-doc
Cc: wangkefeng.wang, sunnanyong
On 7/31/26 10:35, Jinjiang Tu wrote:
> The sysfs knob names in mm/ksm.c are "advisor_max_cpu" and
> "advisor_max_pages_to_scan", but the ksm.rst documentation spelled
> both as "adivsor_*", fix the two typos.
>
> Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
I'm not sure on fixes tags for documentation stuff.
Change itself LGTM
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] docs: ksm: fix typos in sysfs knob names
2026-07-31 9:11 ` David Hildenbrand (Arm)
@ 2026-07-31 9:22 ` Jinjiang Tu
2026-07-31 9:25 ` David Hildenbrand (Arm)
0 siblings, 1 reply; 7+ messages in thread
From: Jinjiang Tu @ 2026-07-31 9:22 UTC (permalink / raw)
To: David Hildenbrand (Arm), akpm, xu.xin16, chengming.zhou, ljs,
liam, vbabka, rppt, surenb, mhocko, corbet, skhan, shr, linux-mm,
linux-doc
Cc: wangkefeng.wang, sunnanyong
在 2026/7/31 17:11, David Hildenbrand (Arm) 写道:
> On 7/31/26 10:35, Jinjiang Tu wrote:
>> The sysfs knob names in mm/ksm.c are "advisor_max_cpu" and
>> "advisor_max_pages_to_scan", but the ksm.rst documentation spelled
>> both as "adivsor_*", fix the two typos.
>>
>> Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
> I'm not sure on fixes tags for documentation stuff.
git log --grep "Fixes" Documentation/
Many commits in Documentation have fix tag.
I think both are ok, since documentation changes are needed to backport.
> Change itself LGTM
>
> Acked-by: David Hildenbrand (Arm) <david@kernel.org>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mm/ksm: fix advisor_min_pages_to_scan description
[not found] ` <33b55954-71e7-4e8d-868a-0440c1b28ae8@kernel.org>
@ 2026-07-31 9:24 ` Jinjiang Tu
0 siblings, 0 replies; 7+ messages in thread
From: Jinjiang Tu @ 2026-07-31 9:24 UTC (permalink / raw)
To: David Hildenbrand (Arm), akpm, xu.xin16, chengming.zhou, ljs,
liam, vbabka, rppt, surenb, mhocko, corbet, skhan, shr, linux-mm,
linux-doc
Cc: wangkefeng.wang, sunnanyong
在 2026/7/31 17:17, David Hildenbrand (Arm) 写道:
> On 7/31/26 10:35, Jinjiang Tu wrote:
>> Both Documentation/admin-guide/mm/ksm.rst and the comment next to the
>> variable definition in mm/ksm.c describe advisor_min_pages_to_scan as a
>> lower limit of the pages_to_scan parameter, but that is not how the
>> scan-time advisor actually uses it. commit 4e5fa4f5eff6 ("mm/ksm: add ksm
>> advisor") only uses it to initialize ksm_thread_pages_to_scan when the
>> scan-time advisor is enabled. This will mislead the users.
>>
>> The semantics of advisor_min_pages_to_scan was updated in the v2 patchset
>> [1], but the documention wasn't updated.
> s/documention/documentation/
>
>> Update the documentation and comment to match the semantics of
>> advisor_min_pages_to_scan.
>>
>> Link: https://lore.kernel.org/linux-mm/20231028000945.2428830-2-shr@devkernel.io/ [1]
>> Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
>> Fixes: 66790e9a735b ("mm/ksm: add sysfs knobs for advisor")
> Drop these.
>
>> Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
>> ---
>> Documentation/admin-guide/mm/ksm.rst | 4 ++--
>> mm/ksm.c | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
>> index c9f533b10f6f..c329ca747b8c 100644
>> --- a/Documentation/admin-guide/mm/ksm.rst
>> +++ b/Documentation/admin-guide/mm/ksm.rst
>> @@ -183,8 +183,8 @@ advisor_target_scan_time
>> pages. The default value is 200 seconds.
>>
>> advisor_min_pages_to_scan
>> - specifies the lower limit of the ``pages_to_scan`` parameter of the
>> - scan time advisor. The default is 500.
>> + specifies the initial value of the ``pages_to_scan`` parameter of
>> + the scan time advisor. The default is 500.
> Makes sense.
>
>>
>> advisor_max_pages_to_scan
>> specifies the upper limit of the ``pages_to_scan`` parameter of the
>> diff --git a/mm/ksm.c b/mm/ksm.c
>> index 7d5b76478f0b..1e3a9c657a64 100644
>> --- a/mm/ksm.c
>> +++ b/mm/ksm.c
>> @@ -342,7 +342,7 @@ static enum ksm_advisor_type ksm_advisor;
>> * Only called through the sysfs control interface:
>> */
>>
>> -/* At least scan this many pages per batch. */
>> +/* Initial number of pages to scan per batch when the scan-time advisor is enabled. */
>> static unsigned long ksm_advisor_min_pages_to_scan = 500;
> "when the scan-time advisor is enabled" is clear from the variable name.
>
> So I'd shorten it to "Initial number of pages to scan per batch"
Thanks, will update these.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] docs: ksm: fix typos in sysfs knob names
2026-07-31 9:22 ` Jinjiang Tu
@ 2026-07-31 9:25 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand (Arm) @ 2026-07-31 9:25 UTC (permalink / raw)
To: Jinjiang Tu, akpm, xu.xin16, chengming.zhou, ljs, liam, vbabka,
rppt, surenb, mhocko, corbet, skhan, shr, linux-mm, linux-doc
Cc: wangkefeng.wang, sunnanyong
On 7/31/26 11:22, Jinjiang Tu wrote:
>
> 在 2026/7/31 17:11, David Hildenbrand (Arm) 写道:
>> On 7/31/26 10:35, Jinjiang Tu wrote:
>>> The sysfs knob names in mm/ksm.c are "advisor_max_cpu" and
>>> "advisor_max_pages_to_scan", but the ksm.rst documentation spelled
>>> both as "adivsor_*", fix the two typos.
>>>
>>> Fixes: 0710f38ad26a ("mm/ksm: document ksm advisor and its sysfs knobs")
>> I'm not sure on fixes tags for documentation stuff.
>
> git log --grep "Fixes" Documentation/
>
> Many commits in Documentation have fix tag.
> I think both are ok, since documentation changes are needed to backport.
What? When? How? Where?
:)
--
Cheers,
David
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-31 9:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 8:35 [PATCH 0/2] docs/ksm: fix advisor documentation and comment Jinjiang Tu
2026-07-31 8:35 ` [PATCH 1/2] docs: ksm: fix typos in sysfs knob names Jinjiang Tu
2026-07-31 9:11 ` David Hildenbrand (Arm)
2026-07-31 9:22 ` Jinjiang Tu
2026-07-31 9:25 ` David Hildenbrand (Arm)
2026-07-31 8:35 ` [PATCH 2/2] mm/ksm: fix advisor_min_pages_to_scan description Jinjiang Tu
[not found] ` <33b55954-71e7-4e8d-868a-0440c1b28ae8@kernel.org>
2026-07-31 9:24 ` Jinjiang Tu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox