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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 401F5C10F27 for ; Mon, 9 Mar 2020 11:58:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0AE002051A for ; Mon, 9 Mar 2020 11:58:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AE002051A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8724C6B0003; Mon, 9 Mar 2020 07:58:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8232D6B0006; Mon, 9 Mar 2020 07:58:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 738906B0007; Mon, 9 Mar 2020 07:58:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 5879E6B0003 for ; Mon, 9 Mar 2020 07:58:21 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 13764181AEF00 for ; Mon, 9 Mar 2020 11:58:21 +0000 (UTC) X-FDA: 76575676002.26.can25_eae437d33f17 X-HE-Tag: can25_eae437d33f17 X-Filterd-Recvd-Size: 4341 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Mar 2020 11:58:20 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id v11so10689022wrm.9 for ; Mon, 09 Mar 2020 04:58:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V2Ssma6CGptYN1B4ayzZk89MffFfSZ5Lvl/x2QnN3OI=; b=Jzsg1i3vCiLYrAk+Ql9jXjCQcbIarWAsIG4KiwSb1ohwyqfWrfuaQFERWjt7NtAS3P G4tFlNJ8VXyISWuabmU53+Zo7Rg/8Ovl+SkC7k4FuLmlBYoTfSYzjJUNjx2HnZL0dSLr 868KEK+Vtct72/8C5/A0jpT57gF20qYIT9dweelGjWgGR1579nPiP754w9ZGgvRQ3hw0 hLoocWzHDrUyc2YmSCrV0rOLt2Gdty667eiwjPZ9vHVdKDAtu5y3bSPGkZpvzhPf+r48 DvMC87jy2Zg/P3NNK/G8ywqaYkuBsAjcQ7qSKiIfDyVwx9KnyWdVr8DNiBOQ+axppj0f iO3A== X-Gm-Message-State: ANhLgQ09yzayCmDN51XUs519lfl0sXhE0QmJxPn5oL64Ny4rp77GvslC 6C9CaaQvGvurFl8yQFxuAfg= X-Google-Smtp-Source: ADFU+vsNVjsCmPNEvh3yD8H3Vxk5520qSyatBjlAbFdu4IR1M/u++zj5CIzrig4ZY5v2DToolkbAmA== X-Received: by 2002:adf:f9cd:: with SMTP id w13mr20423228wrr.406.1583755099729; Mon, 09 Mar 2020 04:58:19 -0700 (PDT) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id h3sm64424256wrb.23.2020.03.09.04.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 04:58:18 -0700 (PDT) Date: Mon, 9 Mar 2020 12:58:18 +0100 From: Michal Hocko To: Shaju Abraham Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shaju Abraham Subject: Re: [PATCH] mm/vmpressure.c: Include GFP_KERNEL flag to vmpressure Message-ID: <20200309115818.GK8447@dhcp22.suse.cz> References: <20200309113141.167289-1-shaju.abraham@nutanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200309113141.167289-1-shaju.abraham@nutanix.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 Mon 09-03-20 11:31:41, Shaju Abraham wrote: > The VM pressure notification flags have excluded GFP_KERNEL with the > reasoning that user land will not be able to take any action in case of > kernel memory being low. This is not true always. Consider the case of > a user land program managing all the huge memory pages. By including > GFP_KERNEL flag whenever the kernel memory is low, pressure notification > can be send, and the manager process can split huge pages to satisfy kernel > memory requirement. Are you sure about this reasoning? GFP_KERNEL = __GFP_FS | __GFP_IO | __GFP_RECLAIM Two of the flags mentioned there are already listed so we are talking about __GFP_RECLAIM here. Including it here would be a more appropriate change than GFP_KERNEL btw. But still I do not really understand what is the actual problem and how is this patch meant to fix it. vmpressure is triggered only from the reclaim path which inherently requires to have __GFP_RECLAIM present so I fail to see how this can make any change at all. How have you tested it? > This is a common scanario in cloud. Most of the host memory is reserved > as hugepages and can be broken down to small pages on demand. This is > done to minimise fragmentation so that Virtual Machine power on will be > successful always. > > Signed-off-by: Shaju Abraham > --- > mm/vmpressure.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/vmpressure.c b/mm/vmpressure.c > index 4bac22fe1aa2..7ccfb3dd8173 100644 > --- a/mm/vmpressure.c > +++ b/mm/vmpressure.c > @@ -253,7 +253,8 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree, > * Indirect reclaim (kswapd) sets sc->gfp_mask to GFP_KERNEL, so > * we account it too. > */ > - if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | __GFP_FS))) > + if (!(gfp & (__GFP_HIGHMEM | __GFP_MOVABLE | __GFP_IO | > + __GFP_FS | GFP_KERNEL))) > return; > > /* > -- > 2.20.1 > -- Michal Hocko SUSE Labs