Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2927275ybh; Sat, 25 Jul 2020 06:01:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh9Uv78s2fM8FTRaOsl1l1eCUw9z0Jbu1XW0I6GgbFVRNrBoEOsA8KJeWYaCupnKgU2jgF X-Received: by 2002:a17:906:4a87:: with SMTP id x7mr14000587eju.44.1595682062425; Sat, 25 Jul 2020 06:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595682062; cv=none; d=google.com; s=arc-20160816; b=eARxyeRpk65LyYCeTBpZATauZCBkjpjZe2BMhXMCFkVHs3flR3rLuvc/xBl612+M5z zXAXc5DxU3fZsHaWw+UccyxK0nIttLfWYCuBRoXlEB0kWOwWP0qoVDhast6uVc99CUnN d850s0W7WFe/aUzkMbJa0W9XRhevXRRSEcOz7OYb8bjidc4MLH+OfKx0/DJYkdrs+Ugs MEkwovoPCrGTJvZAT8CSOZBVlfowYN6z6R+c/GwDkHGZB0z3SIM09S9zQ26YBoAxDS9G tO3m8f6x284aZ5B6f1EPXd6dYqY2Uv+XcznCXVh2Vn/LSMpMzZ/4SBTSVIhIT5gA8RLO 6zbg== 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=uU6QHDtdljf1V2CXvBmbYMvJAnc3DrTkgsmzNTfT4S4gUowy6j6EXhQSHNtrunI0/D yTx72uY6TTGISeczXjXqHpcMxCttOaXGZTH7uugWt3HH8H23HlHaQJJSjXvSZwyOYVCi RON01J3L5mAAk2pB6XE0dxpUiUxsriHlS46K5A7vWDwYXcWhGR5EjvOnKL5SzSOeHuyj RmU8ab2Gg0LFlMSMTxHJ8uxEc1zEsySvVU7aXMTfABwACQLzH5LFrJtmGqa3qanePk7z 8azHt1dnNV0ssnC6JK/r3o7ROsHOZSmvyfR4a8h/kJZZ5PXh/fl9Jyh5/J8LvbkfnnqJ FJVw== 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 bc2si276466edb.424.2020.07.25.06.00.39; Sat, 25 Jul 2020 06:01:02 -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 S1727122AbgGYNAa (ORCPT + 99 others); Sat, 25 Jul 2020 09:00:30 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:57585 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbgGYNA1 (ORCPT ); Sat, 25 Jul 2020 09:00:27 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01358;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0U3l6fmD_1595682015; Received: from aliy8.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U3l6fmD_1595682015) by smtp.aliyun-inc.com(127.0.0.1); Sat, 25 Jul 2020 21:00:21 +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, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com Subject: [PATCH v17 02/21] mm/page_idle: no unlikely double check for idle page counting Date: Sat, 25 Jul 2020 20:59:39 +0800 Message-Id: <1595681998-19193-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> References: <1595681998-19193-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