Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2036778ybt; Thu, 2 Jul 2020 22:11:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv8zXJZCBLyhfV2F8QzngEvjCvJ0pgbGQDTbiqIou+8dDCm4UeqBf7P2llGC9OBkRoNPS9 X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr38694897edb.308.1593753101449; Thu, 02 Jul 2020 22:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593753101; cv=none; d=google.com; s=arc-20160816; b=biWcLZ3k+KHJQORTAlMpNI8M9REpLcbhocEkstBeSFFBnoigTdqTgRJDzew4stuj+n PDp5zlLxIkZGmeJV8LBOzhISUcv5/nC4sF7lExAfSk/rVrmtPkraLxk7vN2hRfPrWer7 AGs9249ct5cZunT/SjyoupcRL34XCrTOJjv8R4IMBhz7SAEOfWYDHfu41wzOmQHpgkPf TekrwS7LL3kPNzgcDH8EVcfsFweTE5Syb80e3RX3wAOy8qp/yICy4/SkxEqu4Ogi43qa c9mOY8nMWjw1aaTr8DfnhIIAD9D7Hrl79wMqwAT3cNxdxGHobrvv11OHIFsbXk+pZ7aG d+mg== 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=BKUz/dK0lKevQgSXk2l7gTxaI/ciB3nvTZWdJEboRioWvtvIfVR9edHIaai/Ke6IzN Z0ecrhz3jPqFUiQaTsfb2ymEBCVl1cbMZBzXTgTUmOSnWO0TaueiIKL+AHklvHCnFxNJ 9pz3W06Rc0pyaKD0UXDF95t/Gvd4IhMYMLOcgihZLEdz788E8GyMoaLve0W94iBdSAyV gtNIMkExsS0Mv8Cp+0DcnXITS4StCcNcID1/RVsdbV6J8+CRM1aES6eR1zljy2B/sKDd tMG3/Yc+HNw+5cu/bf1pUiXMIXSPlVT6jEyPdygYLyo/kr7XYqt9YifZ4Af1YsLVLABU Verw== 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 r23si6796809edy.317.2020.07.02.22.11.18; Thu, 02 Jul 2020 22:11:41 -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 S1726157AbgGCFIi (ORCPT + 99 others); Fri, 3 Jul 2020 01:08:38 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:45210 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725786AbgGCFIi (ORCPT ); Fri, 3 Jul 2020 01:08:38 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0U1Y4LGX_1593752912; Received: from alexshi-test.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U1Y4LGX_1593752912) by smtp.aliyun-inc.com(127.0.0.1); Fri, 03 Jul 2020 13:08:34 +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 Subject: [PATCH v14 02/20] mm/page_idle: no unlikely double check for idle page counting Date: Fri, 3 Jul 2020 13:07:35 +0800 Message-Id: <1593752873-4493-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1593752873-4493-1-git-send-email-alex.shi@linux.alibaba.com> References: <1593752873-4493-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