All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] mm,thp,shm: limit shmem THP alloc gfp_mask
@ 2020-11-24 19:49 Rik van Riel
  2020-11-24 19:49 ` [PATCH 1/3] mm,thp,shmem: " Rik van Riel
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Rik van Riel @ 2020-11-24 19:49 UTC (permalink / raw)
  To: hughd
  Cc: xuyu, akpm, mgorman, aarcange, willy, linux-kernel, kernel-team,
	linux-mm, vbabka, mhocko

The allocation flags of anonymous transparent huge pages can be controlled
through the files in /sys/kernel/mm/transparent_hugepage/defrag, which can
help the system from getting bogged down in the page reclaim and compaction
code when many THPs are getting allocated simultaneously.

However, the gfp_mask for shmem THP allocations were not limited by those
configuration settings, and some workloads ended up with all CPUs stuck
on the LRU lock in the page reclaim code, trying to allocate dozens of
THPs simultaneously.

This patch applies the same configurated limitation of THPs to shmem
hugepage allocations, to prevent that from happening.

This way a THP defrag setting of "never" or "defer+madvise" will result
in quick allocation failures without direct reclaim when no 2MB free
pages are available.

With this patch applied, THP allocations for tmpfs will be a little
more aggressive than today for files mmapped with MADV_HUGEPAGE,
and a little less aggressive for files that are not mmapped or
mapped without that flag.

v6: make khugepaged actually obey tmpfs mount flags
v5: reduce gfp mask further if needed, to accomodate i915 (Matthew Wilcox)
v4: rename alloc_hugepage_direct_gfpmask to vma_thp_gfp_mask (Matthew Wilcox)
v3: fix NULL vma issue spotted by Hugh Dickins & tested
v2: move gfp calculation to shmem_getpage_gfp as suggested by Yu Xu



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

end of thread, other threads:[~2021-02-26 12:35 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 19:49 [PATCH v6 0/3] mm,thp,shm: limit shmem THP alloc gfp_mask Rik van Riel
2020-11-24 19:49 ` [PATCH 1/3] mm,thp,shmem: " Rik van Riel
2020-11-26 16:56   ` Vlastimil Babka
2020-11-27  8:15   ` Michal Hocko
2020-11-24 19:49 ` [PATCH 2/3] mm,thp,shm: limit gfp mask to no more than specified Rik van Riel
2020-11-26 13:40   ` Michal Hocko
2020-11-26 18:04     ` Rik van Riel
2020-11-26 18:04       ` Rik van Riel
2020-11-27  7:52       ` Michal Hocko
2020-11-27 19:03         ` Rik van Riel
2020-11-27 19:03           ` Rik van Riel
2020-11-30 10:00           ` Michal Hocko
2020-11-30 14:40             ` Rik van Riel
2020-11-30 14:40               ` Rik van Riel
2020-11-24 19:49 ` [PATCH 3/3] mm,thp,shmem: make khugepaged obey tmpfs mount flags Rik van Riel
2020-11-26 17:18   ` Vlastimil Babka
2020-11-26 18:14     ` Rik van Riel
2020-11-26 18:14       ` Rik van Riel
2020-11-26 19:42       ` Vlastimil Babka
2020-11-26 20:14         ` Rik van Riel
2020-11-26 20:14           ` Rik van Riel
2020-12-14 21:16 ` [PATCH v6 0/3] mm,thp,shm: limit shmem THP alloc gfp_mask Hugh Dickins
2020-12-14 21:16   ` Hugh Dickins
2020-12-14 22:20   ` Andrew Morton
2020-12-14 22:52   ` Vlastimil Babka
2021-02-24  8:41     ` Hugh Dickins
2021-02-24  8:41       ` Hugh Dickins
2021-02-24 14:46       ` Rik van Riel
2021-02-24 14:46         ` Rik van Riel
2021-02-24 16:55         ` Hugh Dickins
2021-02-24 16:55           ` Hugh Dickins
2021-02-24 17:10           ` [PATCH 4/3] mm,shmem,thp: limit shmem THP allocations to requested zones Rik van Riel
2021-02-26 12:34             ` Vlastimil Babka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.