Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1446692pxk; Thu, 10 Sep 2020 16:00:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaYtwzDMfl6dHlDFq5db7Q1+oo80rfWF1ruTDRupNzANcG+cenF8wJUekS2USCN0Tzs9Vk X-Received: by 2002:a17:906:a0c2:: with SMTP id bh2mr11605468ejb.493.1599778845070; Thu, 10 Sep 2020 16:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599778845; cv=none; d=google.com; s=arc-20160816; b=CtDsUI5SwyEwEYod1bUJ7E4nMkB5w4aqwE1zsVm1Z9bhPApqKb6bsA1hGSedUSc9Te bx+fE/dN4AdLXn7IqEelko6LaQpDknmU/3E/6exI5nDGsPldifYuV9iFKSNtpkTMy2Rl GKYugJj7s4Qo7SLYiNZQ4D//vxfddqTvywWZ/Tyv0g1aJMGUHKLmp135h+giT6G7zm2D DoangJAGTNYIjP+LrxwT5p+VQ2F1yVa9LWhHREmE+WDswk1DFgZ9WiaCh/lRel320HyQ AVX9WAepN7mSjcl/M231oBU0h4eiIQcCpAEzHs2RdHfrMpRlYk/3ueCpK3Kgoef/0MrJ QFrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=DlYJOMEzeEFK4Nozie1ZQ0hdzVfQG5TN5yUejRLatBo=; b=k8HgOIq8/1/5WXZJ0Dz96mwd2ytvqzP/UwsA7l1bQusvwzsZftpb7TnN347Qw4Uc5W myk0tzu9ML+9H+xzDB5ix+SldOu3SVR9ghusefhynaLADhrnUCk6QWGeZVqi/q7VH36o /ZRcW9SczpcfkvmfQ3Wq99NhSIcTL2Ti4l2R1rQwAN0FHCrZ9duKWMoYexn+CFKnej+v o3qeB3MW23gMTg+jE6u1JEQWKyLB/UCsRNrmpUSPfnoPXAjJ7bVGYEiDkdQeI2pb7wRf KGTridi6TS8G38HkjRDjwDbhg+H7YMphVw708uqhAaBs2VjXUMc23jXxB/pKXqbuV8YD oq6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=NcxTxOLd; 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 s11si49914eju.295.2020.09.10.16.00.22; Thu, 10 Sep 2020 16:00:45 -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=NcxTxOLd; 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 S1725766AbgIJW5A (ORCPT + 99 others); Thu, 10 Sep 2020 18:57:00 -0400 Received: from linux.microsoft.com ([13.77.154.182]:43230 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725280AbgIJW47 (ORCPT ); Thu, 10 Sep 2020 18:56:59 -0400 Received: from [192.168.0.121] (unknown [209.134.121.133]) by linux.microsoft.com (Postfix) with ESMTPSA id 31FC8210673C; Thu, 10 Sep 2020 15:56:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 31FC8210673C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1599778618; bh=DlYJOMEzeEFK4Nozie1ZQ0hdzVfQG5TN5yUejRLatBo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=NcxTxOLdc5mwFIUAH/FMMCQ/3Vsd5faPDdgm9rUjeXWvMsP4DcYixjDqdEcG9+80z 9+tXFVEEkTW5KkXzG7vf9ek6K1uD4WyFylEI7gkLPMWNf6RFIis8sYXtg35y3bhycK 9ZDEH1sresjl8itEZKQJXpg77BBDJaRsDkRjCoJE= Subject: Re: [[PATCH]] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged To: Pavel Tatashin , "Kirill A. Shutemov" Cc: Andrew Morton , Oleg Nesterov , Song Liu , Andrea Arcangeli , Allen Pais , LKML , linux-mm References: <1599770859-14826-1-git-send-email-vijayb@linux.microsoft.com> <20200910220145.5j7iogqulmvg5vr6@black.fi.intel.com> From: Vijay Balakrishna Message-ID: Date: Thu, 10 Sep 2020 15:56:57 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/10/2020 3:28 PM, Pavel Tatashin wrote: > Hi Kirill, > > On Thu, Sep 10, 2020 at 6:01 PM Kirill A. Shutemov > wrote: >> >> On Thu, Sep 10, 2020 at 01:47:39PM -0700, 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 leaves the system with small >>> min_free_kbytes which isn't suitable for systems especially with network >>> intensive loads. Typical failure symptoms include HW WATCHDOG reset, >>> soft lockup hang notices, NETDEVICE WATCHDOG timeouts, and OOM process >>> kills. >>> >>> Fixes: f000565adb77 ("thp: set recommended min free kbytes") >>> >>> Signed-off-by: Vijay Balakrishna >>> Cc: stable@vger.kernel.org >> >> NAK. It would override min_free_kbytes set by user. > > Hi Kirill, > > Thank you for looking into this. How is this different from when > khugepaged modifies it? > > echo always >/sys/kernel/mm/transparent_hugepage/enabled > > Which results in: > > start_stop_khugepaged > set_recommended_min_free_kbytes > > Which will also adjust min_free_kbytes according to hugepaged requirement? > > This bug that Vijay described is another hot-plug related issue that > we have found on our system where we perform memory hot add and hot > remove on every reboot. > > Thank you, > Pasha > Thanks Kirill for taking a look and spotting it. IIUC, it is an existing issue, we should fix it while we are at it. Otherwise with my propsed patch introduces a regression for hotplug memory consumers with THP enabled and min_free_kbytes set by user higher than calculated by THP. Vijay