From patchwork Wed Feb 24 20:04:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12102579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D015C433DB for ; Wed, 24 Feb 2021 20:05:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C62764E20 for ; Wed, 24 Feb 2021 20:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C62764E20 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9764A6B00AD; Wed, 24 Feb 2021 15:04:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 926138D0014; Wed, 24 Feb 2021 15:04:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83AC58D000B; Wed, 24 Feb 2021 15:04:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 6C94F6B00AD for ; Wed, 24 Feb 2021 15:04:59 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3915252C1 for ; Wed, 24 Feb 2021 20:04:59 +0000 (UTC) X-FDA: 77854239918.02.D72EF19 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf02.hostedemail.com (Postfix) with ESMTP id 7D128407F8F7 for ; Wed, 24 Feb 2021 20:04:45 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 940C364F35; Wed, 24 Feb 2021 20:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614197098; bh=XQKP27moMFkKHciNc/q9f6Gqms+vt4sg+mpiFBlu66A=; h=Date:From:To:Subject:In-Reply-To:From; b=unRm6qyPrQozw7PKb0Xj7gUnEnmSgS739GJqoGn6KcwB1oo9HsTJzBl7yAmGLyy6e cJoFW0UsKH/FwyNXkhsPtRgWwK/ZPByWKHiAXafBSu1wTFr7bP58dlp5UVz6ZpNnvD QudmVwmcsJZzloC0oagjXXsdSi0kX9cRGUPG6Zvo= Date: Wed, 24 Feb 2021 12:04:57 -0800 From: Andrew Morton To: akpm@linux-foundation.org, alexander.h.duyck@linux.intel.com, david@redhat.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, sh_def@163.com, torvalds@linux-foundation.org Subject: [patch 084/173] mm/page_reporting: use list_entry_is_head() in page_reporting_cycle() Message-ID: <20210224200457.Ws5HbjiS0%akpm@linux-foundation.org> In-Reply-To: <20210224115824.1e289a6895087f10c41dd8d6@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Stat-Signature: dd1uhcucbb8eapebnfjhmeoowzuegcx9 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7D128407F8F7 Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614197085-154441 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: sh Subject: mm/page_reporting: use list_entry_is_head() in page_reporting_cycle() Replace '&next->lru != list' with list_entry_is_head(). No functional change. Link: https://lkml.kernel.org/r/20201222182735.GA1257912@ubuntu-A520I-AC Signed-off-by: sh Reviewed-by: Andrew Morton Cc: Alexander Duyck Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/page_reporting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page_reporting.c~mm-page_reporting-use-list_entry_is_head-in-page_reporting_cycle +++ a/mm/page_reporting.c @@ -211,7 +211,7 @@ page_reporting_cycle(struct page_reporti } /* Rotate any leftover pages to the head of the freelist */ - if (&next->lru != list && !list_is_first(&next->lru, list)) + if (!list_entry_is_head(next, list, lru) && !list_is_first(&next->lru, list)) list_rotate_to_front(&next->lru, list); spin_unlock_irq(&zone->lock);