Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp852218pxb; Wed, 27 Oct 2021 13:45:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRsDwwKlMujYLiCAxg/xlbR/NdLhBFBGUHJ/OSqrBu4iBq4fHoQwdJgx/XXVDy5WsZuTa1 X-Received: by 2002:a17:906:eb48:: with SMTP id mc8mr9465815ejb.245.1635367514812; Wed, 27 Oct 2021 13:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635367514; cv=none; d=google.com; s=arc-20160816; b=ygiox9Ct/+QfO6FIy1VpPMf9jVhUuhAuhE6kCYDL0uo/X1amuQ4PBXXuesYzHA3sjY m/hvpMFbRcWpx8TbIQHJF0UgZKAj0xsSEoJuniBJahBWaq6BGrIk5FpuXxAn4IBpb2zC nfiGAHX0NyoF5fyYRjbVRlS8lsJ2JVTUDbpwRz6JiaELaXtMaGMyqeLyNjwLWT70Mc/g IFpAdK7J8mLI+a7lUP8VZQePVRkHZmEljqWxOCvRv9LAE0VazSbVi8Y4fa2KHwff+Rkk J/aP1N0lDuyq44iAB7gIvEjdxv75JSh+ZH1cMzzDNspqeazwYkE4wFvxtkp/Yqeq7Gs3 s8lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9q/ALGYqDwdhLtPZsbnRWyuardQKJ35TGG4OW1DjCZA=; b=pNS7wqUTNYIta8aC98rT+bRDQ+6WNEwOzXJl9Hn6kuFYuTYdT3KbrylbR0l43thR+P gpqyICyOeySwhSBEOT+GOFBDiMHm8uu5rAs4ZhuhCceUkcIWSrT+3VYm0aYVzt+nPosg Z0U4ozAtL9Y0G4/W/bNFnOfY64C29VJSgzjQtFeQPSxKuvN2bweRFbK2Yf3TJvvCnucI bAGlsT5G71N+768fvl4JtdI5MV1tRaNnxJOkxgFi3/3Frj25uG+DYTnJytsAGSBxRoTd +WGfpqac5y7cWx46Dw9JOP1Bz7hjF/jHUK6VHKfjlCfAWBYZzZt/k3N+FdXp4LDfeOIn NmYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iSsc5HR+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qa18si1343545ejc.528.2021.10.27.13.44.49; Wed, 27 Oct 2021 13:45:14 -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=@gmail.com header.s=20210112 header.b=iSsc5HR+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240609AbhJ0HtH (ORCPT + 99 others); Wed, 27 Oct 2021 03:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240554AbhJ0HtG (ORCPT ); Wed, 27 Oct 2021 03:49:06 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E08BC061570 for ; Wed, 27 Oct 2021 00:46:41 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id n2so1671976qta.2 for ; Wed, 27 Oct 2021 00:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9q/ALGYqDwdhLtPZsbnRWyuardQKJ35TGG4OW1DjCZA=; b=iSsc5HR+fsiNxzOXfw6h8SVZvp/HbeWKB5a5myra8kgMEaeuKZoibwAnmJBqzgBi0G 1m1qjpOhXnQDXh3LhYvEbcEjb82ou3ArwduzbYcyvwPSsGF5V9yGkf+b9Nnch+BmDOMO uHllxmrRxPmnrXD49Pkxd/rrskiTt3mMr4j6PllfIyBi5IKzwb95YckztDT/iGfwfvF/ xn7HcTniSBS73kB1dk19exUmQDzL9LFhpM4yyUMvItDdauW4wnrfVUjYBn5SU1F0Kq4U lJI/ObmeGm9PEk+LI4VFQew+oSggms8jYpeGS4YCT24d7BUEtqoHAk0dhNXhFrhJhZKH 0izw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9q/ALGYqDwdhLtPZsbnRWyuardQKJ35TGG4OW1DjCZA=; b=E5S1yHnvhFmND+dfgKZviSIydJyLuGMAE2LucliwKOCWcdXnsfaZVE4o1bUpDWqubd gCehG83ooS91F+qiFYoQI/LBpT5MnoEdpj1Jisk5lXy3E84Vd3eWECeIgZy1/w3eO1Cn 9XjhSilsuKYMPFJ+D+ifloXmxwYWZID+UDXD3088Ed0vIL3RwaskOzwuv83qUDo05Y5w v1a3B6U/HHM6V+yLQxGEjo+yo5P9ohgdWV1kInkecrZ8qqsJNh7Q2iXlskQrpNYJXT5w sHHPWP2JIH+FcdmtO310zMQLQ91z75FuHTbePsse9FvJpGXSIbRThj3PNcZ/xxXYbZOv IfIg== X-Gm-Message-State: AOAM533wn83cc/Ar5I61O2dvQCtMoRji0Wqpqs0EpqLmBJ9IXFs1WTHc VJwsjTNsCCFCwMw8ht1LXwhQVICu/LC0te+rXQw= X-Received: by 2002:a05:622a:11c5:: with SMTP id n5mr29694457qtk.232.1635320800710; Wed, 27 Oct 2021 00:46:40 -0700 (PDT) MIME-Version: 1.0 References: <1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com> In-Reply-To: From: Zhaoyang Huang Date: Wed, 27 Oct 2021 15:46:19 +0800 Message-ID: Subject: Re: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 3:20 PM Michal Hocko wrote: > > On Wed 27-10-21 15:01:50, Huangzhaoyang wrote: > > From: Zhaoyang Huang > > > > For the kswapd only reclaiming, there is no chance to try again on > > this group while direct reclaim has. fix it by judging gfp flag. > > There is no problem description (same as in your last submissions. Have > you looked at the patch submission documentation as recommended > previously?). > > Also this patch doesn't make any sense. Both direct reclaim and kswapd > use a gfp mask which contains __GFP_DIRECT_RECLAIM (see balance_pgdat > for the kswapd part).. ok, but how does the reclaiming try with memcg's min protection on the alloc without __GFP_DIRECT_RECLAIM? > > > Signed-off-by: Zhaoyang Huang > > Nacked-by: Michal Hocko > > > --- > > mm/vmscan.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > index 74296c2..41f5776 100644 > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -2704,7 +2704,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, > > unsigned long protection; > > > > /* memory.low scaling, make sure we retry before OOM */ > > - if (!sc->memcg_low_reclaim && low > min) { > > + if (!sc->memcg_low_reclaim && low > min > > + && sc->gfp_mask & __GFP_DIRECT_RECLAIM) { > > protection = low; > > sc->memcg_low_skipped = 1; > > } else { > > -- > > 1.9.1 > > -- > Michal Hocko > SUSE Labs