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 830A4C43334 for ; Wed, 13 Jul 2022 06:20:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 987D7940101; Wed, 13 Jul 2022 02:20:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 938F49400E5; Wed, 13 Jul 2022 02:20:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8002C940101; Wed, 13 Jul 2022 02:20:19 -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 71B9C9400E5 for ; Wed, 13 Jul 2022 02:20:19 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 33DA660DCC for ; Wed, 13 Jul 2022 06:20:19 +0000 (UTC) X-FDA: 79681076958.09.3ED0072 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf16.hostedemail.com (Postfix) with ESMTP id 19ABE180089 for ; Wed, 13 Jul 2022 06:20:16 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id 72so9645508pge.0 for ; Tue, 12 Jul 2022 23:20:16 -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=wg9WwXyp/UatgSRNbu5lM24o68qVxRrRtZmkpy7UcWQ=; b=TF5B0wARVLZrHbkMt+xvYL83whfO8QX9Vz7y1gb5ZuwgCzLlXjENBjQ+P3IKSwX3Q7 jX4qBxqB014A2P4crgER+V9AXkur2hJtORP6MZ9bmflsgAtlIpAgfPQBDQQN00OV+naI kBpAZB4AEjP5kjadrkZ1w3gpPldCesEBnvFYvziu+ebDupmRrSLZ/Q+trreXYDRfxyRx rF5Ovx5Z01VaHJ9y70taLsLWCRDLlIZriS0G6W+fzeQQz0AYPEJ9d8lB6lIFYjIOl7WP DkzI23tRAD+LXrIlH2J76uLtpShlKKsqzmNtoFQwVxqqlSCxx0kuNK4lvZ2NJvlC4H9l ztyg== 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=wg9WwXyp/UatgSRNbu5lM24o68qVxRrRtZmkpy7UcWQ=; b=U0WH3lfnVE8HpQMaFsbg7dgoGjFEkad5RSG/1FcplQ9T+H66CkUYIQlH/qeqvG35n2 V8BO6R8NJE/91k50hRBuifQPmHvCXMFtoIUeCOmN66tWHsrg1EikrwHwUt+wcJTbaSfK i0MkdvyCGS4yWZZWN/c7fhzh01A4+eP3pSBQohc2qaxTs/mEiUamO5wOaoG7MuPQr6ca XI8Zba7lyz1OXbJZNUjiZcUovfAa9mMF/e5pjZUGsjlVQIkYJABf77nivCZUlCBQFiTX p9V/yVu5fuRC1BHz+J+T5HeirWz6CisuPUnw0gyR86EQB3HEqUFv9RH6vlWDmm3OVHsr muYA== X-Gm-Message-State: AJIora/3lNzYLYMQplPpViU+ZHRpTkGiLF334l3TW+R4ntPnlBAL9wCa Z4Z+EFC0aVBrABusDrpwPjEkXCY5+tlv4A== X-Google-Smtp-Source: AGRyM1upTjsUT9q4OBecv58k5KndGOauZ0rM3zfVgQRTjikPwDHXlA4dsG1W6ZrkAUX5aTFPL8v50w== X-Received: by 2002:a63:680a:0:b0:415:aacf:d384 with SMTP id d10-20020a63680a000000b00415aacfd384mr1723898pgc.232.1657693215470; Tue, 12 Jul 2022 23:20:15 -0700 (PDT) Received: from n248-144-242.byted.org. ([121.30.179.30]) by smtp.gmail.com with ESMTPSA id oc11-20020a17090b1c0b00b001efd4dbcf13sm679935pjb.39.2022.07.12.23.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 23:20:14 -0700 (PDT) From: Chuyi Zhou To: linux-mm@kvack.org Cc: zhouchuyi Subject: [PATCH v3] mm/compaction: fix set skip in fast_find_migrateblock Date: Wed, 13 Jul 2022 14:20:09 +0800 Message-Id: <20220713062009.597255-1-zhouchuyi@bytedance.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657693218; a=rsa-sha256; cv=none; b=nyC43pblBBQXfWrPKELExEG2mpwZ/gcYW3mJO2OcKGOW5qvLNG/+oo0+OwicyiSACCoS4f sXH9ARTjZOqc7BvmxLyruUHPr69G5kofBXtDm5ZDMs0ZAR0JUya+ve0Vek0sQNdsnNGFCj jOKaA+gm802lcsZkoWvHvtweWQYTmAQ= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=TF5B0wAR; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf16.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.215.176 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=1657693218; 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=wg9WwXyp/UatgSRNbu5lM24o68qVxRrRtZmkpy7UcWQ=; b=ywrk0QHjwJUF4+lViF1P85EjbMRlfc2f3N/SndmSypXHXkj4zQxn+bQX9G/KwGaSZh3Cp9 mq/FMpFZKH4KJmyIC+RirI0T6ebPbOL+zH/DOXEdiVlC5Q+0hiEG82ELUZcGLqi81Ctc5w GzOeVKtqfJuKqRyn3mr+Tosq/6x8Tow= X-Rspam-User: X-Stat-Signature: sj4iybcqdn5s7npiy9f6wphres9biytc X-Rspamd-Queue-Id: 19ABE180089 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=TF5B0wAR; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf16.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.215.176 as permitted sender) smtp.mailfrom=zhouchuyi@bytedance.com X-Rspamd-Server: rspam03 X-HE-Tag: 1657693216-984933 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%* Fixes: 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 962d05d1e187..abc7b0834471 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1850,7 +1850,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