Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4056663pxk; Tue, 22 Sep 2020 09:14:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmBypWTtq5kQaEUu/M03THLAzJ4c2HWJdkop2pZNjieTsmuHaOk11KTSINV9skEHELKMlS X-Received: by 2002:a17:906:1e11:: with SMTP id g17mr5540315ejj.298.1600791273407; Tue, 22 Sep 2020 09:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600791273; cv=none; d=google.com; s=arc-20160816; b=zeuSOoL5MeCCqoaNL+I7JbUvz8ivWB7iFy4rImJDyi9u4kHhfraf09Zn4sQyRnE5K1 IEnRSw2sYQYWImMzLoIyoWzVdyWFiUlBbZ1eK/KHzXJBtJ5nzqwOcAGdsCxniSmuVDUn RpVoVKyQ8S//uppcYKeKGMH4DRLZFkXbrHf4DotEOekf1aOfOVUVa2q238k/DE+qmW93 rBC8rqF3Nj021sAYuoyQoz77xNIDAXkMXj4aDCMY+qr9O4yiyogiHUHZj1MHMngSHEhH Dho1sbaMjimVssLjvTQ7tJ6Ed6+QupnUXYXvYpQW7vVRQVF/ztpK7id1QtK2lL1GhoZy 5JIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=btgqUGlPHcXDJBGoFCQBBLV5shRqPbZbzBUxZ/4bsTE=; b=iGDaiqTs02qNrkKLxFsticOU3LgbWFBgXf3DCf2+IL4NbQ6l0ttNQwOu8Lcptz+i1O S3bOQg4b8Pre6a4IqubKtMJifL+pleVMgNn2joLNADnFxkz/n3TL4GRl3k5/1Vp1/ATM cygwMrBX24vI4J/8oIOFxpbpaVbcURs2Dpu5D+xSWkF622rfGZRRoXynvZCcUNqoo7J0 z7wLHYud2QiJgJh8WL1wZ+p2pmTStuFasf973/Cj7iSj4qlPO9Cruczm3oD7a/riz3MT 0l5zvSKxqMPjDIfB9Li+U2V7UAbUXGX89SH+uAyTGjbl5KDy4RSNS8S/8S7EX2cf6F4t b6IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gG61C516; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot3si10578509ejb.103.2020.09.22.09.14.08; Tue, 22 Sep 2020 09:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gG61C516; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726577AbgIVQKt (ORCPT + 99 others); Tue, 22 Sep 2020 12:10:49 -0400 Received: from linux.microsoft.com ([13.77.154.182]:39770 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbgIVQKs (ORCPT ); Tue, 22 Sep 2020 12:10:48 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >