linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/5] folio based filemap_map_pages()
@ 2023-02-01  8:17 Yin Fengwei
  2023-02-01  8:17 ` [RFC PATCH v2 1/5] mm: Enable fault around for shared file page fault Yin Fengwei
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Yin Fengwei @ 2023-02-01  8:17 UTC (permalink / raw)
  To: willy, david, linux-mm; +Cc: dave.hansen, tim.c.chen, ying.huang, fengwei.yin

Current filemap_map_pages() uses page granularity even when
underneath folio is large folio. Making it use folio based
granularity allows batched refcount, rmap and mm counter
update. Which brings performance gain.

This sereis tries to bring batched refcount, rmap and
mm counter for filemap_map_pages(). Testing with a micro
benchmark like will-it-scale.pagefault on a 48C/96T IceLake
tbox showed:
   - batched rmap brings around 15% performance gain
   - batched refcount brings around 2% performance gain

Patch 1 enabled the fault around for share file page write
        fault. As David suggested here: [1]

Patch 2 update filemap_map_pages() to do map based on folio
        granularity and batched refcount update

Patch 3,4,5 enable batched rmap and mm counter

[1] https://lore.kernel.org/linux-mm/e14b4e9a-612d-fc02-edc0-8f3b6bcf4148@redhat.com/

Change from v1:
  - Update the struct page * parameter of *_range() to index
    in the folio as Matthew suggested
  - Fix indentations problem as Matthew pointed out
  - Add back the function comment as Matthew pointed out
  - Use nr_pages than len as Matthew pointed out
  - Add do_set_pte_range() as Matthew suggested
  - Add function comment as Ying suggested
  - Add performance test result to patch 1/2/5 commit message

  Patch 1:
    - Adapt commit message as Matthew suggested
    - Add Reviweed-by from Matthew
  Patch 3:
    - Restore general logic of page_add_file_rmap_range() to
      make patch review easier as Matthew suggested
  Patch 5:
    - Add perf data collected to understand the reason of
      performance gain

Yin Fengwei (5):
  mm: Enable fault around for shared file page fault
  filemap: add function filemap_map_folio_range()
  rmap: add page_add_file_rmap_range()
  mm: add do_set_pte_range()
  filemap: batched update mm counter,rmap when map file folio

 include/linux/mm.h   |   2 +
 include/linux/rmap.h |   2 +
 mm/filemap.c         | 119 ++++++++++++++++++++++++++++++-------------
 mm/memory.c          |  71 +++++++++++++++++++++-----
 mm/rmap.c            |  66 +++++++++++++++++++-----
 5 files changed, 199 insertions(+), 61 deletions(-)

-- 
2.30.2



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

end of thread, other threads:[~2023-02-03 13:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  8:17 [RFC PATCH v2 0/5] folio based filemap_map_pages() Yin Fengwei
2023-02-01  8:17 ` [RFC PATCH v2 1/5] mm: Enable fault around for shared file page fault Yin Fengwei
2023-02-01 14:34   ` Kirill A. Shutemov
2023-02-02  1:54     ` Yin, Fengwei
2023-02-01  8:17 ` [RFC PATCH v2 2/5] filemap: add function filemap_map_folio_range() Yin Fengwei
2023-02-01  8:17 ` [RFC PATCH v2 3/5] rmap: add page_add_file_rmap_range() Yin Fengwei
2023-02-01 17:32   ` Matthew Wilcox
2023-02-02  2:00     ` Yin, Fengwei
2023-02-01  8:17 ` [RFC PATCH v2 4/5] mm: add do_set_pte_range() Yin Fengwei
2023-02-01  9:09   ` David Hildenbrand
2023-02-01 10:04     ` Yin, Fengwei
2023-02-01 17:38   ` Matthew Wilcox
2023-02-01 21:59     ` Matthew Wilcox
2023-02-02  3:18     ` Yin, Fengwei
2023-02-03  8:54     ` Yin Fengwei
2023-02-01  8:17 ` [RFC PATCH v2 5/5] filemap: batched update mm counter,rmap when map file folio Yin Fengwei
2023-02-01 15:50   ` Matthew Wilcox
2023-02-02  3:31     ` Yin, Fengwei
2023-02-03 13:15     ` Yin, Fengwei

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