linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] mm/gup: move pinned pages to unevictable list to avoid meaningless scan
@ 2023-08-26  9:22 Jinjiang Tu
  2023-08-26  9:22 ` [RFC PATCH 1/2] " Jinjiang Tu
  2023-08-26  9:22 ` [RFC PATCH 2/2] mm/gup: remove folio_maybe_dma_pinned() calls in shrink_page_list() Jinjiang Tu
  0 siblings, 2 replies; 3+ messages in thread
From: Jinjiang Tu @ 2023-08-26  9:22 UTC (permalink / raw)
  To: linux-mm, akpm, wangkefeng.wang; +Cc: tujinjiang

The pages pinned by GUP interfaces are unable to be swapped out. Currently,
these pages are put into active/inactive list, leading to meaningless scan
when reclaiming memory.

Even worse, when we try to pin memory more than free memory, the system
fails to response for long time, all tasks are reclaiming memory. However,
the process takes long time to scan too much pinned pages, but only reclaim
few pages. Because each scan takes too much time, during this time, some
pages are swapped out again, some pages can be reclaimed again during next
scan. As a result, the OOM condition is not easy to meet.

I reproduce this problem by gup_test utility (CONFIG_GUP_TEST is needed).
The system has 3.3G free memory, and I pins 4G memory by command
'./gup_test -b -m 4096'. The system will fail to response for 10+ minutes
before triggering OOM.

To solve this problem, this patchset moves pinned pages to unevictable list
to avoid meaningless scanning during memory reclaim.

Jinjiang Tu (2):
  mm/gup: move pinned pages to unevictable list to avoid meaningless
    scan
  mm/gup: remove folio_maybe_dma_pinned() calls in shrink_page_list()

 mm/gup.c      | 13 +++++++++++++
 mm/internal.h |  2 +-
 mm/vmscan.c   | 12 ------------
 3 files changed, 14 insertions(+), 13 deletions(-)

-- 
2.25.1



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

end of thread, other threads:[~2023-08-26  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-26  9:22 [RFC PATCH 0/2] mm/gup: move pinned pages to unevictable list to avoid meaningless scan Jinjiang Tu
2023-08-26  9:22 ` [RFC PATCH 1/2] " Jinjiang Tu
2023-08-26  9:22 ` [RFC PATCH 2/2] mm/gup: remove folio_maybe_dma_pinned() calls in shrink_page_list() Jinjiang Tu

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