From: Michal Hocko <mhocko@suse.com>
To: Rik van Riel <riel@surriel.com>
Cc: hughd@google.com, xuyu@linux.alibaba.com,
akpm@linux-foundation.org, mgorman@suse.de, aarcange@redhat.com,
willy@infradead.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, linux-mm@kvack.org, vbabka@suse.cz
Subject: Re: [PATCH 1/2] mm,thp,shmem: limit shmem THP alloc gfp_mask
Date: Thu, 12 Nov 2020 11:52:58 +0100 [thread overview]
Message-ID: <20201112105258.GZ12240@dhcp22.suse.cz> (raw)
In-Reply-To: <20201105191508.1961686-2-riel@surriel.com>
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@surriel.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
next prev parent reply other threads:[~2020-11-12 10:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-05 19:15 [PATCH 0/2] mm,thp,shm: " Rik van Riel
2020-11-05 19:15 ` [PATCH 1/2] mm,thp,shmem: " Rik van Riel
2020-11-12 10:52 ` Michal Hocko [this message]
2020-11-14 3:44 ` Rik van Riel
2020-11-19 9:37 ` Michal Hocko
2020-11-05 19:15 ` [PATCH 2/2] mm,thp,shm: limit gfp mask to no more than specified Rik van Riel
2020-11-06 3:05 ` Hillf Danton
2020-11-06 17:53 ` Rik van Riel
2020-11-07 1:58 ` Hillf Danton
2020-11-12 11:22 ` Michal Hocko
2020-11-14 3:40 ` Rik van Riel
2020-11-19 9:38 ` Michal Hocko
2020-11-23 19:39 ` Rik van Riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201112105258.GZ12240@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=riel@surriel.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=xuyu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox