Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3825251ybl; Tue, 20 Aug 2019 02:53:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxARoVwtgAv6b0BWiWqsXByk1T48wWcFWMn/fsGeCwm8qy8Q3Al99wLh7wFhgjHe9CA4RBA X-Received: by 2002:a63:ee0c:: with SMTP id e12mr24522949pgi.184.1566294790199; Tue, 20 Aug 2019 02:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566294790; cv=none; d=google.com; s=arc-20160816; b=sePXQ7dHsJ465tsdxyKMg5pAASjBAbjQicJW6x5PBZcKdUSGpEIhgdYtIey78uxuXK 3jflBPhGlxv6S0veRZRkELBlYGOoNAsRksWxuBGZqs5bfEy0AuCZ364cXsGgirgS+Q5d VBvRtkYZ7jQgiB8Cu8b9l0z2heCzLnyo2QUG9xfIvQ75tQrs9FhUeFXK0V9y/QfgMZ4b hcpUqjoX4g8L43G1QJPCe7kAduunufoAqMd5kNUO6mHHiL6Uc4qMhbOMyIz3mk25yLOH DBI9xH8jYP49u863aF1x/2aNBumgamBczacXqtOZha1mYy8TtBJwzRJZCl0UzMytlBnb L5VA== 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=Z8FBGPZ2XlgoVO2VgZoMl6s++nP5tRtFC8wiT/7S9zk=; b=ELfJbnqO0nHpqwbbYt15YmtUH5eVsP4Iezb7Rx3hMIrtpj+WZolpZhA0Dm08Re4mjo UWeGicpptWPkb49MTSz9SOHiaYp2JdLCMElSkrgR+ijs/acmJPbclbFQEluPX93Iqv0U 3CY37Hq2xVyvzIA/W2tfx8OZbLjuULFM7Kcb/nwRUS0KoJ24hA7GDMlF6ySVgr3MfLDv BKwDjskfqAP4cwJrIB7153qub0xTA2rBMbEhgJS0Cef84F9dwNMlODZAm1sVQz5jJy7u 0yYkwv9FjpxllF0bzWxhRrUL04fl5W9h1Mbjf1GHkpvaV72+KzY03/lulAo4ffcNd2b4 Vygg== 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 f131si11723851pgc.265.2019.08.20.02.52.54; Tue, 20 Aug 2019 02:53:10 -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 S1729838AbfHTJu0 (ORCPT + 99 others); Tue, 20 Aug 2019 05:50:26 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:33857 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729333AbfHTJuY (ORCPT ); Tue, 20 Aug 2019 05:50:24 -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=e01e07417;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0Ta-BP32_1566294575; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0Ta-BP32_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 08/14] lru/swap: uer lruvec lock in activate_page Date: Tue, 20 Aug 2019 17:48:31 +0800 Message-Id: <1566294517-86418-9-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 to replace pgdat lru_lock. 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 2a8fe6df08fc..d2dad08fcfd0 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -325,11 +325,14 @@ static inline void activate_page_drain(int cpu) void activate_page(struct page *page) { pg_data_t *pgdat = page_pgdat(page); + struct lruvec *lruvec; page = compound_head(page); - spin_lock_irq(&pgdat->lruvec.lru_lock); + lruvec = mem_cgroup_page_lruvec(page, pgdat); + spin_lock_irq(&lruvec->lru_lock); + sync_lruvec_pgdat(lruvec, pgdat); __activate_page(page, mem_cgroup_page_lruvec(page, pgdat), NULL); - spin_unlock_irq(&pgdat->lruvec.lru_lock); + spin_unlock_irq(&lruvec->lru_lock); } #endif -- 1.8.3.1