linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Reduce lock contention related with large folio
@ 2023-04-17  7:56 Yin Fengwei
  2023-04-17  7:56 ` [PATCH 1/2] THP: avoid lock when check whether THP is in deferred list Yin Fengwei
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yin Fengwei @ 2023-04-17  7:56 UTC (permalink / raw)
  To: linux-mm, akpm, willy, yuzhao, ryan.roberts; +Cc: fengwei.yin

Ryan tried to enable the large folio for anonymous mapping [1].

Unlike large folio for page cache which doesn't trigger frequent page
allocation/free, large folio for anonymous mapping is allocated/freeed
more frequently. So large folio for anonymous mapping exposes some lock
contention.

Ryan mentioned the deferred queue lock in [1]. We also met other two
lock contention: lru lock and zone lock.

This series tries to mitigate the deferred queue lock and reduce lru
lock in some level.

The patch1 tries to reduce deferred queue lock by not acquiring queue
lock when check whether the folio is in deferred list or not. Test
page fault1 of will-it-scale showed 60% deferred queue lock contention
reduction.

The patch2 tries to reduce lru lock by allowing batched add large folio
to lru list. Test page fault1 of will-it-scale showed 20% lru lock
contention reduction.

The zone lock contention happens on large folio free path and related
with commit f26b3fa04611 "mm/page_alloc: limit number of high-order
pages on PCP during bulk free" and will not be address by this series.


[1]
https://lore.kernel.org/linux-mm/20230414130303.2345383-1-ryan.roberts@arm.com/

Yin Fengwei (2):
  THP: avoid lock when check whether THP is in deferred list
  lru: allow large batched add large folio to lru list

 include/linux/pagevec.h | 19 +++++++++++++++++--
 mm/huge_memory.c        | 19 ++++++++++++++++---
 mm/swap.c               |  3 +--
 3 files changed, 34 insertions(+), 7 deletions(-)

-- 
2.30.2



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

end of thread, other threads:[~2023-04-18  6:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17  7:56 [PATCH 0/2] Reduce lock contention related with large folio Yin Fengwei
2023-04-17  7:56 ` [PATCH 1/2] THP: avoid lock when check whether THP is in deferred list Yin Fengwei
2023-04-17  7:56 ` [PATCH 2/2] lru: allow large batched add large folio to lru list Yin Fengwei
2023-04-17 12:25   ` Matthew Wilcox
2023-04-18  1:57     ` Yin Fengwei
2023-04-18  2:37       ` Yin Fengwei
2023-04-18  6:39         ` Huang, Ying
2023-04-17 10:33 ` [PATCH 0/2] Reduce lock contention related with large folio Ryan Roberts

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