linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Johannes Weiner <hannes@cmpxchg.org>,
	Usama Arif <usamaarif642@gmail.com>
Cc: Nico Pache <npache@redhat.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Barry Song <baohua@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	Lance Yang <ioworker0@gmail.com>, Peter Xu <peterx@redhat.com>,
	 Rafael Aquini <aquini@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Zi Yan <ziy@nvidia.com>
Subject: Re: [RFC 0/2] mm: introduce THP deferred setting
Date: Tue, 27 Aug 2024 21:18:58 -0400	[thread overview]
Message-ID: <9cf237df1a7bb21bba1a464787938eba8f372658.camel@surriel.com> (raw)
In-Reply-To: <20240827110959.GA438928@cmpxchg.org>

On Tue, 2024-08-27 at 13:09 +0200, Johannes Weiner wrote:
> 
> I agree with this. The defer mode is an improvement over the upstream
> status quo, no doubt. However, both defer mode and the shrinker solve
> the issue of memory waste under pressure, while the shrinker permits
> more desirable behavior when memory is abundant.
> 
> So my take is that the shrinker is the way to go, and I don't see a
> bonafide usecase for defer mode that the shrinker couldn't cover.
> 
> 
I would like to take one step back, and think about what some real
world workloads might want as a tunable for THP.

Workload owners are going to have a real problem trying to figure
out what the best value of max_ptes_none should be for their
workloads.

However, giving workload owners the ability to say "this workload
should not waste more than 1GB of memory on zero pages inside THPs",
or 500MB, or 4GB or whatever, would then allow the kernel to
automatically adjust the max_ptes_none threshold.

Once a workload is close to, or exceeding the maximum amount of
THP zero page overhead, we could both shrink THPs, and disable
direct THP allocation at page fault time for that workload.

If we want to give workload owners a predictable, easy to work
with tunable, we probably want both the shrinker and the deferred
allocation.

-- 
All Rights Reversed.


  parent reply	other threads:[~2024-08-28  1:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 22:27 Nico Pache
2024-07-29 22:27 ` [RFC 1/2] mm: defer THP insertion to khugepaged Nico Pache
2024-07-29 22:27 ` [RFC 2/2] mm: document transparent_hugepage=defer usage Nico Pache
2024-07-30  1:26 ` [RFC 0/2] mm: introduce THP deferred setting Zi Yan
2024-07-30 22:37   ` Nico Pache
2024-08-26 15:40     ` Nico Pache
2024-08-26 16:47       ` Usama Arif
2024-08-26 21:14         ` Nico Pache
2024-08-27 10:37           ` Usama Arif
2024-08-27 11:09             ` Johannes Weiner
2024-08-27 11:46               ` David Hildenbrand
2024-08-27 13:05                 ` Johannes Weiner
2024-08-27 13:22                   ` David Hildenbrand
2024-08-27 13:57                     ` Usama Arif
2024-08-27 22:04                       ` Nico Pache
2024-08-28  1:18               ` Rik van Riel [this message]
2024-08-28  6:17                 ` Kirill A . Shutemov
2024-08-28 10:44                   ` Usama Arif
2024-08-28 12:54                   ` 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=9cf237df1a7bb21bba1a464787938eba8f372658.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=ioworker0@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npache@redhat.com \
    --cc=peterx@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=usamaarif642@gmail.com \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.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