lkml.org 
[lkml]   [2020]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/9] mm: vmstat: fix stat_threshold for NR_KERNEL_STACK_KB
Date
The kernel stack is being accounted in KiB not page, so the
stat_threshold should also adjust to byte.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
mm/vmstat.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 8d77ee426e22..f7857a7052e4 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -353,6 +353,8 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
x = delta + __this_cpu_read(*p);

t = __this_cpu_read(pcp->stat_threshold);
+ if (unlikely(item == NR_KERNEL_STACK_KB))
+ t <<= PAGE_SHIFT;

if (unlikely(abs(x) > t)) {
node_page_state_add(x, pgdat, item);
@@ -573,6 +575,8 @@ static inline void mod_node_state(struct pglist_data *pgdat,
* for all cpus in a node.
*/
t = this_cpu_read(pcp->stat_threshold);
+ if (unlikely(item == NR_KERNEL_STACK_KB))
+ t <<= PAGE_SHIFT;

o = this_cpu_read(*p);
n = delta + o;
--
2.11.0
\
 
 \ /
  Last update: 2020-12-05 19:31    [W:0.111 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site