Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3823597ybl; Tue, 20 Aug 2019 02:51:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQsd4gzIyBNV2Ywdt4afEuhonXck+v4RspZwFOraIyebiDbL6z5DwS9Si1m6id/wCa5K1N X-Received: by 2002:a05:6a00:8e:: with SMTP id c14mr28320447pfj.241.1566294669564; Tue, 20 Aug 2019 02:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566294669; cv=none; d=google.com; s=arc-20160816; b=cgwdyxMVpG3l8G2/+OAf/SIKKCVl67GJKJ0yzm+3gnNRW20RomLfSdnls4mQjzCOMa dwP8rCOb7tlHeKX7vazu8j/na4Hnx+ibG7pKHduC3Shd143x2m829z38VLPtuVqA63IX QxXMwvqUDpFQrlW3dhWpxR4hC4Gce3dMevANPh4sxqzaFtPHxATgMqii+fqORGuW+mCv fziH4V51W+5U010z+i+on3UyMTAopn4X2BiVE2qhktWMO459O6FHpiVr2l6ZcsvWLKUj uQ4ndw/aJcLMcQYC66XVUIC4hTQIHbQnKPfRAP0FQoFZ8yRZuP0EPeuZ9nm5+FqyUwYh YFXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=kVhwmKmi8erwAXX+IJ7IhMwYbWGebX2KIhlZ7LuHa6w=; b=FKJaC/DPMnW5rvDRxbzddqtrhuyz//1Vu1hEBkAAeN+LoYzu7jR83z+hCITN1hOAnR hXsynMO/snBKJZz0IQDkA0Pnr1Cl/i/ylN7ZXEcPz3CN0yyMB1zdUbP3TGRxHkOLA6fk 6318crE7lIIkie7Ld+cTf/yM4M6vYHWUpH+X6ZEwqGhT3sAsY3zP522Kz9d/OVwFxGH1 ITaDwTvKfv0ZiM/VhT/ebPXCxg629/s544yEv0qZIkZyPMag0qjWif4dSroONqZpWoRE XcmXdLgBQBa3tPTFcnq1cB9WKOQm0odJod35Yotwdhlym6Gq9WC2oiddKi8eSV0VsYbQ 7fug== 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 b5si11817121pgi.324.2019.08.20.02.50.54; Tue, 20 Aug 2019 02:51:09 -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 S1729779AbfHTJtu (ORCPT + 99 others); Tue, 20 Aug 2019 05:49:50 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:55410 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729761AbfHTJts (ORCPT ); Tue, 20 Aug 2019 05:49:48 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0TZznPmz_1566294577; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TZznPmz_1566294577) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Aug 2019 17:49:38 +0800 From: Alex Shi To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mel Gorman , Tejun Heo Cc: Alex Shi , Michal Hocko , Kirill Tkhai , Johannes Weiner , Daniel Jordan , Yafang Shao , Yang Shi Subject: [PATCH 13/14] lru/vmscan: using per lruvec lru_lock in get_scan_count Date: Tue, 20 Aug 2019 17:48:36 +0800 Message-Id: <1566294517-86418-14-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1566294517-86418-1-git-send-email-alex.shi@linux.alibaba.com> References: <1566294517-86418-1-git-send-email-alex.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lruvec is passed as parameter, so no lruvec->pgdat syncing needed. Signed-off-by: Alex Shi Cc: Andrew Morton Cc: Michal Hocko Cc: Kirill Tkhai Cc: Johannes Weiner Cc: Daniel Jordan Cc: Yafang Shao Cc: Yang Shi Cc: Mel Gorman Cc: cgroups@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/vmscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 123447b9beda..ea5c2f3f2567 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2372,7 +2372,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg, file = lruvec_lru_size(lruvec, LRU_ACTIVE_FILE, MAX_NR_ZONES) + lruvec_lru_size(lruvec, LRU_INACTIVE_FILE, MAX_NR_ZONES); - spin_lock_irq(&pgdat->lruvec.lru_lock); + spin_lock_irq(&lruvec->lru_lock); if (unlikely(reclaim_stat->recent_scanned[0] > anon / 4)) { reclaim_stat->recent_scanned[0] /= 2; reclaim_stat->recent_rotated[0] /= 2; @@ -2393,7 +2393,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg, fp = file_prio * (reclaim_stat->recent_scanned[1] + 1); fp /= reclaim_stat->recent_rotated[1] + 1; - spin_unlock_irq(&pgdat->lruvec.lru_lock); + spin_unlock_irq(&lruvec->lru_lock); fraction[0] = ap; fraction[1] = fp; -- 1.8.3.1