linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Muchun Song <songmuchun@bytedance.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org,
	adobriyan@gmail.com, akpm@linux-foundation.org,
	hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com,
	hughd@google.com, will@kernel.org, guro@fb.com, rppt@kernel.org,
	tglx@linutronix.de, esyr@redhat.com, peterx@redhat.com,
	krisman@collabora.com, surenb@google.com, avagin@openvz.org,
	elver@google.com, rdunlap@infradead.org, iamjoonsoo.kim@lge.com
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	Muchun Song <songmuchun@bytedance.com>
Subject: [RESEND PATCH v2 08/12] mm: memcontrol: convert NR_KERNEL_SCS_KB account to bytes
Date: Sun,  6 Dec 2020 18:14:47 +0800	[thread overview]
Message-ID: <20201206101451.14706-9-songmuchun@bytedance.com> (raw)
In-Reply-To: <20201206101451.14706-1-songmuchun@bytedance.com>

Convert NR_KERNEL_SCS_KB account to bytes

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
 drivers/base/node.c    | 2 +-
 fs/proc/meminfo.c      | 2 +-
 include/linux/mmzone.h | 2 +-
 kernel/scs.c           | 4 ++--
 mm/page_alloc.c        | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 92a75bad35c9..bc01ce0b2fcd 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -448,7 +448,7 @@ static ssize_t node_read_meminfo(struct device *dev,
 			     nid, K(i.sharedram),
 			     nid, node_page_state(pgdat, NR_KERNEL_STACK_B) / SZ_1K,
 #ifdef CONFIG_SHADOW_CALL_STACK
-			     nid, node_page_state(pgdat, NR_KERNEL_SCS_KB),
+			     nid, node_page_state(pgdat, NR_KERNEL_SCS_B) / SZ_1K,
 #endif
 			     nid, K(sum_zone_node_page_state(nid, NR_PAGETABLE)),
 			     nid, 0UL,
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 799a537d4218..69895e83d4fc 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -104,7 +104,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		   global_node_page_state(NR_KERNEL_STACK_B) / SZ_1K);
 #ifdef CONFIG_SHADOW_CALL_STACK
 	seq_printf(m, "ShadowCallStack:%8lu kB\n",
-		   global_node_page_state(NR_KERNEL_SCS_KB));
+		   global_node_page_state(NR_KERNEL_SCS_B) / SZ_1K);
 #endif
 	show_val_kb(m, "PageTables:     ",
 		    global_zone_page_state(NR_PAGETABLE));
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index bd34416293ec..1f9c83778629 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -204,7 +204,7 @@ enum node_stat_item {
 	NR_FOLL_PIN_RELEASED,	/* pages returned via unpin_user_page() */
 	NR_KERNEL_STACK_B,	/* measured in byte */
 #if IS_ENABLED(CONFIG_SHADOW_CALL_STACK)
-	NR_KERNEL_SCS_KB,	/* measured in KiB */
+	NR_KERNEL_SCS_B,	/* measured in byte */
 #endif
 	NR_VM_NODE_STAT_ITEMS
 };
diff --git a/kernel/scs.c b/kernel/scs.c
index 4ff4a7ba0094..8db89c932ddc 100644
--- a/kernel/scs.c
+++ b/kernel/scs.c
@@ -17,8 +17,8 @@ static void __scs_account(void *s, int account)
 {
 	struct page *scs_page = virt_to_page(s);
 
-	mod_node_page_state(page_pgdat(scs_page), NR_KERNEL_SCS_KB,
-			    account * (SCS_SIZE / SZ_1K));
+	mod_node_page_state(page_pgdat(scs_page), NR_KERNEL_SCS_B,
+			    account * SCS_SIZE);
 }
 
 static void *scs_alloc(int node)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d2821ba7f682..58916b3afdab 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5574,7 +5574,7 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 			K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
 			node_page_state(pgdat, NR_KERNEL_STACK_B) / SZ_1K,
 #ifdef CONFIG_SHADOW_CALL_STACK
-			node_page_state(pgdat, NR_KERNEL_SCS_KB),
+			node_page_state(pgdat, NR_KERNEL_SCS_B) / SZ_1K,
 #endif
 			pgdat->kswapd_failures >= MAX_RECLAIM_RETRIES ?
 				"yes" : "no");
-- 
2.11.0


  parent reply	other threads:[~2020-12-06 10:19 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 10:14 [RESEND PATCH v2 00/12] Convert all vmstat counters to pages or bytes Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 01/12] mm: memcontrol: fix NR_ANON_THPS account Muchun Song
2020-12-07 12:52   ` Michal Hocko
2020-12-10 16:00   ` Johannes Weiner
2020-12-10 16:02     ` Johannes Weiner
2020-12-10 16:04   ` Johannes Weiner
2020-12-10 16:56     ` [External] " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 02/12] mm: memcontrol: convert NR_ANON_THPS account to pages Muchun Song
2020-12-10 16:10   ` Johannes Weiner
2020-12-10 17:05     ` [External] " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 03/12] mm: memcontrol: convert NR_FILE_THPS " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 04/12] mm: memcontrol: convert NR_SHMEM_THPS " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 05/12] mm: memcontrol: convert NR_SHMEM_PMDMAPPED " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 06/12] mm: memcontrol: convert NR_FILE_PMDMAPPED " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 07/12] mm: memcontrol: convert kernel stack account to bytes Muchun Song
2020-12-06 10:14 ` Muchun Song [this message]
2020-12-06 10:14 ` [RESEND PATCH v2 09/12] mm: memcontrol: convert vmstat slab counters " Muchun Song
2020-12-07 19:46   ` Roman Gushchin
2020-12-07 20:01     ` Roman Gushchin
2020-12-08  2:44     ` [External] " Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 10/12] mm: memcontrol: scale stat_threshold for byted-sized vmstat Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 11/12] mm: memcontrol: make the slab calculation consistent Muchun Song
2020-12-06 10:14 ` [RESEND PATCH v2 12/12] mm: memcontrol: remove {global_}node_page_state_pages Muchun Song
2020-12-07 13:00 ` [RESEND PATCH v2 00/12] Convert all vmstat counters to pages or bytes Michal Hocko
2020-12-07 14:52   ` [External] " Muchun Song
2020-12-07 15:02     ` Michal Hocko
2020-12-07 18:51       ` Randy Dunlap
2020-12-08  2:29         ` Muchun Song
2020-12-07 19:51       ` Roman Gushchin
2020-12-07 20:33         ` Hugh Dickins
2020-12-08  2:42           ` Muchun Song
2020-12-08  2:40       ` Muchun Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201206101451.14706-9-songmuchun@bytedance.com \
    --to=songmuchun@bytedance.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=cgroups@vger.kernel.org \
    --cc=elver@google.com \
    --cc=esyr@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=krisman@collabora.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=peterx@redhat.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=vdavydov.dev@gmail.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).