From patchwork Sat Aug 26 15:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13366514 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 8B881C83F17 for ; Sat, 26 Aug 2023 07:36:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B67144014D; Sat, 26 Aug 2023 03:36:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 765E944014C; Sat, 26 Aug 2023 03:36:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DFB144014D; Sat, 26 Aug 2023 03:36:40 -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 51DC144014C for ; Sat, 26 Aug 2023 03:36:40 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 26CD81C8CD0 for ; Sat, 26 Aug 2023 07:36:40 +0000 (UTC) X-FDA: 81165448560.14.13A01C9 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf01.hostedemail.com (Postfix) with ESMTP id DDF444000C for ; Sat, 26 Aug 2023 07:36:37 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=none (imf01.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=1693035398; 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:in-reply-to:references:references; bh=KaHd+FWrzzZgHNzTJ4xbH3lDDDimVKsoC+a7FW5uAaE=; b=dzb9UHujd7BfKvW8Sb9nf5YS/XhbXEiAzK+RA0moYke3jveiqvpqicCUk2IWAAhWug2Pnj 9/5cEoiH8qYFDleyN62+VOq4LMjvks2gtlVxJbkDnJMHwo0VyVwPgGtjrcT8EBPqOO4C7R A4AK0kP0FTNwj2mGMXzM4ajxUZ0FaD0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693035398; a=rsa-sha256; cv=none; b=MTaYHyGQ3oNaA3+QiysgNISWOMKokMS+SSvRNgdQfTkQ1zs9QgVIBW1y7TFwbpIEyF4sgE 9P5vMryQJgZqe8Zagg2sC0yY/JLGnl1Hoq6wq3WTSvycHbo+TUH0HzN82x3o5UVHrNmUo1 JqmUj1+hMVa7aaRxX3Cvu+7I12d7mIg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=none (imf01.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 4RXpXs4684z4f3jYr 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--.2153S3; Sat, 26 Aug 2023 15:36:30 +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 1/7] mm/compaction: use correct list in move_freelist_{head}/{tail} Date: Sat, 26 Aug 2023 23:36:11 +0800 Message-Id: <20230826153617.4019189-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230826153617.4019189-1-shikemeng@huaweicloud.com> References: <20230826153617.4019189-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgDHQi98q+lk6GgZBg--.2153S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Zr4kCr1fGFWUXw1DXrWDJwb_yoW8Jw47pr y5Cr4UXr1UArW0yFnrXa1q9348KF42vrWjkrZ8uFWDAFn8trW2qF9ayF4UZ3sxXrWjkrWY vrsrKF43GrW7Ar7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBC14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_Jr4l82xGYIkIc2x26xkF7I0E14v26r1I6r4UM28lY4IEw2IIxxk0rwA2 F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjx v20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2 jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4 CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvj eVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I 1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWU JVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7V AKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42 IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTRCeHDUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: DDF444000C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 3ygcjktanpkab811i54t9jiyx3u1311p X-HE-Tag: 1693035397-302486 X-HE-Meta: U2FsdGVkX1/RlWmlYeAB0VPNgC8npEFuD6KZh9PRP/thmqYo7Au8+WslLQlGFRefYf1xpeLVxKynbgQPLh0PKiHF1Apj6Z8we5yNVKjW/fZEKnDWmYcmcJLnNoQMaHj0o+nSa2msiR5lpMbJUELBSQi/FNYOnXz0ngDSXVtNEPUHCfyaAxG0RIGS3+qc3j0crS6EDJ7fZDishTAnhr8JjXavaOJdeWEuv5R3+W9ZRNm2zYeNGP32v9Rpm0Wev9jAGCxkaOGsq4tflogSV8+HuHVKH4aRxc0szHD3XXmTk75OTb5/esYMGd/QdQgX8bI7lFavFDDDSQmcBq+t+q1RODkjnBlZa8dSyvpsgX/RBWrSrrDHdcV601KbZxt3NpGbHs+/jR8fvGIfrKkT0gDk9gIDyZVqkceScxDgBYYkdXpnxXDqxdIEQTd+Q58h8KoJJqtvCwHSD/TZdzmmMH3F+etx3cJUvfHjWkmBFEPru1zBxdypIc+8phm0pcMHEeZzr9uXCWjHrzba/2FJymx8G3h0/McyPUw4VlI5KuuLONfIyQWagqRNDdRNVA5pOn7QY3oFwG8vDBq5+Hf+dqQjFtDA3PdwRr6Q2p55BY2INhwplduy+3rTh4HnlVUC5ohgj/m0t/X1mJ2yg3ZfpXbIKQ9rjl7yX+tmqbH5zZM/vwzpq/X/hsH7fFgJNBhnQm5P/Z6hm3C3HhEB5BioARsqTPERD79RuBqAxqYGqkX1Z72HRzEmxHvjWFSlKHt2q6FDMaenoCpwA6ylwXNN8GjXBIaIvqtAzTCTNNhTPc99ub9X6fW6djIUmISIfMMVryCpcFEIPZcEErnY8kihyXhmbBu3ClTnwEoIvlcqStpH43NplaqxdZzDYpxEsREHTXJgoHtYQOmrJnvkHEvs2veI2fZBaeMNKoGTH5LkqegE/LmABvKuQW05ZzQpIEct2teT3fq8Xrx4mheOUMb/mzj r8Jou4Xz 5ggMk+OOFxCzaq6nLwvIFhIOX7u2o+kvvfefgWXnF9vRceaoNgivH5L5/BZHzovY5/eyECGItZsimuBdxDMETP9Tnfq9BJPpZ9Ro2Xig3ZynRQqEXZBI5qV46DlJA50ryjIbEqafgU4gwwfZrRToPonb/OBbu9rV3LvlkUm49DEiTf/UcujrjJ1wO/+c/r8LXwhpKW3GFxee58aQ7R4TsZ+GJY9onIvg1uAcEfjKoSHJxNiHDHM8Dh5ijhAL+bhYVfSGMw+It4/46R8ptbIip0GxfExKqexY6LEvW 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: The freepage is chained with buddy_list in freelist head. Use buddy_list instead of lru to correct the list operation. Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman --- mm/compaction.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 38c8d216c6a3..e3ee1bc1c0ad 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1395,8 +1395,8 @@ move_freelist_head(struct list_head *freelist, struct page *freepage) { LIST_HEAD(sublist); - if (!list_is_last(freelist, &freepage->lru)) { - list_cut_before(&sublist, freelist, &freepage->lru); + if (!list_is_last(freelist, &freepage->buddy_list)) { + list_cut_before(&sublist, freelist, &freepage->buddy_list); list_splice_tail(&sublist, freelist); } } @@ -1412,8 +1412,8 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage) { LIST_HEAD(sublist); - if (!list_is_first(freelist, &freepage->lru)) { - list_cut_position(&sublist, freelist, &freepage->lru); + if (!list_is_first(freelist, &freepage->buddy_list)) { + list_cut_position(&sublist, freelist, &freepage->buddy_list); list_splice_tail(&sublist, freelist); } }