Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp739156ybm; Tue, 21 May 2019 02:44:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcCmgopMdfWE/e3RRIdR7gotLnyYzS95yogCvAG7LPVrNuFZ2/k3ZX/goiBDsQNiKwPq8G X-Received: by 2002:a17:902:2bc9:: with SMTP id l67mr45848666plb.171.1558431841356; Tue, 21 May 2019 02:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558431841; cv=none; d=google.com; s=arc-20160816; b=kjmrpCpGbKOmh64XTwrHkRqZpzVnwhFGmZzo2srmCKgeBd6j0N7WYdHPT3xjSUe+nn lwid3eX/yamenrTl+qpCO1xaxbFuf8q07lZC5Nbyupl3c3wb7k2IPaXIHBsf/0g81D8Z Igmp6HqGV/yKnWb0r7ofjXc1IqnZxJRwXXYZ10sUzDs4Tbz5z2BwF6a9+w88Hg9qTBYt +XUWl4uAnwWO9uOtlWPpL1OuJk1MOEgSlVXXQuPK7XuExQC7acL6kDlx2mEObzFXjHES kmSSMigNxRYIrJhhfwQyjpt+JE5njaNPXP5NB8tVPIQ83ef4+tFVeBjAu3nvGqw7eGUQ Wcsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=F9jLr7E6ybNI1fkIgVeHaMd4FGlTJ4UQFZV93ZenQVg=; b=cuwl0a41JiQrHmF+wWSo6gDNcUT/qfH4WAGG1ka1cfdeoVVMDE4EgPNe4nWbrPpYTW 9s6eugZ5CoVWvwLhVhw6gf7v27AHEKzyi3TrHwbeGD6ybv9FQkK6Tn5Tlj2Inf/9HRVA +822s7TxTl9a5CH24ozxxpgO1zXEuYHaM/ypmT4d6Q1nGS6h/+phD84jDg+EKnakVJD8 wYTzQizaYWBFMBsSDVAF1KulIyNiVPKtxfd4hHzptExxdICSXHvDL1qJMPoLp39JqAAz +pdnTaz3V0WfPnBwpjdEPDoaXk07NwYDtrGDtePK0AX06Qxjf5xQWvyo6X+pZPzXuW5s Bi9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i36si19771742pgl.491.2019.05.21.02.43.46; Tue, 21 May 2019 02:44:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726995AbfEUJk7 (ORCPT + 99 others); Tue, 21 May 2019 05:40:59 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:51684 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbfEUJk7 (ORCPT ); Tue, 21 May 2019 05:40:59 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07486;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0TSIe59t_1558431642; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TSIe59t_1558431642) by smtp.aliyun-inc.com(127.0.0.1); Tue, 21 May 2019 17:40:55 +0800 From: Yang Shi To: ying.huang@intel.com, hannes@cmpxchg.org, mhocko@suse.com, mgorman@techsingularity.net, kirill.shutemov@linux.intel.com, josef@toxicpanda.com, hughd@google.com, shakeelb@google.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 1/2] mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned Date: Tue, 21 May 2019 17:40:41 +0800 Message-Id: <1558431642-52120-1-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 9092c71bb724 ("mm: use sc->priority for slab shrink targets") has broken up the relationship between sc->nr_scanned and slab pressure. The sc->nr_scanned can't double slab pressure anymore. So, it sounds no sense to still keep sc->nr_scanned inc'ed. Actually, it would prevent from adding pressure on slab shrink since excessive sc->nr_scanned would prevent from scan->priority raise. The bonnie test doesn't show this would change the behavior of slab shrinkers. w/ w/o /sec %CP /sec %CP Sequential delete: 3960.6 94.6 3997.6 96.2 Random delete: 2518 63.8 2561.6 64.6 The slight increase of "/sec" without the patch would be caused by the slight increase of CPU usage. Cc: Josef Bacik Cc: Michal Hocko Cc: Johannes Weiner Signed-off-by: Yang Shi --- mm/vmscan.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7acd0af..b65bc50 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1137,11 +1137,6 @@ static unsigned long shrink_page_list(struct list_head *page_list, if (!sc->may_unmap && page_mapped(page)) goto keep_locked; - /* Double the slab pressure for mapped and swapcache pages */ - if ((page_mapped(page) || PageSwapCache(page)) && - !(PageAnon(page) && !PageSwapBacked(page))) - sc->nr_scanned++; - may_enter_fs = (sc->gfp_mask & __GFP_FS) || (PageSwapCache(page) && (sc->gfp_mask & __GFP_IO)); -- 1.8.3.1