linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vijay Balakrishna <vijayb@linux.microsoft.com>
To: Michal Hocko <mhocko@suse.com>
Cc: 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>,
	Allen Pais <apais@microsoft.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [v3 1/2] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged
Date: Fri, 25 Sep 2020 09:31:39 -0700	[thread overview]
Message-ID: <751cd286-5919-fc0a-21b4-75460934e305@linux.microsoft.com> (raw)
In-Reply-To: <20200925074215.GA3389@dhcp22.suse.cz>



On 9/25/2020 12:42 AM, Michal Hocko wrote:
> On Wed 16-09-20 18:21:48, Vijay Balakrishna wrote:
>> When memory is hotplug added or removed the min_free_kbytes must 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>
> 
> I am ok with this patch. I am not sure this is worth backporting to
> stable trees becasuse this is not a functional bug. Surprising behavior,
> yes, but not much more than that.
> 
> Acked-by: Michal Hocko <mhocko@suse.com>

Thanks Michal.

> 
> One minor comment below
> [...]
>> @@ -857,6 +858,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
>>   	zone_pcp_update(zone);
>>   
>>   	init_per_zone_wmark_min();
>> +	khugepaged_min_free_kbytes_update();
>>   
>>   	kswapd_run(nid);
>>   	kcompactd_run(nid);
>> @@ -1600,6 +1602,7 @@ static int __ref __offline_pages(unsigned long start_pfn,
>>   	pgdat_resize_unlock(zone->zone_pgdat, &flags);
>>   
>>   	init_per_zone_wmark_min();
>> +	khugepaged_min_free_kbytes_update();
>>   
>>   	if (!populated_zone(zone)) {
>>   		zone_pcp_reset(zone);
> 
> Can we move khugepaged_min_free_kbytes_update into
> init_per_zone_wmark_min? If it stays external we might hit the same
> problem when somebody else needs to modify min_free_kbytes. Early init
> call will be likely too early for khugepaged but that shouldn't matter
> AFAICS because it will call khugepaged_min_free_kbytes_update on its
> own.

Sure, let me take a look and post v4 next week.

Thanks,
Vijay

> 


  reply	other threads:[~2020-09-25 16:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  1:21 [v3 0/2] recalculate min_free_kbytes post memory hotplug Vijay Balakrishna
2020-09-17  1:21 ` [v3 1/2] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged Vijay Balakrishna
2020-09-23 21:27   ` Vijay Balakrishna
2020-09-25  2:51     ` Andrew Morton
2020-09-25  7:45       ` Michal Hocko
2020-09-25  7:42   ` Michal Hocko
2020-09-25 16:31     ` Vijay Balakrishna [this message]
2020-09-17  1:21 ` [v3 2/2] mm: khugepaged: avoid overriding min_free_kbytes set by user Vijay Balakrishna
2020-09-17  4:22   ` Vijay Balakrishna

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=751cd286-5919-fc0a-21b4-75460934e305@linux.microsoft.com \
    --to=vijayb@linux.microsoft.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 \
    /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;
as well as URLs for NNTP newsgroup(s).