Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp800469pxb; Tue, 12 Apr 2022 13:49:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEL1FE2w9mtHvXJbdwY1LmjgqETSw/UZkRNpQtMjoOk0/6iUZfL8jlZ408x07uhuWH/IbO X-Received: by 2002:a63:b40a:0:b0:35e:d274:5f54 with SMTP id s10-20020a63b40a000000b0035ed2745f54mr31184402pgf.200.1649796598548; Tue, 12 Apr 2022 13:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649796598; cv=none; d=google.com; s=arc-20160816; b=kOOACtnDeno4AZHSEgiKfhZ32tyQjJufhHO9myKnWkmdQQ1daQH78jD5Zmv71R0ed3 m1fBGIqSln6fwUNK/Smq/zRYiYsJjRSfBv1mu+lpiXZlFWuzOZvBBL/rwIXfZY2Lma3q 4/Mh0YgxN/pFt6Z8ABMLe9+IbCCfamdPtwYVqPyk1EXSl+WsDIMQnBEhgpnFBJu536Yc VhI8fBNaQSJfWLy+bCrkybNrmr7HB6uzPqaWfcytyq2DaLOdAVgXIpWRE0p+2/+VcLUJ 8FO/VWidvgirP4+u7wYI7SBloAYs9vhvWzJ4OHdJrMAF899q5ynr7mS94+mH16bzibk0 H5Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=8y+YQId9Si5sgWq8eksq5ytq3Fr3r/6H9lnHvpt2hXY=; b=zxdd/b0tKWNWmgfrqDzwWbOXNsQgVc6D6v0JFKSl2qLHOsRtATL/tPOl5ISJucDQYW 4meDemO1pe7GaZhFpF09g6XMr0Wy9mAR81YpZVSNUQB9pIzi4gbszOIYlsERW4khxb9K 3g4x1jnI6v34sz7pbuRxVNak78o8dLhLIuLjWZfDJCRh9mCv/KSmtsUdoOPfiYZV94oW SzFPobsf7Xz6JTOp6IFykRoYu2cbNSd/DYCJ/dx+wg4gg+aCy1BRXm93yM4y3dzKbpJg Hh1UKIEt98HvikYjG61QKY9kquiceJnjsizjior21kYu1kx4A4ZQ4plSqxQnCet6Aack JpMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fnwxDjtK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 34-20020a630e62000000b003816043eedbsi3782628pgo.208.2022.04.12.13.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:49:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fnwxDjtK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78A9BC31F1; Tue, 12 Apr 2022 13:18:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244990AbiDLBiz (ORCPT + 99 others); Mon, 11 Apr 2022 21:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbiDLBix (ORCPT ); Mon, 11 Apr 2022 21:38:53 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA7121244 for ; Mon, 11 Apr 2022 18:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649727397; x=1681263397; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=pQGXf75WjtOKpwGRrA2vxPYLcX3Vjo5dFDxMSXaxBfk=; b=fnwxDjtKWDNq2RjzO9vmcUp5tQ9sXU1yh9kKHgG0JtkjepMoy+W+4KgW FfdQuRSYkmXy831PAyDCgLvmKza2geMHW5dnJ0bYnPh8wtN9OI6zbO3Ng SPF9VoSQjvw23WvOepxPUqP6fRY9GIICqWlAUuaLF4jgQSabKt2h0tN7E wdKb2p9ykioHvBRX5DtXAa8rTfq6Q+Ajn/h7uainCnSXQDBeSr4VYELCJ ZbxOlXtrqogb7ajtJermsDoTQHfLacd1zT5NmksUpm9BSS1tQm7NbTM6t 1wY8/d9IZZUZEAohTbakyTxiYL7ohwY1jSz8T+N06/rcMNpagygGUdbrP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="261100757" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="261100757" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 18:36:37 -0700 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="572503695" Received: from joliu-mobl2.ccr.corp.intel.com ([10.254.214.243]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 18:36:34 -0700 Message-ID: Subject: Re: [PATCH v2 7/9] mm/vmscan: take min_slab_pages into account when try to call shrink_node From: "ying.huang@intel.com" To: Miaohe Lin , akpm@linux-foundation.org, Christoph Hellwig Cc: songmuchun@bytedance.com, hch@infradead.org, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner Date: Tue, 12 Apr 2022 09:36:31 +0800 In-Reply-To: <20220409093500.10329-8-linmiaohe@huawei.com> References: <20220409093500.10329-1-linmiaohe@huawei.com> <20220409093500.10329-8-linmiaohe@huawei.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2022-04-09 at 17:34 +0800, Miaohe Lin wrote: > Since commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from > shrink_zone()"), slab reclaim and lru page reclaim are done together > in the shrink_node. So we should take min_slab_pages into account > when try to call shrink_node. > Looks reasonable to me, copying Johannes. Hi, Christoph, Should we check min_unmapped_pages and min_slab_pages in shrink_node() to avoid reclaim LRU when necessary and vice versa? This may be done via another 2 scan_control flags. Best Regards, Huang, Ying > Signed-off-by: Miaohe Lin > --- >  mm/vmscan.c | 3 ++- >  1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 53f1d0755b34..ba83d8f3e53e 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -4714,7 +4714,8 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in >   noreclaim_flag = memalloc_noreclaim_save(); >   set_task_reclaim_state(p, &sc.reclaim_state); >   > > > > - if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages) { > + if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages || > + node_page_state_pages(pgdat, NR_SLAB_RECLAIMABLE_B) > pgdat->min_slab_pages) { >   /* >   * Free memory by calling shrink node with increasing >   * priorities until we have enough memory freed.