From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C46FC6FA8F for ; Tue, 29 Aug 2023 09:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234551AbjH2JS3 (ORCPT ); Tue, 29 Aug 2023 05:18:29 -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> 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