Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp332756ybm; Thu, 28 May 2020 04:05:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfxWL8EEErOd1UiQr1790WYqvbveq2fhLhXjoKQULAQ/8+tDYWkd6/Ey8wKanLuMnxlnuz X-Received: by 2002:a05:6402:155:: with SMTP id s21mr2458574edu.144.1590663906557; Thu, 28 May 2020 04:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590663906; cv=none; d=google.com; s=arc-20160816; b=Lx0AI3b8jYKXHLqK+GoCyZTGAoj52RcZIQ0HpLZ+sHdN6+lBMaVNP/8wPLjtptcZxp yMdmaknVlgSKHX4sJjBhrh3dhp81vtMzMiz/RJeV35ALF3VcTwwCAmCUx/bHx5nZQUS+ AOEZRXcip7PwDlwe+hEFJO+ZdWnexEKamRBCjb++AkyB650wnco+0VsmES/eQpeLewoU YzEYU48ihIyHWrMs1gC3P7g8Vp/BZuP3+B1yyMWLM6efyeiYFVf6oxZA9xvCqUvkuJkc 5IKTjKETbSrsRGy3WGqfKK3cr2gLhs/WwvZHnjsQ4fqwgrITg3yiIzR+M5Zg8xKzsQrY /LJA== 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=zDgI4gxZRG/iytjVJnHTD4a1fELCpvuDt72aCV7c9UY=; b=SZqYhWzkr8kj6uVXzCTtJcvp3RqZAt58npujsp1yP2YGdGKrnAKXC9qn14DKLdvxuA NKQz48giZJwC3IPXudKB4MkU41hEZM9rEhHz8tBEZ2GKPpeP4XmH4FFlEljfsu2NJWOB vte9HvYkqrxlomVrpx+w/cYkTglMG6mlGMZtarm/2zLyKFtiiJdOBVDdEviVlNMqKQK6 LAxGgVIf0KwigqBaty6cj/+pDNHOkg6QDwMzAXH6/gw1dEtE0F2mxJu6iYLAmDgettzS hcDwEL3l9Wx3YCv7I6xhHluqybgxkXjPEfxg2gdglWuuYg3WJiliaTTX4l9/nlbhAtDb KEKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id qq11si3485204ejb.667.2020.05.28.04.04.41; Thu, 28 May 2020 04:05:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2388081AbgE1LB3 (ORCPT + 99 others); Thu, 28 May 2020 07:01:29 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:52862 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388064AbgE1LB3 (ORCPT ); Thu, 28 May 2020 07:01:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R461e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07488;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0TztdQ9T_1590663684; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TztdQ9T_1590663684) by smtp.aliyun-inc.com(127.0.0.1); Thu, 28 May 2020 19:01:25 +0800 From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com Cc: Alex Shi Subject: [PATCH v11 02/16] mm/page_idle: no unlikely double check for idle page counting Date: Thu, 28 May 2020 19:00:44 +0800 Message-Id: <1590663658-184131-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1590663658-184131-1-git-send-email-alex.shi@linux.alibaba.com> References: <1590663658-184131-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 As func comments mentioned, few isolated page missing be tolerated. So why not do further to drop the unlikely double check. That won't cause more idle pages, but reduce a lock contention. This is also a preparation for later new page isolation feature. Signed-off-by: Alex Shi Cc: Andrew Morton Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Hugh Dickins Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/page_idle.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mm/page_idle.c b/mm/page_idle.c index 295512465065..914df63948b1 100644 --- a/mm/page_idle.c +++ b/mm/page_idle.c @@ -31,7 +31,6 @@ static struct page *page_idle_get_page(unsigned long pfn) { struct page *page; - pg_data_t *pgdat; if (!pfn_valid(pfn)) return NULL; @@ -41,13 +40,6 @@ static struct page *page_idle_get_page(unsigned long pfn) !get_page_unless_zero(page)) return NULL; - pgdat = page_pgdat(page); - spin_lock_irq(&pgdat->lru_lock); - if (unlikely(!PageLRU(page))) { - put_page(page); - page = NULL; - } - spin_unlock_irq(&pgdat->lru_lock); return page; } -- 1.8.3.1