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 BE1AAC3525A for ; Wed, 26 Jan 2022 02:18:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 59CB76B0071; Tue, 25 Jan 2022 21:18:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 525AA6B0075; Tue, 25 Jan 2022 21:18:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39DDB6B0078; Tue, 25 Jan 2022 21:18:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 215906B0071 for ; Tue, 25 Jan 2022 21:18:43 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CABDF9519D for ; Wed, 26 Jan 2022 02:18:42 +0000 (UTC) X-FDA: 79070829684.25.6A7E842 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf23.hostedemail.com (Postfix) with ESMTP id 3739914001E for ; Wed, 26 Jan 2022 02:18:42 +0000 (UTC) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Jk6nV1ntqzccG3; Wed, 26 Jan 2022 10:17:50 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500020.china.huawei.com (7.185.36.49) 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:18:40 +0800 Received: from [10.174.178.178] (10.174.178.178) 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:18:39 +0800 Message-ID: Date: Wed, 26 Jan 2022 10:18:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [PATCH] Revert "mm/page_isolation: unset migratetype directly for non Buddy page" To: Vlastimil Babka , , , , CC: , Oscar Salvador References: <20220117142712.3967624-1-chenwandun@huawei.com> From: Chen Wandun In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed X-Originating-IP: [10.174.178.178] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3739914001E X-Stat-Signature: qpmfnb73yext5asy61irqbtxk4ibu51c X-Rspam-User: nil Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1643163522-483662 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000009, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: =E5=9C=A8 2022/1/26 0:40, Vlastimil Babka =E5=86=99=E9=81=93: > On 1/17/22 15:27, Chen Wandun wrote: >> This reverts commit 075782149abff45ee22f27315eced44d02b96779. >> >> commit 075782149abf ("mm/page_isolation: unset migratetype directly fo= r > That's an old -next commit id, it went to mainline as 721fb891ad0b > ("mm/page_isolation: unset migratetype directly for non Buddy page") > >> 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 o= f >> control. >> >> Reported-by: "kernelci.org bot" >> Signed-off-by: Chen Wandun > Acked-by: Vlastimil Babka > > #regzbot ^introduced: 721fb891ad0b > > There should better be also: > > Fixes: 721fb891ad0b ("mm/page_isolation: unset migratetype directly for= non > Buddy page") > > Especially as that commit had a (inadequate, IMHO, for an optimization) > Fixes: tag and could end up being backported somewhere without the foll= owup > fix/revert. thanks, I will send v2 > >> --- >> 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 f= or >> * allocation. >> */ >> - if (!isolated_page && PageBuddy(page)) { >> + if (!isolated_page) { >> nr_pages =3D move_freepages_block(zone, page, migratetype, NULL); >> __mod_zone_freepage_state(zone, nr_pages, migratetype); >> } > .