[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201112105258.GZ12240@dhcp22.suse.cz>
Date: Thu, 12 Nov 2020 11:52:58 +0100
From: Michal Hocko <mhocko@...e.com>
To: Rik van Riel <riel@...riel.com>
Cc: hughd@...gle.com, xuyu@...ux.alibaba.com,
akpm@...ux-foundation.org, mgorman@...e.de, aarcange@...hat.com,
willy@...radead.org, linux-kernel@...r.kernel.org,
kernel-team@...com, linux-mm@...ck.org, vbabka@...e.cz
Subject: Re: [PATCH 1/2] mm,thp,shmem: limit shmem THP alloc gfp_mask
On Thu 05-11-20 14:15:07, Rik van Riel wrote:
> 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.
I believe you should also exaplain why we want to control defrag by the
global knob while the enable logic is per mount.
> 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.
This begs some numbers. A little is rather bad unit of performance. I do
agree that unifying those makes sense in general though.
> Signed-off-by: Rik van Riel <riel@...riel.com>
> ---
> include/linux/gfp.h | 2 ++
> mm/huge_memory.c | 6 +++---
> mm/shmem.c | 8 +++++---
> 3 files changed, 10 insertions(+), 6 deletions(-)
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists