Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp176106rwe; Wed, 31 Aug 2022 19:08:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR74qDKdJlKGSjzDDjH2rszpjvBlIhDvF7lxbLPopD/YHA9aFkTW+2rUpyxKSm460VFL7yJS X-Received: by 2002:aa7:da8b:0:b0:448:6bd:d74a with SMTP id q11-20020aa7da8b000000b0044806bdd74amr20388736eds.152.1661998126153; Wed, 31 Aug 2022 19:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661998126; cv=none; d=google.com; s=arc-20160816; b=PCFt6jRqQdopsteI7yrY9GXPT8HfkGeNRxMKjcmRP79/dAJtOxKKUZmbkiWGr5THK8 i2lmMw0P/6pilpKWuZYb83n66qfXjnPacFWPWUk9E7YvRqKOWdy+XkxGPgnPYzQzsfGb vGJM/AlqN7hRCe7UdWPinjhlpEGY6a+Yoc4U8cMs7qaFAZkUUa2+6QKXxIMkyoSvUblV HBtCh0426E20MSrRheQWBgC/XpwvF9ym6EeNbfVtQMj2D8Ae7Fm1nd7xFKnWwAKcdXgo SpuzTEx1aZd+uHp1SCwFF/Y7yzvtyjK4x9/RsPV+v0o4Unh3DDT0BTlGHbZMi8EMg8NL h/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=SjJWTFAsFVWGHy//Dr7GRz65IwbktTmIemKEH/cAHBE=; b=nD4ovhIoES11b3IsZZhgyLyFvNk37EEhDYlsXPokbdbX6Vj1LMPXbVP+UAojO83nit jhWxkUrDdTfr4QrGRtBfbW7ZZh72F2MWjPhreZVwrZZOEQQZ9jD+4ah1t57GU3lKhdxX +q7w8dOu4OkZhx4wE+EAYpybXTA4mDMYFCWSMx6qNrM9j0KkY6XhjQ+8cVQR90Utjp1a osX6Vm+v0GN+9DHtbt3+H0h5O2dt/Bclvz/WMTLi0wYUH2Y7kUjhopLvrM6r1eAiPGHH qy2pKfsYRnZ8XO8jGzVveq3GeAbq/nwMMNKfAeyPye+V1pXbQsijqZxO0fu1XLCCP4W2 FW9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a170906804800b0073d8d002e56si10134651ejw.957.2022.08.31.19.08.19; Wed, 31 Aug 2022 19:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232406AbiIABp7 (ORCPT + 99 others); Wed, 31 Aug 2022 21:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbiIABp4 (ORCPT ); Wed, 31 Aug 2022 21:45:56 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0415D659E6 for ; Wed, 31 Aug 2022 18:45:54 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MJ3jw2Cl1zHnbJ; Thu, 1 Sep 2022 09:44:04 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) 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.2375.24; Thu, 1 Sep 2022 09:45:52 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 09:45:51 +0800 From: Kefeng Wang To: Andrew Morton , CC: , Kefeng Wang Subject: [PATCH] mm: remove BUG_ON() in __isolate_free_page() Date: Thu, 1 Sep 2022 09:50:43 +0800 Message-ID: <20220901015043.189276-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop unneed comment and blank, adjust the variable, and the most important is to delete BUG_ON(). The page passed is always buddy page into __isolate_free_page() from compaction, page_isolation and page_reporting, and the caller also check the return, BUG_ON() is a too drastic measure, remove it. Signed-off-by: Kefeng Wang --- mm/page_alloc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9f2e250c2589..7ad0c7b14ad2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3600,16 +3600,11 @@ EXPORT_SYMBOL_GPL(split_page); int __isolate_free_page(struct page *page, unsigned int order) { - unsigned long watermark; - struct zone *zone; - int mt; - - BUG_ON(!PageBuddy(page)); - - zone = page_zone(page); - mt = get_pageblock_migratetype(page); + struct zone *zone = page_zone(page); + int mt = get_pageblock_migratetype(page); if (!is_migrate_isolate(mt)) { + unsigned long watermark; /* * Obey watermarks as if the page was being allocated. We can * emulate a high-order watermark check with a raised order-0 @@ -3623,8 +3618,6 @@ int __isolate_free_page(struct page *page, unsigned int order) __mod_zone_freepage_state(zone, -(1UL << order), mt); } - /* Remove page from free list */ - del_page_from_free_list(page, zone, order); /* @@ -3645,7 +3638,6 @@ int __isolate_free_page(struct page *page, unsigned int order) } } - return 1UL << order; } -- 2.35.3