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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 ACCE2C2D0E2 for ; Tue, 22 Sep 2020 10:07:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 268CE238A1 for ; Tue, 22 Sep 2020 10:07:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="IbJCsazj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 268CE238A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AB9D690004C; Tue, 22 Sep 2020 06:07:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9118900036; Tue, 22 Sep 2020 06:07:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CE7490004C; Tue, 22 Sep 2020 06:07:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 88C43900036 for ; Tue, 22 Sep 2020 06:07:09 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4CAC6180AD801 for ; Tue, 22 Sep 2020 10:07:09 +0000 (UTC) X-FDA: 77290269378.02.brake68_1f088bc2714c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 30A0210097A14 for ; Tue, 22 Sep 2020 10:07:09 +0000 (UTC) X-HE-Tag: brake68_1f088bc2714c X-Filterd-Recvd-Size: 3483 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 10:07:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600769227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XJcev0KH0kDxKMs7n4Aga90c3i9CO0R3TV3nnggFYx8=; b=IbJCsazj1TR7HAe1Lm3x7g1wcML0kjpZ50jrG1+pf9/FiZ7TQwefz293FPgbGE3WF8L/aR oFWBmZxYtQ5VxHBu/BASom2K64GkHXuVn3jlarXv/A659gEHQBZt0ZVFIot5nMRjeYmxUM T7bd+0LNxOiWHPEcIY9umhMZNlcoM2A= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 76147B4FB; Tue, 22 Sep 2020 10:07:43 +0000 (UTC) Date: Tue, 22 Sep 2020 12:07:02 +0200 From: Michal Hocko To: "Kirill A. Shutemov" Cc: Vijay Balakrishna , Andrew Morton , Oleg Nesterov , Song Liu , Andrea Arcangeli , Pavel Tatashin , Allen Pais , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [v4] mm: khugepaged: avoid overriding min_free_kbytes set by user Message-ID: <20200922100702.GX12990@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922070726.dlw24lf3wd3p2ias@black.fi.intel.com> 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 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. -- Michal Hocko SUSE Labs