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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4279C43334 for ; Tue, 12 Jul 2022 07:27:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F00F16B010E; Tue, 12 Jul 2022 03:27:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAFEE6B010F; Tue, 12 Jul 2022 03:27:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9F08940033; Tue, 12 Jul 2022 03:27:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CA8156B010E for ; Tue, 12 Jul 2022 03:27:55 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B4B22089D for ; Tue, 12 Jul 2022 07:27:55 +0000 (UTC) X-FDA: 79677618510.06.D8FEE56 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf22.hostedemail.com (Postfix) with ESMTP id 77771C006C for ; Tue, 12 Jul 2022 07:27:54 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id v4-20020a17090abb8400b001ef966652a3so10575391pjr.4 for ; Tue, 12 Jul 2022 00:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Gb6B2YneG7/QO6fu95oZ0Z8F4nMw518tVpmldOjOEIk=; b=cw7Dw/bjGhfErfEaNxHCGbgNkU+yWJ80gko9ETTbwdLE+bkzrgOV9hvKjIcS3KC1pU VHhrIrEeOMLebuI2O8oahhu/yiTy+0c+Pc/xpnIU3fdvAvGQp7O+jgoYss1OUGOFtz04 lQakz9WbLsPGILCTyuIPm5vR/qTWbCZMK+VAfIJvHi+UGcW7Km6WY5ftV4ebyMVnYW/h DoTqcZm7zwHAgjsSLgF370JGO//JNXlL+C1cHZYZNZBj+3cK2Jqh2cwU165fggKcti4I y8L0G7x0rpI1rjxS3dinS9y2ZEmtoBOgKG0PFR33wDZPIEKoHI8OLHLK8y9vj6TLjjxS LMPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Gb6B2YneG7/QO6fu95oZ0Z8F4nMw518tVpmldOjOEIk=; b=r873CIEZr5tKEpw22ISqTyUzUciHzw4kL5WJ6gvx16g6bqGZH4K3aoHBXAlJvLJZoD um34zdG/EBxiqtZ57msEoLtwTZDjjHkyuXjLu+hGgsxefLBHJp4Oq47K3tjFJk251/I6 aGYEiUzienWQYfKZY9bbFKJceVRjHhb/Rk6nlciauFjh3yvQjq2ix9O8xksCPWefcP0J BfP7NCDifXKwoBFiYkpXlawmlO07eGjR65SCGY3v6FttM7XqQTX7Ry5tsVZd2fSe1xFR 2A2tWcKyTCnXsRbAqmF9s4DvOmTbvFnXb0ENn/MR6LR8F1x6N/FamDRZAMF2ilp3Lnnc 7WAQ== X-Gm-Message-State: AJIora+Tlv0nBPJNKtgUWDYzJAHOrxHRTl+yDLpJF7iPx0flNCGlMoRX pV9o6wcORXOkp/1WlSf1XvV7Gx5IS0M7GQ== X-Google-Smtp-Source: AGRyM1u0VOG0ydF3gubHpZ7tZQvdL2kgXiKwTr/do8DwGWQZy1z4neNr95un7obFwyfKbQ6nEQQmpQ== X-Received: by 2002:a17:902:d551:b0:16b:f01f:a6ee with SMTP id z17-20020a170902d55100b0016bf01fa6eemr22149060plf.174.1657610872566; Tue, 12 Jul 2022 00:27:52 -0700 (PDT) Received: from n248-144-242.byted.org. ([121.30.179.100]) by smtp.gmail.com with ESMTPSA id w12-20020a170902e88c00b0016bdc520f8bsm6040708plg.299.2022.07.12.00.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 00:27:50 -0700 (PDT) From: Zhou Chuyi To: linux-mm@kvack.org Cc: linmiaohe@huawei.com, zhouchuyi Subject: [PATCH v2] mm/compaction: fix set skip in fast_find_migrateblock Date: Tue, 12 Jul 2022 15:27:45 +0800 Message-Id: <20220712072745.33870-1-zhouchuyi@bytedance.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="cw7Dw/bj"; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=zhouchuyi@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657610875; 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:dkim-signature; bh=Gb6B2YneG7/QO6fu95oZ0Z8F4nMw518tVpmldOjOEIk=; b=gJL2bCfNaqUYXrf7OczIjQKuxtLJRC9nJIeR8WMdMiW5Znuen6NzoQqCDp0SwCmdpUwoIL MyBeQ9gUdkywyoHEtB7CY3Dexp8gbTmvJCRzrA6QFa8zTBKjnuoB+Fzcf2yVPMINhEK0Gt 8y3bLcMC8PBllEhbOVQBgfswSRcKRao= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657610875; a=rsa-sha256; cv=none; b=I9YOh5TxPzTQ/oy9+YNY7nKmaXAFQLXh6P2BHG7f4LWaAeNpypG3uSpkpt3hHYzE3Wr9ty Us+qeVI9PEVSkb44YgBLdk9Kzffqc5S/9Atn9YhHeTmENWBLCwfsXpzMkDdaatJS2ZdicY 5J97Jj513zXVkMxhAqCYHaMmhjYJViI= Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="cw7Dw/bj"; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=zhouchuyi@bytedance.com X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: wxpajwk7ka3kuj1y6cwytmbrga9yh77j X-Rspamd-Queue-Id: 77771C006C X-HE-Tag: 1657610874-448089 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: From: zhouchuyi When we successfully find a pageblock in fast_find_migrateblock(), the block will be set skip-flag through set_pageblock_skip(). However, when entering isolate_migratepages_block(), the whole pageblock will be skipped due to the branch 'if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages))'. Eventually we will goto isolate_abort and isolate nothing. That cause fast_find_migrateblock useless. In this Patch, when we find a suitable pageblock in fast_find_migrateblock, we do noting but let isolate_migratepages_block to set skip flag to the pageblock after scan it. Normally, we would isolate some pages from the fast-find block. I use mmtest/thpscale-madvhugepage test it. Here is the result: baseline patch Amean fault-both-1 1331.66 ( 0.00%) 1261.04 * 5.30%* Amean fault-both-3 1383.95 ( 0.00%) 1191.69 * 13.89%* Amean fault-both-5 1568.13 ( 0.00%) 1445.20 * 7.84%* Amean fault-both-7 1819.62 ( 0.00%) 1555.13 * 14.54%* Amean fault-both-12 1106.96 ( 0.00%) 1149.43 * -3.84%* Amean fault-both-18 2196.93 ( 0.00%) 1875.77 * 14.62%* Amean fault-both-24 2642.69 ( 0.00%) 2671.21 * -1.08%* Amean fault-both-30 2901.89 ( 0.00%) 2857.32 * 1.54%* Amean fault-both-32 3747.00 ( 0.00%) 3479.23 * 7.15%* Fixs: 'commit 70b44595eafe9 ("mm, compaction: use free lists to quickly locate a migration source")' Signed-off-by: zhouchuyi --- mm/compaction.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 1f89b969c..a1a2b50c8 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1852,7 +1852,6 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; - set_pageblock_skip(freepage); break; } } -- 2.20.1