linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Vijay Balakrishna <vijayb@linux.microsoft.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Oleg Nesterov <oleg@redhat.com>, Song Liu <songliubraving@fb.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Michal Hocko <mhocko@suse.com>, Allen Pais <apais@microsoft.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [v5] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged
Date: Wed, 30 Sep 2020 11:20:05 -0700	[thread overview]
Message-ID: <2a380b84-4fee-fa4e-e862-8a8577961088@oracle.com> (raw)
In-Reply-To: <1601398153-5517-1-git-send-email-vijayb@linux.microsoft.com>

On 9/29/20 9:49 AM, Vijay Balakrishna wrote:
> When memory is hotplug added or removed the min_free_kbytes should be
> recalculated based on what is expected by khugepaged.  Currently
> after hotplug, min_free_kbytes will be set to a lower default and higher
> default set when THP enabled is lost.  This change restores min_free_kbytes
> as expected for THP consumers.
> 
> Fixes: f000565adb77 ("thp: set recommended min free kbytes")
> 
> Signed-off-by: Vijay Balakrishna <vijayb@linux.microsoft.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
> Acked-by: Michal Hocko <mhocko@suse.com>

Sorry for jumping in so late.  Should we use this as an opportunity to
also fix up the messages logged when (re)calculating mfk?  They are wrong
and could be quite confusing.  For example consider the following sequence
of operations and corresponding log messages produced.

Freshly booted VM with 2 nodes and 8GB memory:
# cat /proc/sys/vm/min_free_kbytes
90112
# echo 90000 > /proc/sys/vm/min_free_kbytes
# cat /proc/sys/vm/min_free_kbytes
90000
# echo 0 > /sys/devices/system/node/node1/memory56/online
[  135.099947] Offlined Pages 32768
[  135.102362] min_free_kbytes is not updated to 11241 because user defined value 90000 is preferred
[  135.109070] khugepaged: raising min_free_kbytes from 90000 to 90112 to help t
ransparent hugepage allocations
# cat /proc/sys/vm/min_free_kbytes
90112
# echo 1 > /sys/devices/system/node/node1/memory56/online
[  231.656075] min_free_kbytes is not updated to 11334 because user defined value 90000 is preferred
# cat /proc/sys/vm/min_free_kbytes
90112

-- 
Mike Kravetz


  reply	other threads:[~2020-09-30 18:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 16:49 Vijay Balakrishna
2020-09-30 18:20 ` Mike Kravetz [this message]
2020-09-30 20:47   ` Vijay Balakrishna
2020-09-30 22:03     ` Mike Kravetz
2020-10-02 11:25       ` Michal Hocko
2020-10-02 18:31         ` Mike Kravetz

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=2a380b84-4fee-fa4e-e862-8a8577961088@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=apais@microsoft.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=oleg@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=songliubraving@fb.com \
    --cc=vijayb@linux.microsoft.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