Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2931889pxa; Tue, 18 Aug 2020 01:45:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVOJqIEIVLbWTM/kcci4TzyG9VF4gAqksHZOALelVCjeN/2dSJAavVihjiUXXgIjivW1K/ X-Received: by 2002:a17:907:100f:: with SMTP id ox15mr20014486ejb.125.1597740350277; Tue, 18 Aug 2020 01:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597740350; cv=none; d=google.com; s=arc-20160816; b=thYtr9p9EYPCGxlqFMIUkrvjr2WW7MnZ114nfxw9R73ExfZ6L2KtZI7NGfa/KrWOiC tU/JR73RCYkvmFflZR6bFSYT539ZXg0mkkrnTOmhaTRMrA9pBW62Tw6qom60HzxPH2Q6 a2S3PjeIZHDpLBBb+iFWfKI2EwdxzOpE1qRfHASTir6uX/5zXhl/zSHPlYQZqSz/4aTl acruQfxRI3nWPNVM1qMz9ciq8Plu37IWE1SjLArJxIt9qDr9HQbdLdcFoowWUyLwCNmh ng6Ouoe2VmuyFnK+bKnloBlOrfzDcVKYirCCPhXouX8paajg0pzmHpeV0x95t0Sw35Ul iMkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RVS18Yn6eAIfB8dsuEuRqfWgVSQothFr+FCbVLT3170=; b=MKdFp1bcSYeSh3Vz8qhZMf3ib6TPoWYyJtCJdSl998S761Gp2W/u8+9vxyArQAuEPJ Y3aQClFNVxHpfF4LXM/1SLhDsQimIQmgVusLWfHYq5j+3z3lCbnSs9SPSDBpifdjwSSX awKhS63PLa5Xj4628rCYwyQvA4+wjKKrWvRj1+Hij4dv/nGY84J4J2jHbYCIxXuJfKdr 63U6yn3oHuaUtlJ5kGrH+kIkBJnR0L1lCZ9IkueM+nVMXwGQz4wyoU14Iy63RhWGKYk1 YnOCZfRWYQiYept7O6WPiJsYsDEHzTce7ixjwhMhlVYiBHJs3OOVyWpuVZo/yE+aubjH uFGg== 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 m17si12722075edq.334.2020.08.18.01.45.26; Tue, 18 Aug 2020 01:45:50 -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 S1726353AbgHRIoz (ORCPT + 99 others); Tue, 18 Aug 2020 04:44:55 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:56695 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbgHRIoz (ORCPT ); Tue, 18 Aug 2020 04:44:55 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R701e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04397;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U67qSYH_1597740291; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U67qSYH_1597740291) by smtp.aliyun-inc.com(127.0.0.1); Tue, 18 Aug 2020 16:44:51 +0800 From: Wei Yang To: alexander.h.duyck@linux.intel.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@redhat.com, Wei Yang Subject: [Patch v2] mm/page_reporting: drop stale list head check in page_reporting_cycle Date: Tue, 18 Aug 2020 16:44:48 +0800 Message-Id: <20200818084448.33969-1-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org list_for_each_entry_safe() guarantees that we will never stumble over the list head; "&page->lru != list" will always evaluate to true. Let's simplify. Signed-off-by: Wei Yang Reviewed-by: David Hildenbrand --- mm/page_reporting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_reporting.c b/mm/page_reporting.c index 3bbd471cfc81..aaaa3605123d 100644 --- a/mm/page_reporting.c +++ b/mm/page_reporting.c @@ -178,7 +178,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone, * the new head of the free list before we release the * zone lock. */ - if (&page->lru != list && !list_is_first(&page->lru, list)) + if (!list_is_first(&page->lru, list)) list_rotate_to_front(&page->lru, list); /* release lock before waiting on report processing */ -- 2.20.1 (Apple Git-117)