linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Docs/mm/damon/design: describe the differences for pageout's virtual address and physcial address
@ 2024-02-24 21:50 Barry Song
  2024-02-24 22:08 ` SeongJae Park
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2024-02-24 21:50 UTC (permalink / raw)
  To: corbet, linux-mm, akpm, damon, linux-doc
  Cc: linux-kernel, Barry Song, SeongJae Park, Minchan Kim,
	Michal Hocko, Johannes Weiner

From: Barry Song <v-songbaohua@oppo.com>

The doc needs update. As only in the case of virtual address, we are
calling madvise() with MADV_PAGEOUT; but in the case of physical
address, we are actually calling reclaim_pages() directly. And
madvise() with MADV_PAGEOUT is much more aggresive on reclamation
compared to reclaim_pages() on paddr.

Cc: SeongJae Park <sj@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
---
 Documentation/mm/damon/design.rst | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 8c89d26f0baa..6c50743552f5 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -315,7 +315,13 @@ that supports each action are as below.
    Supported by ``vaddr`` and ``fvaddr`` operations set.
  - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``.
    Supported by ``vaddr`` and ``fvaddr`` operations set.
- - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``.
+ - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT`` if
+   the region is using virtual address; otherwise, call ``reclaim_pages()``
+   for the region if physical address is used.
+   ``madvise()``  with ``MADV_PAGEOUT``  is aggressively reclaiming memory
+   when pages are not shared by multiple processes. Differently, paddr's
+   pageout  will do the best-effort reclamation by scanning PTEs to figure
+   out if pages are young, if not, pages are reclaimed.
    Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
  - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``.
    Supported by ``vaddr`` and ``fvaddr`` operations set.
-- 
2.34.1



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

end of thread, other threads:[~2024-02-24 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-24 21:50 [PATCH] Docs/mm/damon/design: describe the differences for pageout's virtual address and physcial address Barry Song
2024-02-24 22:08 ` SeongJae Park
2024-02-24 22:33   ` Barry Song

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