Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5259801pxb; Wed, 26 Jan 2022 08:06:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjbaEU6duYyF+aQS1/u9S0lLZSTiGrYWgcdn5dCcUoi66/AXGexvR8VtQDtIIS1TQ+udea X-Received: by 2002:a63:6a49:: with SMTP id f70mr19210128pgc.244.1643213218773; Wed, 26 Jan 2022 08:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643213218; cv=none; d=google.com; s=arc-20160816; b=ZFjj+hTMRAWXDiEaT1jJwYJMmySUxNRWuUkpDSsoYkII0PtznerFLNgUexTsHs9SFM 5DLVK+Vd8tL7Jn3SdHiLUN3wNtiPxyezb2HarQw1TKFs6vKh4CGgdNIO26TxzKM0Z+y1 0b8WDdhFDyjON2/Laq1rIUB6xb3KftxTKtlyK8itIDb6cmG1I6o4GVeiKTlgs2h9KZiS C7iDinWhMZLQXL/o7Q79zC/Dem3OTEBR6PJHUh5hZmwBWhqq0J956gTD4EQUI0KshqQY hhPZxQdorfhwVy2p3P7FH5n17hV983PJSTxGCpQcE6lGVBOJdP4cutP0lKXf7dw/njZh S0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=XPqrqKEXCAp6Vx/cRpSUSAKpABXQEhqxEiMLBXasjFk=; b=Se0Od2/CLz5xqtDnM9ZB2wKMiwMPAzjK7ALGIT2Yida0o8ukRdVkqBCQ7eJtYs2Yik 8eLncbzAdVYRAQud8KzNCsekw9/oGQjFja7IH8i/4erTDV5CVQqKMUDzggnKq1ZtViOF DGyHJ9f3p3+GDV+uHSFmJkUgyS+CK+4POCrr1MvTs+tdWJsognlzkzHneUy4v9A8OrDq 2qDn7wPjrkQxQYqEJktN8OYFABOuDnX5gA7usni1gFGiB+5RI+1mZIyX9o01pbxK5D6f NgDp0jP3CPTgX84eJNJdcmIDG9kfrrawPlr6gvZCS+0ZxrCp/G3Lu8rN61ClXkexZfyF MSwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v202si11104674pgb.401.2022.01.26.08.06.45; Wed, 26 Jan 2022 08:06:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236368AbiAZC0g (ORCPT + 99 others); Tue, 25 Jan 2022 21:26:36 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:16738 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236358AbiAZC0e (ORCPT ); Tue, 25 Jan 2022 21:26:34 -0500 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Jk6v31SbWzZfM2; Wed, 26 Jan 2022 10:22:39 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 26 Jan 2022 10:26:33 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 26 Jan 2022 10:26:32 +0800 From: Chen Wandun To: , , , , , , CC: Subject: [PATCH v2] Revert "mm/page_isolation: unset migratetype directly for non Buddy page" Date: Wed, 26 Jan 2022 10:44:36 +0800 Message-ID: <20220126024436.13921-1-chenwandun@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reported-by: "kernelci.org bot" Acked-by: David Hildenbrand Tested-by: Dong Aisheng Tested-by: Francesco Dolcini Acked-by: Vlastimil Babka Fixes: 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page") Signed-off-by: Chen Wandun --- mm/page_isolation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 6a0ddda6b3c5..f67c4c70f17f 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) * 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); } -- 2.18.0.huawei.25