Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2124008pxa; Mon, 24 Aug 2020 06:01:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjsQCm/ylGFzqxVQahgez2AdJIGsnMFj+W61phdLBoxEvfkd0SnaNQz+3y5GZFcjBv0KO0 X-Received: by 2002:a17:906:54d3:: with SMTP id c19mr5742480ejp.408.1598274109934; Mon, 24 Aug 2020 06:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598274109; cv=none; d=google.com; s=arc-20160816; b=YM8kHrB9lGYR++1+pb/UzetQ1lTOCaFj++A5G+sXcJYqOdErkOqewPSivvFghFvBeq hxIzNdo2UYZBi32ZyaIIdZUHqnTbSJyaJdxz1s8TVn6ztF7mNEGA+8JR1G2PwroPg8dQ 0h+skwgujJS80MoBgbGawUo4ORccB2hlSLU7dp50JgCzGdmicI4Rv27luy5qpJjIe+os 7BqhOzDSCQ7P69sXtidMGnbUd+lL/DFfThwkpjiC0eeN8zxw0s4m1vzHObz5n7u9QTjs PVFkaMf42veJ2oc8w76FIwx3hwOHwTt7EdJ9p4Va4JKZSYALCgMEFaU8WI3gL1ryTWSy XxKw== 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:to:from; bh=uG637yYa0DGl8/tTujaK9remLANmspcQL6qamGBesZ0=; b=nDlxALQgYddcgzYG69g/49oHQMaw1T1kzB9jkqQl3jeToSXf6SuiAG7jsXb4bkHEAP qafhVlLlve85Hi2ddlspqHdam+PmB/5LcVTyXj/D+7oZINwTVS+1am68+/5nMcOIE87w 3kd192fXh6/iil7rDh3AT6BCmj4TcAP9/tW4eXgNB0xiSJEc5Mb060zMhHwcH5POArqs jFbTYPvpwNx3DLZOsScvaSSR1WexKW7/mObHnqknLxQcsC/R/Kb20LrO95vag4OTUNRE R4sfYXijkgLOS+1n56mjWRGSLMgubhexMdZlPlcstu5mJ0rXwdWtFeMskIj/6N3KBZIj ERBg== 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 qw24si4109920ejb.197.2020.08.24.06.01.26; Mon, 24 Aug 2020 06:01:49 -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 S1728138AbgHXM6N (ORCPT + 99 others); Mon, 24 Aug 2020 08:58:13 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:53429 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbgHXMzW (ORCPT ); Mon, 24 Aug 2020 08:55:22 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R941e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01353;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0U6k9-bl_1598273712; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U6k9-bl_1598273712) by smtp.aliyun-inc.com(127.0.0.1); Mon, 24 Aug 2020 20:55:16 +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, 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, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com Subject: [PATCH v18 09/32] mm/page_idle: no unlikely double check for idle page counting Date: Mon, 24 Aug 2020 20:54:42 +0800 Message-Id: <1598273705-69124-10-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598273705-69124-1-git-send-email-alex.shi@linux.alibaba.com> References: <1598273705-69124-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 057c61df12db..5fdd753e151a 100644 --- a/mm/page_idle.c +++ b/mm/page_idle.c @@ -32,19 +32,11 @@ static struct page *page_idle_get_page(unsigned long pfn) { struct page *page = pfn_to_online_page(pfn); - pg_data_t *pgdat; if (!page || !PageLRU(page) || !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