From: Aaron Tomlin <atomlin@redhat.com>
To: frederic@kernel.org, mtosatti@redhat.com
Cc: cl@linux.com, tglx@linutronix.de, mingo@kernel.org,
peterz@infradead.org, pauld@redhat.com, neelx@redhat.com,
oleksandr@natalenko.name, atomlin@atomlin.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH v8 1/5] mm/vmstat: Add CPU-specific variable to track a vmstat discrepancy
Date: Sat, 24 Sep 2022 16:22:23 +0100 [thread overview]
Message-ID: <20220924152227.819815-2-atomlin@redhat.com> (raw)
In-Reply-To: <20220924152227.819815-1-atomlin@redhat.com>
Introduce a CPU-specific variable namely vmstat_dirty to indicate
if a vmstat imbalance is present for a given CPU. Therefore, at
the appropriate time, we can fold all the remaining differentials.
This patch also provides trivial helpers for modification and testing.
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
mm/vmstat.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 90af9a8572f5..24c67b2e58fd 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -195,6 +195,22 @@ void fold_vm_numa_events(void)
#endif
#ifdef CONFIG_SMP
+static DEFINE_PER_CPU_ALIGNED(bool, vmstat_dirty);
+
+static inline void vmstat_mark_dirty(void)
+{
+ this_cpu_write(vmstat_dirty, true);
+}
+
+static inline void vmstat_clear_dirty(void)
+{
+ this_cpu_write(vmstat_dirty, false);
+}
+
+static inline bool is_vmstat_dirty(void)
+{
+ return this_cpu_read(vmstat_dirty);
+}
int calculate_pressure_threshold(struct zone *zone)
{
--
2.37.1
next prev parent reply other threads:[~2022-09-24 15:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 15:22 [PATCH v8 0/5] Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
2022-09-24 15:22 ` Aaron Tomlin [this message]
2022-09-24 15:22 ` [PATCH v8 2/5] mm/vmstat: Use vmstat_dirty to track CPU-specific vmstat discrepancies Aaron Tomlin
2022-10-01 14:55 ` kernel test robot
2022-09-24 15:22 ` [PATCH v8 3/5] mm/vmstat: Do not queue vmstat_update if tick is stopped Aaron Tomlin
2022-10-24 11:03 ` Frederic Weisbecker
2022-11-09 19:40 ` Marcelo Tosatti
2022-11-10 19:15 ` Marcelo Tosatti
2022-11-14 12:12 ` Frederic Weisbecker
2022-10-24 11:54 ` Frederic Weisbecker
2022-09-24 15:22 ` [PATCH v8 4/5] tick/nohz_full: Ensure quiet_vmstat() is called on exit to user-mode when the idle " Aaron Tomlin
2022-09-27 16:17 ` Rafael Folco
2022-09-29 8:22 ` Aaron Tomlin
2022-09-29 12:49 ` Rafael Folco
2022-10-21 14:50 ` Frederic Weisbecker
2022-11-10 19:14 ` Marcelo Tosatti
2022-09-24 15:24 ` [PATCH v8 5/5] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
2022-09-25 1:05 ` Hillf Danton
2022-09-26 9:20 ` Aaron Tomlin
2022-10-03 12:44 ` Hillf Danton
2022-10-12 12:41 ` Aaron Tomlin
2022-10-17 16:04 ` Marcelo Tosatti
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=20220924152227.819815-2-atomlin@redhat.com \
--to=atomlin@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@atomlin.com \
--cc=cl@linux.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=mtosatti@redhat.com \
--cc=neelx@redhat.com \
--cc=oleksandr@natalenko.name \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).