From patchwork Sat Aug 26 15:36:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13366513 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 CC12FC83F11 for ; Sat, 26 Aug 2023 07:36:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DCA368000D; Sat, 26 Aug 2023 03:36:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78C4044014C; Sat, 26 Aug 2023 03:36:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67B5A68001B; Sat, 26 Aug 2023 03:36:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5A60868000D for ; Sat, 26 Aug 2023 03:36:39 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2A396C014A for ; Sat, 26 Aug 2023 07:36:39 +0000 (UTC) X-FDA: 81165448518.10.CD4DA14 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf26.hostedemail.com (Postfix) with ESMTP id C183B14000A for ; Sat, 26 Aug 2023 07:36:34 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=none (imf26.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=1693035397; 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=k9wneW24jhgD+MKOG7HwBop5bQEs6d3FvSz90C7Qt3o=; b=yFbF63wn4pG8+j0X2s7WaDgR11rhOValWSGWEHK9PykUjcfX5PVS+niF4Yk2I+SOymDDGA zS1lZjx/QCPXmCFU0dikRUipszpqdRhjBRQuLo8uB2eBAJwLilPYBTAMHKj860IUk9VMWT d1FInKWXm+BHPtYETGuo8llTUy2hlY8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693035397; a=rsa-sha256; cv=none; b=TalTKFbozFCOKHXERQDnNc+lT3uwTQbATZe9/5Q3Osdr3EvD8ZmUoolWy5nmmOhWZY8iIH lZYDVDCVO+Eh6UIkJg6iizSbNToJ3jwS4INToiUHY55AavmT/wNaYFvAkyXL+Z6FnFoZMX LCsWibjVtTRXNOu5leetQ/ivqaiu9BE= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=none (imf26.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.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RXpXs1N9xz4f3jHd for ; Sat, 26 Aug 2023 15:36:29 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDHQi98q+lk6GgZBg--.2153S2; Sat, 26 Aug 2023 15:36:29 +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, willy@infradead.org Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 0/7] Fixes and cleanups to compaction Date: Sat, 26 Aug 2023 23:36:10 +0800 Message-Id: <20230826153617.4019189-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CM-TRANSID: cCh0CgDHQi98q+lk6GgZBg--.2153S2 X-Coremail-Antispam: 1UD129KBjvJXoW7JryUCr4rJryrWr4rtw13urg_yoW8JF18pr Z3tw13tw47t3ZI9F4ftF48Za15tr4rGr15JrnrKr1rW3Z0kw1vyFn2yryrZryUXryayr42 vr4kKr48GFsrZFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkE14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjc xK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVAC Y4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJV W8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI2 0VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrV AFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCI c40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267 AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWU JVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0pRQo7 tUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Stat-Signature: 4494gjm8uj716tkmytrzqx9rc35ue6qd X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: C183B14000A X-Rspam-User: X-HE-Tag: 1693035394-520717 X-HE-Meta: U2FsdGVkX1/dRdeWzHn1e2cUeZk1s4jEP6C1qmxNfVaoe+SVDle4E0qxRKo7b4/IFIutZmErUMZ12sXOHt9NfxklVkOkc1y/5imNYP2xYU3O7NcIK2N8JoJ4wvQCBOQYn4xTdpGzsV9Sun7ZaaxHJV8MQEqcZHnOqBqYz+dhheZAds/avhd971esnnCF+57zYtXJ8mLJx+8OSRGvX4WbE03g8rIhkmIKzTfN1axkcNEUT1WD1avp5AiOlByF2BZeB1UdgZGq4chuWFBsrbkGnQzy+ldivC35sG1enHNmIEYYMKX1PkQnB65RPHhJtV2zrgdmaftVkY6a4vkVWKf6A1Alv9iBV/iXhKudpHszv7Dw5aTXRvkOupfVuvJ+M4/G53Y4flbx+P00Lupc5vxQQjRi5tvzjAoLJqCXbGGunhboBglK3yoE7FCWxIsNkVtkbck9iAFxXz8/xZKYyLeOXj8HpqJyXkHKN6bsQKAhPPVPJ2WnUYMaEE/d5K8OrjbSJ2cIZgTS8tR0SLR3KK84peb1VgaanDPfqbM3Y+pjZqKVdTlU4lzDJadlAbclQHw1+mszjtp7cOnnGNjwbbB46Fbsp3gRQq+1wCHjVOn4ntA7/03KzL+3JunDI5P80O0wwSpf+cqArA7NcIu+Ay4G3+c8DdxkEkIwYsDrTTfpE+cVSM33XrMJZeUHdDX/Y7wHMN7uzXBRvhb5xSUj7DdfvDUaamX5288nVacPCjjJ7DYdpHu9iTuRJcROHE494HkNRC73h51AZDssys3j2fgmq9zD5j1EakN1LtwHEvAutONw3cHIlxXsKhfR1PCrrsSh1rqh+yN2/x7ND6xK13/PHOr6HAQsLoegvV2ogEsmYHN+atJEkQw8FZoh48Fpfn3PeJqnof3aUvCw/QFx0xt5PWuKSAbYjjAMsfMOt/5Wt+593C0n/z4NJRRU1BguP4FbCFo1DCrsHcQp9F/FICS nf1SYS5u mvr4DlNIzSRMRBdHoJQJ87naf86xLArzzZ8CupepRITML53XZWvevI5UuCS/ZEXErjO31hlg4iQyp8xjY5NKSNOglTCfCCwNHPrI4kTmcytyVz3tlruXvHjXX2tToApz0cJI6B1LcTDqLcWzkyVfiy8nlOtTiXZ00OlBSN6AlBdiq363CMAVfSDDV9yaYfzjpbFBrW+u8HUH0kEE= 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 factor code to check if compaction is needed for allocation order. More details can be found in respective patches. Thanks! v1->v2: -Collect RVB from Baolin. -Keep pfn inside of pageblock in patch 3. -Only improve comment of is_via_compact_memory in patch 6. -Squash patch 8 and patch 9 into patch 7 and use ALLOC_WMARK_MIN instead of magic number 0. Kemeng Shi (7): 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: improve comment of is_via_compact_memory mm/compaction: factor out code to test if we should run compaction for target order mm/compaction.c | 106 +++++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 50 deletions(-) Reviewed-by: Baolin Wang Reviewed-by: Baolin Wang Acked-by: Mel Gorman Acked-by: Mel Gorman