Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3806192pxk; Tue, 22 Sep 2020 03:08:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhlPOtPWEn1epP+vk2YirM/YzH2jFnmnfZNohbE5ZrMh35a0Mz3xVJJ3ago2rTADs8LZ/h X-Received: by 2002:aa7:cf93:: with SMTP id z19mr3152295edx.187.1600769311648; Tue, 22 Sep 2020 03:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600769311; cv=none; d=google.com; s=arc-20160816; b=ierQGjGYYnlYEKGh/9kMtkLVk0EU9kpGRXMbiHUQivcyCsWMCwTAva59D7LHVL4w8C QvFLfaD0oxYB3/vmC2RzxZYnm2uB4uBJS6g71z5RxKKZPSufdEzOA80rguyYkJYe1yvf WjWQfi0pxsz+xGe42e0bQK8HDDwO4PEJwbxPwAOnVdZSrFiqQcpeP16ErdjVMkANT5KR 7J0Wsn0Gj/XvNoDo2Phx+yhgDs7KbYob6dK6FVYJKt/tVdjQpk5RBUQTGC5QgZtKvJzB VccksH45pp5CI2JHW1lax9/+olYaDWEYaOf86TmThfEChrEy//5+W9Pj6moi0pAiZ8JM 7RbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XJcev0KH0kDxKMs7n4Aga90c3i9CO0R3TV3nnggFYx8=; b=wDTWA7d+5o1K9I+2xOg/zvbBAjU0MOt4+YGWuoh8tGLNY3UXuQCrllY+Lqauie+OzP 6udmQ2gM/d2ReIt359WdgGItgbYKs2+IZSnBTrfqfLFGnmIB04+acpwjZk4biOd6lt3+ hXnBV+97ARgXrQB3UMhu+bAn4zQhD6yCVhYkyGCPEigC0U65dXemvjFIvpXgE2KH8L4G EO/ZhcV1ssYMhQxY6zy/yNCXNJWv5gK0fTL4DqEmHsAvT870dd7B5onr0OZIPGQL2gT4 pD46bEoSgl1Y65LOeOgSw4kOkZI2yYX5D0B72s2EPB/RnB0UFGVynVyZqGhDX2p83gno Zi8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IbJCsazj; 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=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu16si10062301ejb.218.2020.09.22.03.08.08; Tue, 22 Sep 2020 03:08:31 -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=@suse.com header.s=susede1 header.b=IbJCsazj; 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=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbgIVKHK (ORCPT + 99 others); Tue, 22 Sep 2020 06:07:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:43616 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgIVKHJ (ORCPT ); Tue, 22 Sep 2020 06:07:09 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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