linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] DAMON multiple contexts support
@ 2024-05-31 12:23 Alex Rusuf
  2024-05-31 12:23 ` [PATCH v2 1/2] mm/damon/core: add 'struct kdamond' abstraction layer Alex Rusuf
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Alex Rusuf @ 2024-05-31 12:23 UTC (permalink / raw)
  To: damon; +Cc: sj, linux-mm, linux-kernel

Currently kdamond uses only one context per kthread
and most of its time it sleeps, so utilizing several
contexts can scale kdamond and allow it to use
another set of operations.

This patch-set implements support for multiple contexts
per kdamond.

In pseudo code previous versions worked like
the following:

	while (!kdamond_should_stop()) {

		/* prepare accesses for only 1 context */
		prepare_accesses(damon_context);

		sleep(sample_interval);

		/* check accesses for only 1 context */
		check_accesses(damon_context);

		...
	}

With this patch kdamond workflow will look
like the following:

	while (!kdamond_shoule_stop()) {

		/* prepare accesses for all contexts in kdamond */
		damon_for_each_context(ctx, kdamond)
			prepare_accesses(ctx);

		sleep(sample_interval);

		/* check_accesses for all contexts in kdamond */
		damon_for_each_context(ctx, kdamond)
			check_accesses(ctx);

			...
	}

To try this you can use modified kernel[1] and
damo[2]. I also have written few simple shell scripts[3]
to collect data for damo.

	[1] https://github.com/onlyoneofme/damon-multi-contexts.git
	[2] https://github.com/onlyoneofme/damo/tree/multi-contexts
	[3] https://github.com/onlyoneofme/damon-multi-contexts-tests.git

---
Changes from v1 (https://lore.kernel.org/damon/20240515152457.603724-1-yorha.op@gmail.com/)
- Compatibility for DebugFS interface is kept
- Kunit tests build/execution issues are fixed
- Patches from v1 are sqaushed, so that consistency between patches is
kept
- Added/Fixed comments about data structures/functions

Alex Rusuf (2):
  mm/damon/core: add 'struct kdamond' abstraction layer
  mm/damon/core: implement multi-context support

 include/linux/damon.h        |  80 ++++--
 include/trace/events/damon.h |  14 +-
 mm/damon/core-test.h         |   2 +-
 mm/damon/core.c              | 509 ++++++++++++++++++++++-------------
 mm/damon/dbgfs-test.h        |   4 +-
 mm/damon/dbgfs.c             | 342 ++++++++++++++---------
 mm/damon/lru_sort.c          |  31 ++-
 mm/damon/modules-common.c    |  35 ++-
 mm/damon/modules-common.h    |   3 +-
 mm/damon/reclaim.c           |  30 ++-
 mm/damon/sysfs.c             | 303 +++++++++++++--------
 11 files changed, 872 insertions(+), 481 deletions(-)

-- 
2.42.0



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

end of thread, other threads:[~2024-06-17  6:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-31 12:23 [PATCH v2 0/2] DAMON multiple contexts support Alex Rusuf
2024-05-31 12:23 ` [PATCH v2 1/2] mm/damon/core: add 'struct kdamond' abstraction layer Alex Rusuf
2024-05-31 18:55   ` kernel test robot
2024-05-31 19:36   ` SeongJae Park
2024-06-02 16:15     ` Alex Rusuf
2024-06-02 16:51       ` SeongJae Park
2024-05-31 12:23 ` [PATCH v2 2/2] mm/damon/core: implement multi-context support Alex Rusuf
2024-05-31 19:26   ` kernel test robot
2024-05-31 19:38   ` SeongJae Park
2024-06-02 15:08     ` Alex Rusuf
2024-06-02 15:48       ` SeongJae Park
2024-06-02 19:48         ` Alex Rusuf
2024-06-03 18:45           ` SeongJae Park
2024-05-31 20:08   ` kernel test robot
2024-06-17  6:59   ` kernel test robot
2024-05-31 19:33 ` [PATCH v2 0/2] DAMON multiple contexts support SeongJae Park
2024-06-02 15:31   ` Alex Rusuf
2024-06-02 15:56     ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox