linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too
@ 2022-08-01 23:42 Aaron Tomlin
  2022-08-01 23:42 ` [PATCH v5 1/2] mm/vmstat: Use per cpu variable to track a vmstat discrepancy Aaron Tomlin
  2022-08-01 23:42 ` [PATCH v5 2/2] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
  0 siblings, 2 replies; 6+ messages in thread
From: Aaron Tomlin @ 2022-08-01 23:42 UTC (permalink / raw)
  To: frederic, mtosatti
  Cc: cl, tglx, mingo, peterz, pauld, neelx, oleksandr, atomlin,
	linux-kernel, linux-mm

Hi Frederic and Marcelo,

I have incorporated an idea from Marcelo's patch [1] where a CPU-specific
variable is used to indicate if a vmstat differential/or imbalance is
present for a given CPU. So, at the appropriate time, vmstat processing can
be initiated. The hope is that this particular approach is "cheaper" when
compared to need_update() - used currently; in the context of nohz_full and
the scheduling-clock tick being stopped, we would now with this patch,
check if a CPU-specific vmstat imbalance is present before exiting
user-mode (see tick_nohz_user_enter_prepare()).

This trivial test program [2] was used to determine the somewhat impact
under vanilla and with the proposed changes; mlock(2) and munlock(2) was
used solely to modify vmstat item 'NR_MLOCK'. The following is an average
count of CPU-cycles across the aforementioned system calls and the idle
loop, respectively. I believe these results are negligible:

	  Modified		   |  		Vanilla
                                   |
  cycles per syscall: 7399         | 	cycles per syscall: 4150
  cycles per idle loop: 141048     |	cycles per idle loop: 144730
                                   |


Any feedback would be appreciated. Thanks.

Changes since v4 [3]:

 - Moved vmstat_dirty specific changes into a separate patch
   (Marcelo Tosatti)

Changes since v3 [4]:

 - Used EXPORT_SYMBOL() on tick_nohz_user_enter_prepare()
 - Replaced need_update()
 - Introduced CPU-specific variable namely vmstat_dirty
   and mark_vmstat_dirty()

[1]: https://lore.kernel.org/lkml/20220204173554.763888172@fedora.localdomain/
[2]: https://pastebin.com/8AtzSAuK
[3]: https://lore.kernel.org/lkml/20220621172207.1501641-1-atomlin@redhat.com/
[4]: https://lore.kernel.org/lkml/20220422193647.3808657-1-atomlin@redhat.com/


Aaron Tomlin (2):
  mm/vmstat: Use per cpu variable to track a vmstat discrepancy
  tick/sched: Ensure quiet_vmstat() is called when the idle tick was
    stopped too

 include/linux/tick.h     |  9 ++------
 kernel/time/tick-sched.c | 19 ++++++++++++++++-
 mm/vmstat.c              | 46 +++++++++++++---------------------------
 3 files changed, 35 insertions(+), 39 deletions(-)

-- 
2.37.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-03  6:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 23:42 [PATCH v5 0/2] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
2022-08-01 23:42 ` [PATCH v5 1/2] mm/vmstat: Use per cpu variable to track a vmstat discrepancy Aaron Tomlin
2022-08-01 23:42 ` [PATCH v5 2/2] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Aaron Tomlin
2022-08-02 22:11   ` kernel test robot
2022-08-03  5:43   ` kernel test robot
2022-08-03  6:14   ` kernel test robot

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).