From patchwork Fri Feb 4 04:49:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12734788 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 1865DC433F5 for ; Fri, 4 Feb 2022 04:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C8556B0073; Thu, 3 Feb 2022 23:49:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 977BC6B0074; Thu, 3 Feb 2022 23:49:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83F7A6B0075; Thu, 3 Feb 2022 23:49:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 765C26B0073 for ; Thu, 3 Feb 2022 23:49:11 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2B7D3824C447 for ; Fri, 4 Feb 2022 04:49:11 +0000 (UTC) X-FDA: 79103868102.11.FF641B1 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id BD0DB100002 for ; Fri, 4 Feb 2022 04:49:10 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8FA1B817E5; Fri, 4 Feb 2022 04:49:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B976C004E1; Fri, 4 Feb 2022 04:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1643950148; bh=ljC+ZB7/P+JNIOZfeDuwZx/G/aLrfvXi55fo2JuPMkc=; h=Date:To:From:In-Reply-To:Subject:From; b=16uofj9/66KjMZ6UkbUWHKdubwUpkyJSMTpx/nyhq2WX3yc5iQ8exyc8z82KCehIB yu7wi8N1JvXRFaaIpg82tWqFYejKbNKA9qSgpP9xCjRP5euYGjM/0gDf43npfQIr8j lGwOZ3SOI0JDxSZUI/eDobIsgeC/DngSMug7eUcE= Received: by hp1 (sSMTP sendmail emulation); Thu, 03 Feb 2022 20:49:06 -0800 Date: Thu, 03 Feb 2022 20:49:06 -0800 To: vbabka@suse.cz,linux@roeck-us.net,francesco.dolcini@toradex.com,david@redhat.com,bot@kernelci.org,aisheng.dong@nxp.com,chenwandun@huawei.com,akpm@linux-foundation.org,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220203204836.88dcebe504f440686cc63a60@linux-foundation.org> Subject: [patch 01/10] Revert "mm/page_isolation: unset migratetype directly for non Buddy page" Message-Id: <20220204044907.2B976C004E1@smtp.kernel.org> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: BD0DB100002 X-Stat-Signature: 81ekqg9bk5o7o6pzi53x8nadztq769ck X-Rspam-User: nil Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="16uofj9/"; spf=pass (imf05.hostedemail.com: domain of akpm@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@kernel.org; dmarc=none X-HE-Tag: 1643950150-723195 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: Chen Wandun Subject: Revert "mm/page_isolation: unset migratetype directly for non Buddy page" This reverts commit 721fb891ad0b3956d5c168b2931e3e5e4fb7ca40. commit 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control. Link: https://lkml.kernel.org/r/20220126024436.13921-1-chenwandun@huawei.com Fixes: 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page") Signed-off-by: Chen Wandun Reported-by: "kernelci.org bot" Acked-by: David Hildenbrand Tested-by: Dong Aisheng Tested-by: Francesco Dolcini Acked-by: Vlastimil Babka Tested-by: Guenter Roeck Signed-off-by: Andrew Morton --- mm/page_isolation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page_isolation.c~revert-mm-page_isolation-unset-migratetype-directly-for-non-buddy-page +++ a/mm/page_isolation.c @@ -115,7 +115,7 @@ static void unset_migratetype_isolate(st * onlining - just onlined memory won't immediately be considered for * allocation. */ - if (!isolated_page && PageBuddy(page)) { + if (!isolated_page) { nr_pages = move_freepages_block(zone, page, migratetype, NULL); __mod_zone_freepage_state(zone, nr_pages, migratetype); }