From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C056FC4727D for ; Tue, 22 Sep 2020 16:10:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3444822206 for ; Tue, 22 Sep 2020 16:10:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="gG61C516" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3444822206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C4A3D90000A; Tue, 22 Sep 2020 12:10:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD3A4900059; Tue, 22 Sep 2020 12:10:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 997F790000A; Tue, 22 Sep 2020 12:10:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 6CCAC90000A for ; Tue, 22 Sep 2020 12:10:50 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 26BD98249980 for ; Tue, 22 Sep 2020 16:10:50 +0000 (UTC) X-FDA: 77291185860.13.mouth35_5e182502714f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 03C8718140B67 for ; Tue, 22 Sep 2020 16:10:49 +0000 (UTC) X-HE-Tag: mouth35_5e182502714f X-Filterd-Recvd-Size: 3670 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 16:10:49 +0000 (UTC) Received: from [192.168.0.121] (unknown [209.134.121.133]) by linux.microsoft.com (Postfix) with ESMTPSA id B3F8A20B7179; Tue, 22 Sep 2020 09:10:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B3F8A20B7179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1600791048; bh=btgqUGlPHcXDJBGoFCQBBLV5shRqPbZbzBUxZ/4bsTE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=gG61C516bFmLMoBcukPvU1B3pY25eovLiNFOj6RkTDp/N9dWt72B14UQImyRh1xi4 kZiQs9XRdcO4IkjCzYRgkonVZSgvziHQpRUYbcRW5/nyWLaSGp3rRW98D39o+cToSg AKlcQ+ZQ9SsE/KkDLkM09DeOBGWh+L8wcQoWzm0s= Subject: Re: [v4] mm: khugepaged: avoid overriding min_free_kbytes set by user To: Michal Hocko , "Kirill A. Shutemov" Cc: Andrew Morton , Oleg Nesterov , Song Liu , Andrea Arcangeli , Pavel Tatashin , Allen Pais , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <1600324779-6782-1-git-send-email-vijayb@linux.microsoft.com> <20200917092805.GA29887@dhcp22.suse.cz> <21c4788c-2516-2e47-5885-486c352c2b6e@linux.microsoft.com> <20200917175217.GD29887@dhcp22.suse.cz> <20200918055637.GB28827@dhcp22.suse.cz> <20200922070726.dlw24lf3wd3p2ias@black.fi.intel.com> <20200922100702.GX12990@dhcp22.suse.cz> From: Vijay Balakrishna Message-ID: Date: Tue, 22 Sep 2020 09:10:46 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <20200922100702.GX12990@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/22/2020 3:07 AM, Michal Hocko wrote: > On Tue 22-09-20 10:07:26, Kirill A. Shutemov wrote: >> On Mon, Sep 21, 2020 at 12:07:23PM -0700, Vijay Balakrishna wrote: >>>> >>>> I would recommend reposting the patch which adds heuristic for THP (if >>>> THP is enabled) into the hotplug path, arguing with the consistency and >>>> surprising results when adding memory decreases the value. >>> >>> I hope my reposted patch >>> ([v3 1/2] mm: khugepaged: recalculate min_free_kbytes after memory hotplug >>> as expected by khugepaged) >>> change log is ok: >>> >>> 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. >> >> Any scenario when hotremove would result in changing min_free_kbytes? > > init_per_zone_wmark_min is called from both online and offline path. But > I believe the problem is not in the offlining path. A decrease wrt > previous auto tuned value is to be expected. The primary problem is that > the hotadding memory after boot (without any user configured value) will > decrease the value effectively because khugepaged tuning > (set_recommended_min_free_kbytes) is not called. Thank you Michal and Kirill. Vijay >