Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1065846ybg; Wed, 10 Jun 2020 23:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhK/2hzwZO74K24J2BDcdfVqvUyurCSs0HPeSIxownyodVlgn2Mca111Ui3v78aoO2gSoR X-Received: by 2002:a17:906:c53:: with SMTP id t19mr7377187ejf.143.1591856486932; Wed, 10 Jun 2020 23:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591856486; cv=none; d=google.com; s=arc-20160816; b=LFTJInEyVcNOh5v0PbrzmKhS/0O8I5qudI4EuSHZzL/cg35Idu4k73/cj6RlzqYqXA vVXSsq1FBnX+HGpTsw2nW7KuIwgQlbEfV+lyKX5jzW2QqqYGJq8H65OmvMaqzb4q3Bj3 YDa/6rSLm7G7kIbJHCwA2a9FlwsIsapcm2QK06NF3Z96xXE3larx9kA/QkjnT+sMv9qw DDJN7bhnDXS+8QJe64GS7eb9VTlt+eA4Ty9FiWCp8QqALYZmkFlZAE2NQo2SqT6RtpFd IC6X2k+9IAzBEuI/wb5pa9A+2BCYlmukUY/NoIgBDrsTcnxx0mbaFC1gTM66/z5UD1Xw wH2w== 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=Hv2zplFvIIyC8yi9ZKxaS2yW053lx0Kf2C0DFdRLkf+DHCaEC2hYSyQQfLSzPMvJ/O mNUjWQxWOcEY6uzst4q79Nljkf3GM3EkOCcpoHfdXztu089KPMHuQYD/AkyLrXHM0y81 1nL7P9z6CeLcO9AYlDmTJ4h94SRWWJhWo76Rf19JxP30y2PilD/fbaC2/rnvQIWQ5Mg0 OD6P/5Ifn4sKpwFMiKuhCZMOzDDdypnyMs8wqvt/4qUiUSh2r1BgKLmXpcE+yTBaIh0R mXeviTAhD7D2a4M6G3zftRx42HkdWHwCH8DDe+70QhCDD2R26aozEuGMbnv2MOya34ga WNhg== 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 se19si1383933ejb.71.2020.06.10.23.21.04; Wed, 10 Jun 2020 23:21:26 -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 S1726900AbgFKGSM (ORCPT + 99 others); Thu, 11 Jun 2020 02:18:12 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:48176 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbgFKGRL (ORCPT ); Thu, 11 Jun 2020 02:17:11 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07425;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0U.FIUkw_1591856225; Received: from localhost(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U.FIUkw_1591856225) by smtp.aliyun-inc.com(127.0.0.1); Thu, 11 Jun 2020 14:17:05 +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 v12 02/16] mm/page_idle: no unlikely double check for idle page counting Date: Thu, 11 Jun 2020 14:16:35 +0800 Message-Id: <1591856209-166869-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591856209-166869-1-git-send-email-alex.shi@linux.alibaba.com> References: <1591856209-166869-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