From patchwork Mon May 15 11:33:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13241287 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 6627AC77B75 for ; Mon, 15 May 2023 11:34:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03CE5900008; Mon, 15 May 2023 07:34:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F2DFF900002; Mon, 15 May 2023 07:34:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1D13900008; Mon, 15 May 2023 07:34:42 -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 D43B2900002 for ; Mon, 15 May 2023 07:34:42 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9C1BF41490 for ; Mon, 15 May 2023 11:34:42 +0000 (UTC) X-FDA: 80792282004.16.C36C655 Received: from outbound-smtp42.blacknight.com (outbound-smtp42.blacknight.com [46.22.139.226]) by imf15.hostedemail.com (Postfix) with ESMTP id A1B61A0007 for ; Mon, 15 May 2023 11:34:40 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.226 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684150480; 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=4egGt2Hlv8ZiZOcQjixQGa0JaEL2H2KNf/q3/YHYMsA=; b=IftRqqGPoMrkQgGdh5yCRkRXblUabC5NE3iFLzLrauL4uVV613RL0CZ6HV3y/uBMM+gtHK muYuDIEbJqb9fQkLNKtwdXv3d7hydv/7SAUzLAYsSz45ymevWkbUn9Rjso5x/VHEORq13Z bj4U3dIMrLYFpygjs7IhE8qv/sONhl4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684150480; a=rsa-sha256; cv=none; b=3OLMBKUcz6DTprM1U4D/XbSYMNdyucceCyKhkyaBzayxAUV8rJdny/Itsml9C9z/vxGAvR 7HKX7H3tV4+6uDkkdcT8B/KJNB1R5jX6xCVEbDHXKaFpVi4IfOxkoc5KKrlHQ8vEfw0K2C 0PqysogqOoXPPw68nib8nznaTRpzR1g= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.226 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp42.blacknight.com (Postfix) with ESMTPS id 48F9D230D for ; Mon, 15 May 2023 12:34:39 +0100 (IST) Received: (qmail 27631 invoked from network); 15 May 2023 11:34:39 -0000 Received: from unknown (HELO localhost.localdomain) (mgorman@techsingularity.net@[193.118.249.27]) by 81.17.254.9 with ESMTPA; 15 May 2023 11:34:38 -0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Jiri Slaby , Maxim Levitsky , Michal Hocko , Pedro Falcato , Paolo Bonzini , Chuyi Zhou , Linux-MM , LKML , Mel Gorman Subject: [PATCH 4/4] Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"" Date: Mon, 15 May 2023 12:33:44 +0100 Message-Id: <20230515113344.6869-5-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230515113344.6869-1-mgorman@techsingularity.net> References: <20230515113344.6869-1-mgorman@techsingularity.net> MIME-Version: 1.0 X-Rspamd-Queue-Id: A1B61A0007 X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: 5xf5pjzkixe4dn3attt9a8iepdiu3gzz X-HE-Tag: 1684150480-742089 X-HE-Meta: U2FsdGVkX19vwErwcsoI0KsvGIW3KuTQeZ+Eg7hxxg/tL35LXnAuYk1BaOomIdFzRqkSJHIpQLZUToPdi8vfyuWT34UaWgmpHMZIKr3OtpSvvulP7GwV3gPuTM3NoJN5EQPvQJYDquACk/gxa/Ax7AI2TYmvO7JZ9CB8CggJ3EU6uCuWaBsD0Bb167/nUDqwazZ4sPGQGX/j1eM1dEPbrAMdpsK6ReK8jJG2aEnTl6NPhr2Qy6zp4S4IKwKDr93pcuclBflERa1LCA8USB9ABKyMC8JPqopfhNyrcf/q/U2SAvv45+Ov4/1rDMBeHceRorIdv+6u1ytmxa5OZA7S5kHQdLYtpiNqNKyb/anZOHnvb8yROmIgd0M1HctzvKt/vGezLIcPoraWxxdU2DCKud2xSfEEDUCeBXc22sl5zkCbvPDEhQL0oX4+6IQhDcZHAvhuqnEBc8+yOpvxsXFHrleRn9ezZZs4/Ty3HTEr+NiwZpqlP9z6Fo98gkYcxem2OI3UWbadcLK3VtYSmJwVZkM/LfZKdxtQ/UBhHSSYAPWn+cwqBmreGrABL1qTAfqPBTkrvK6lZbc01L4w78dWRuJlxuGw0y+yfcI6yYTXU11a3GXA0p1XziUEim0EijwASnMvAOo2c0mhH/n29qdMJFkKJh+TvsQMfjH78chiVbxKoHSqb8OVkoVN5LOf5DfhtrF/O2Z2WAMO8GkL9w4yYimxEOKehwletWZxnPtfFljSMM/2/9USElXk+fcdwpEY1tAWI6gp6HfVSpHZnkrw5JMEYtHAR6Fo4hKjY3bzB4drMffaAs848EuJt2m/EVnpJyFUJESZUa7wSTWbl0dtsPH1Bp0tAV3HLj4lZzvIsklbQcWULgvbjJfQimkgOxJkVNds0cRx/Q7WAvlieLvgIbSHkT/eE99pQ50e8PZO/9hOkiLt0SdRfx6RLDSaagSL7Rijtp0FVYdCTeV42Yk 7x+o04Sd DC+nfVOZ0UZihwaS6xOr9m5K2sbSSu2yrj11AcUVW7/bLUuBJS5V9/Jbj77ahSOKcl5mccGVhPLkLtkgT+i3t9hs8n6yppgakth1dh+R5lCVOVBD/Ar30RE2kGzSwjHEMq4ZHx8+3HV6UCuBRWJtMa9Qcer/jkkC4sKLe5waynjXzDomiauKwJjYLTb9jKfHQlYBvkZGsaqY6/3lYSefuIy90dsU9jLoCwsPDVvE7pYRlbgPiKEJoajBbI/2vXtxnVc9Gby5+SokkNrhYXBlSAZLAebdCenjCoNF2+EEchbOMwQVNqweF0Si64GFbMfxaT4gj3VwuEw5KHGs1YHOaC126H6Vyzj09nXphQMRTTBUCkUAS8aRD6faDVOyoTBfLesK8nviMHmtFkHY= 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: This reverts commit 95e7a450b819 ("Revert "mm/compaction: fix set skip in fast_find_migrateblock""). Commit 7efc3b726103 ("mm/compaction: fix set skip in fast_find_migrateblock") was reverted due to bug reports about khugepaged consuming large amounts of CPU without making progress. The underlying bug was partially fixed by commit cfccd2e63e7e ("mm, compaction: finish pageblocks on complete migration failure") but it only mitigated the problem and Vlastimil Babka pointing out the same issue could theoretically happen to kcompactd. As pageblocks containing pages that fail to migrate should now be forcibly rescanned to set the skip hint if skip hints are used, fast_find_migrateblock() should no longer loop on a small subset of pageblocks for prolonged periods of time. Revert the revert so fast_find_migrateblock() is effective again. Using the mmtests config workload-usemem-stress-numa-compact, the number of unique ranges scanned was analysed for both kcompactd and !kcompactd activity. 6.4.0-rc1-vanilla kcompactd 7 range=(0x10d600~0x10d800) 7 range=(0x110c00~0x110e00) 7 range=(0x110e00~0x111000) 7 range=(0x111800~0x111a00) 7 range=(0x111a00~0x111c00) !kcompactd 1 range=(0x113e00~0x114000) 1 range=(0x114000~0x114020) 1 range=(0x114400~0x114489) 1 range=(0x114489~0x1144aa) 1 range=(0x1144aa~0x114600) 6.4.0-rc1-mm-revertfastmigrate kcompactd 17 range=(0x104200~0x104400) 17 range=(0x104400~0x104600) 17 range=(0x104600~0x104800) 17 range=(0x104800~0x104a00) 17 range=(0x104a00~0x104c00) !kcompactd 1793 range=(0x15c200~0x15c400) 5436 range=(0x105800~0x105a00) 19826 range=(0x150a00~0x150c00) 19833 range=(0x150800~0x150a00) 19834 range=(0x11ce00~0x11d000) 6.4.0-rc1-mm-follupfastfind kcompactd 22 range=(0x107200~0x107400) 23 range=(0x107400~0x107600) 23 range=(0x107600~0x107800) 23 range=(0x107c00~0x107e00) 23 range=(0x107e00~0x108000) !kcompactd 3 range=(0x890240~0x890400) 5 range=(0x886e00~0x887000) 5 range=(0x88a400~0x88a600) 6 range=(0x88f800~0x88fa00) 9 range=(0x88a400~0x88a420) Note that the vanilla kernel and the full series had some duplication of ranges scanned but it was not severe and would be in line with compaction resets when the skip hints are cleared. Just a revert of commit 7efc3b726103 ("mm/compaction: fix set skip in fast_find_migrateblock") showed excessive rescans of the same ranges so the series should not reintroduce bug 1206848. Link: https://bugzilla.suse.com/show_bug.cgi?id=1206848 Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/compaction.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index d7be990b1d60..91af6a8b7a98 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1859,7 +1859,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; } }