Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3086039rdb; Tue, 29 Aug 2023 05:11:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOTu1xNgwvFIkTL0FIolDWgYYuIMRfEiKvd/fpWpTU59PnuX85GnRqDAhfoWMNsvR7ATou X-Received: by 2002:a05:6a00:1993:b0:68c:6a2:f1d4 with SMTP id d19-20020a056a00199300b0068c06a2f1d4mr10755641pfl.31.1693311095897; Tue, 29 Aug 2023 05:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693311095; cv=none; d=google.com; s=arc-20160816; b=sr+8zcEb0W0z+Tqo6ZQwmBn77k02xftTaJXhPRPsACGUv9pamez9OWoC+z0krmGPxc gfmXOq8apTqFJ6PbKLA8TaLR27EIW+iz8lhjGyOc43UEF7zYqV8xxuEhSz9ApSsyeSgR eQ8QkZvaOCyeyUXANgYnt7esZmlvvx5SL/WeUVKSlJWmeqQ8MTpenZTiMOVoIH533zl3 aRocH7qOTUpYFVchCBYznicM5ChU3uILar+f0hucUh8ht1IdF+Rv+q/ja53yGPQ5TgD0 OLntYBceZdilu1FrfW/KswApcsVLwoR/uX4hIUa/D/GvRn2E64ywL/PxGgbKnDMHpxar gcEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ROhjm2iRCP4sE2dvgSXKqEMarRkhJBNQYnDmXwhSNkc=; fh=xul8u5lbFhEjS9WSOKDxePiEh0mLhT/NsGR/umN2l24=; b=bMEQmuRiEmMSIdc9MUDj/Biy3BR09cTyf2BMnbP6+Q4csvea1QYQuw40s7S8NRodc5 yTnyQwxwoii5hoZKnk4RgPqKtl4fXnyaFCHeGHzerAzpC1Y5soQ7N9WZxMLqS7/daljD 5XvoemQrqhQLSoJx1SaZkb8fdv8+pTzo8ZLROJtK9yjBvFFtv7+5o/512kXqZvkUA6hL clnq14nA5pMATtoK45KIPMp+gmsk36vl5ZFKzlkHBdASN/4aW0GC5ljz5wbqHLBBLl3C D3BTpBEMNzHRNLXxpqB2j789B+8BNzDKvhN/JnP4eP2eHv16kcwb7F4eLwy1PaMrgh/5 LPwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv128-20020a632e86000000b00565642feaa4si9467824pgb.172.2023.08.29.05.10.41; Tue, 29 Aug 2023 05:11:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234540AbjH2JS2 (ORCPT + 99 others); Tue, 29 Aug 2023 05:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234555AbjH2JSP (ORCPT ); Tue, 29 Aug 2023 05:18:15 -0400 Received: from outbound-smtp22.blacknight.com (outbound-smtp22.blacknight.com [81.17.249.190]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADAE412F for ; Tue, 29 Aug 2023 02:18:12 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp22.blacknight.com (Postfix) with ESMTPS id 26312BABEE for ; Tue, 29 Aug 2023 10:18:11 +0100 (IST) Received: (qmail 21416 invoked from network); 29 Aug 2023 09:18:10 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.20.191]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 29 Aug 2023 09:18:10 -0000 Date: Tue, 29 Aug 2023 10:18:08 +0100 From: Mel Gorman To: Kemeng Shi Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, david@redhat.com, willy@infradead.org Subject: Re: [PATCH v2 2/7] mm/compaction: call list_is_{first}/{last} more intuitively in move_freelist_{head}/{tail} Message-ID: <20230829091808.gfoyi4nhi7dy4f3a@techsingularity.net> References: <20230826153617.4019189-1-shikemeng@huaweicloud.com> <20230826153617.4019189-3-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230826153617.4019189-3-shikemeng@huaweicloud.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 26, 2023 at 11:36:12PM +0800, Kemeng Shi wrote: > We use move_freelist_head after list_for_each_entry_reverse to skip > recent pages. And there is no need to do actual move if all freepages > are searched in list_for_each_entry_reverse, e.g. freepage point to > first page in freelist. It's more intuitively to call list_is_first > with list entry as the first argument and list head as the second > argument to check if list entry is the first list entry instead of > call list_is_last with list entry and list head passed in reverse. > > Similarly, call list_is_last in move_freelist_tail is more intuitively. > > Signed-off-by: Kemeng Shi > Reviewed-by: Baolin Wang Acked-by: Mel Gorman -- Mel Gorman SUSE Labs