From patchwork Sat Aug 5 11:07:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13342472 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B28C001DB for ; Sat, 5 Aug 2023 03:07:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA20B8D0002; Fri, 4 Aug 2023 23:07:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C519D8D0001; Fri, 4 Aug 2023 23:07:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B18998D0002; Fri, 4 Aug 2023 23:07:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9F24E8D0001 for ; Fri, 4 Aug 2023 23:07:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6225A1A02C0 for ; Sat, 5 Aug 2023 03:07:07 +0000 (UTC) X-FDA: 81088564494.20.7D60D8E Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf07.hostedemail.com (Postfix) with ESMTP id 10BA240004 for ; Sat, 5 Aug 2023 03:07:04 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=none (imf07.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691204825; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=90WktGBTzVBnwf8Ip6bK8XRqlxg0bXV1oDwyx+MgQpc=; b=i5ES4GYR0qcOi+PBEZEWaiUMf9vF2DopH36WlH7LOCxDM3YaWS4m53AWJkrEEDCb5YZBLr sUPzKcK40n+LYN+bHI11NsjJqozcEh2AKKTQUfukkIpYEL/6XsTyMCoiyoz8kXBOZ2PRIF Vbvj7OqwsxaRa7xzfZ7M0Ol57ZYMyHA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691204825; a=rsa-sha256; cv=none; b=XIY9vkFu4pwesLsFlpVgCv1aoF0paw6FtlbvCUWMB+zzFPTpF3UjjKzrEToTelFk3RtPde 3MRq3sRwQ4pre+dUp8o7rlAX+TE0Zr2B0SogxPI2/Dza30/gn7H1tzsgVwf9sfFAgzsqpM XRqEbTN2a/FLiSzkq/wdqED3D77f5HU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=none (imf07.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RHnYY5zxzz4f3m83 for ; Sat, 5 Aug 2023 11:06:57 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrHQvM1k6A5ePg--.23962S2; Sat, 05 Aug 2023 11:06:58 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH 0/9] Fixes and cleanups to compaction Date: Sat, 5 Aug 2023 19:07:02 +0800 Message-Id: <20230805110711.2975149-1-shikemeng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6CZ9SncON6jOmvDWGalZtKxL0MMq2T52LKwqLCsxqV8Msw/rOPVwaQNTmVdinZYSMSEmaJ6efHvC0jguX6Leq2kCEBCCUD31H7jd0OlXwCC6moPGGYqO5vImHZLSi20402QFHE9qE8lgpx/KEkFrjAvtpUyQHVh0 5rf/KFhP Aqie9Hy5YFeInabQKZWwjrR0tIbg1+e58UTBkKowiZ850A8oorPFwR1d7ngv5Hfke8Xys7O1nOmJH7Iof7P0bPUNFyt1WGSJJNnL/dGY/YupHP0U4PH+C6eVFS3AfhiK4iByv4SWlWWCLfcOeIlLmx9NSjW5Jm9MpltR3 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: Hi all, this is another series to do fix and clean up to compaction. Patch 1-2 fix and clean up freepage list operation. Patch 3-4 fix and clean up isolation of freepages Patch 7-9 factor code to check if compaction is needed for allocation order. More details can be found in respective patches. Thanks! Kemeng Shi (9): mm/compaction: use correct list in move_freelist_{head}/{tail} mm/compaction: call list_is_{first}/{last} more intuitively in move_freelist_{head}/{tail} mm/compaction: correctly return failure with bogus compound_order in strict mode mm/compaction: simplify pfn iteration in isolate_freepages_range mm/compaction: remove repeat compact_blockskip_flush check in reset_isolation_suitable mm/compaction: rename is_via_compact_memory to compaction_with_allocation_order mm/compaction: factor out code to test if we should run compaction for target order mm/compaction: call compaction_suit_allocation_order in kcompactd_node_suitable mm/compaction: call compaction_suit_allocation_order in kcompactd_do_work mm/compaction.c | 119 +++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 62 deletions(-) Reviewed-by: Baolin Wang Reviewed-by: Baolin Wang