Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3824517ybl; Tue, 20 Aug 2019 02:52:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCWWM9vfs4A/sf2eLkwVfCFD94hUdX2oHroQ9YIwpalJJooJzYKS3+aosG4YbSIDfydDGp X-Received: by 2002:a65:68cd:: with SMTP id k13mr23843243pgt.411.1566294735058; Tue, 20 Aug 2019 02:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566294735; cv=none; d=google.com; s=arc-20160816; b=P1GQNqNfmy655oOfvJxJqg2V86HGmg1ZC3lATUTPpDTSNE3g3g8PHikzWBh3DH0FmB +AQ9zAGx+Kl02acaP8G7ZzZEVaU2801tMrwE7ExbZcXIvZvgjQAtRBHMNHSpGV0krTmd tSLvj/bYfbNgze1V3c+inNo1z3IgFOU8W991XeHgoyyzw5j2TCLVKfWf+uXsrhZ4auTu 8WPwCH2P6H3h8vkv3AvX/4xTs4EIKZcdLwi3EMsA3r9ah+20+V0/mRTbNASaPzP+snf+ kf4/2C9EUTQlMu7O8zrQR9qfLIHUTq23XkMr/ZrDfUIm1UDaWE7LXRGo6G4qhxh+qix0 3+Dw== 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=ldCiJxW6kt88iQ2xElNsyrsHfX6PkjxlcTXDX31u5NU=; b=ZpkC55t9WrU6PUs3SoYPSrurxjIo8HfuIHDU8bXTGSPQbjPsVLy8bndvYDqikSWVrq 1PvLHXxex8GOxA5TcOnknbwaUTKvmtRZNqcVcIozzSbuxLCtGvT0aduwM9iY6FL1/uch iWR9L8DZFyxExBynwMX9Rvf6oo7tYCNGMtQeHJ1aE6IsPYvh4wxd309DrqC7Mjxvdf0Z IPdoZUBjDKXpCG7Kda0QqOb0iOSUP0H5j00jwj6xaMNIxll/0Bi904CiYlRBXTRwXJ9l EgbVi69oCK6Kb/hkDSromic8t8vBceahFDA1l5OqyGvbGrbe/7DLukP+OSHUPpZtzzS/ m8XQ== 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 f22si4482893plj.247.2019.08.20.02.52.00; Tue, 20 Aug 2019 02:52:15 -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 S1729863AbfHTJud (ORCPT + 99 others); Tue, 20 Aug 2019 05:50:33 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:56778 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729849AbfHTJub (ORCPT ); Tue, 20 Aug 2019 05:50:31 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;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=16;SR=0;TI=SMTPD_---0TZzk.Bv_1566294575; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TZzk.Bv_1566294575) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Aug 2019 17:49:35 +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 , Vlastimil Babka , Jason Gunthorpe , Matthew Wilcox , Mauro Carvalho Chehab , Peng Fan , Nikolay Borisov , Ira Weiny , Andrey Ryabinin Subject: [PATCH 07/14] lru/swap: using per lruvec lock in page_cache_release Date: Tue, 20 Aug 2019 17:48:30 +0800 Message-Id: <1566294517-86418-8-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 Also cares the lruvec->pgdat syncing. Signed-off-by: Alex Shi Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jason Gunthorpe Cc: Matthew Wilcox Cc: Mauro Carvalho Chehab Cc: Peng Fan Cc: Nikolay Borisov Cc: Ira Weiny Cc: Andrey Ryabinin Cc: cgroups@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/swap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 63f4782af57a..2a8fe6df08fc 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -63,12 +63,13 @@ static void __page_cache_release(struct page *page) struct lruvec *lruvec; unsigned long flags; - spin_lock_irqsave(&pgdat->lruvec.lru_lock, flags); lruvec = mem_cgroup_page_lruvec(page, pgdat); + spin_lock_irqsave(&lruvec->lru_lock, flags); + sync_lruvec_pgdat(lruvec, pgdat); VM_BUG_ON_PAGE(!PageLRU(page), page); __ClearPageLRU(page); del_page_from_lru_list(page, lruvec, page_off_lru(page)); - spin_unlock_irqrestore(&pgdat->lruvec.lru_lock, flags); + spin_unlock_irqrestore(&lruvec->lru_lock, flags); } __ClearPageWaiters(page); mem_cgroup_uncharge(page); -- 1.8.3.1