Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5224595pxb; Wed, 26 Jan 2022 07:24:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtQ1z8scmQr5W0V/V5ob8zqpCD8OjT9487sRPRsgMRrQVakLNJhF/7WpOfn6V5gcJq+BHo X-Received: by 2002:a17:90b:1e05:: with SMTP id pg5mr9498997pjb.50.1643210692007; Wed, 26 Jan 2022 07:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643210692; cv=none; d=google.com; s=arc-20160816; b=rH0huqzvFhmHnTs5qO9NHXWXHjFpwVtv1OJPzHFCiNCdl6fD22pQfhEQSuLjfrhJd+ wPMUfgw4TaAcPWmJ8x8xcznsWoyVtwFx+S+Y6wvkxssGJt4VWZs3LONoArAQ2TfWnaJh mTw4XF73yKZS1M3bm6em7rUq3abb6t8JOGxkZ+F0Cp0oM5wz7S6iZHmCjS14ewVDw5mB X40iitrsVuyxKKjlurJ96Esib4+FYvOK3I87R7s6bfx65Wpt2MXvo1rWgVqy6h3ZyLZ3 CKBsIyNIdbOVA9OnShY1MwV5dFs41iZ4XHh1iAklrvCR3L2PX3RVVb1twUkeGdObBmIW NMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=08lAt/Grs1XQKxEcZnusBldKEKo2QQCHP2z2YOSgfYU=; b=L2QnKsqyAykpPwLshQQeXXmggRf3L5s5f0NXu+bLRuNlQbExHVwC+igYq9b8gvDXk2 q+amQ6v5qGFUxFwW8PwxrfQztYnuELw17GeeIQZYSYRMJ0oOMTHVlFVCb9nu0ktd9I7f Llc/IakwfB5rf6CJiBaLXMkkyklqI7XOYL5r5fR3XI4dgP+4bZKtww7FITUz01G9uEZI cDGHne0utWEDI/3qiMpZASYII78AZ//i3QaKPtbKHC4zKr/dQD23hwa2OMh3/6PPaRy1 sqQ6vALJp8346VUDEjJo51bu9euKmisnKvZA7FcdW+2iELqG28tdN3d8oLQogGAi1VC8 0aqw== 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 v69si1717392pfc.153.2022.01.26.07.24.38; Wed, 26 Jan 2022 07:24:51 -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 S236244AbiAZCSo (ORCPT + 99 others); Tue, 25 Jan 2022 21:18:44 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:35869 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiAZCSl (ORCPT ); Tue, 25 Jan 2022 21:18:41 -0500 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 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/1/26 0:40, Vlastimil Babka 写道: > On 1/17/22 15:27, Chen Wandun wrote: >> This reverts commit 075782149abff45ee22f27315eced44d02b96779. >> >> commit 075782149abf ("mm/page_isolation: unset migratetype directly for > 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 of >> 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 followup > 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 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); >> } > .