From patchwork Tue Aug 18 08:44:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11720353 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E8FC1392 for ; Tue, 18 Aug 2020 08:45:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED0132078B for ; Tue, 18 Aug 2020 08:45:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED0132078B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EB176B000C; Tue, 18 Aug 2020 04:45:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 19E5F6B000D; Tue, 18 Aug 2020 04:45:02 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08AED6B000E; Tue, 18 Aug 2020 04:45:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id E70016B000C for ; Tue, 18 Aug 2020 04:45:01 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AB0E21E02 for ; Tue, 18 Aug 2020 08:45:01 +0000 (UTC) X-FDA: 77163054402.17.verse92_2d07bec2701e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 6A8D6180D0181 for ; Tue, 18 Aug 2020 08:45:01 +0000 (UTC) X-Spam-Summary: 1,0,0,5089d59b168c555c,d41d8cd98f00b204,richard.weiyang@linux.alibaba.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1261:1311:1314:1345:1437:1515:1534:1540:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3866:3867:3874:4321:4385:5007:6261:9010:9012:10004:11026:11658:11914:12043:12114:12297:12438:12555:12895:13069:13161:13172:13229:13255:13311:13357:13894:14096:14181:14384:14721:21080:21324:21627:21987:30054:30065:30070,0,RBL:115.124.30.132:@linux.alibaba.com:.lbl8.mailshell.net-64.201.201.201 62.20.2.100;04y8se57y7g5qcrbfscade397k3jtycbghzg3r664n7pkkxb6pxoq9chqrw84h9.kpzy3cmfcgf6w8fijbanpw9wi5eez1attmp41bykgnohs176t8ck8xf4y8q9wke.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: verse92_2d07bec2701e X-Filterd-Recvd-Size: 2103 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 08:44:58 +0000 (UTC) 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 X-Rspamd-Queue-Id: 6A8D6180D0181 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000052, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Alexander Duyck --- 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 */