Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1700056rwn; Fri, 9 Sep 2022 02:41:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Wp5e/naD4MbqTYG3V8N9RVYVMFUTTnEkMSGYqHsE2Ps/NkOFjsFenT0psmg97xSzqVn+P X-Received: by 2002:a62:bd03:0:b0:536:150c:a1c0 with SMTP id a3-20020a62bd03000000b00536150ca1c0mr13282850pff.19.1662716463457; Fri, 09 Sep 2022 02:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662716463; cv=none; d=google.com; s=arc-20160816; b=CueUSjT60FUBXK+fj9GRSnsl7iSWIQzh6cfJ27I+7jW+2ihhoL4uiKqCqSGNLF4v+8 wgkup2OWOjar1ou+y34/lPC5Hqpfbx3sqQpOm3ZXmVduGEbJNF0PvrZLlixONpefNCT1 hsHWmDM0hgXbgvzjVoUNzBcEcFc4wSj3zeCDhpTdqOCYScSXM8yJA5+XGr57t5jwb5Os tnnPoxG2FRvYbTtLRiqTC569RKB6DYskx/4G6oMTNn3p9VrGv8exBq3YO/n6Zz+2pp3y wouU/X11eSD/3tG0dxbsLqJMRm/m1bvJiglwV2ATLxV3f7rc9nJHLHjsZaIgjsBg4SbK Qbzw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YVVTr0RqI3YnuTSfe3vXnfsVLNPKWXIWLmHR02GsolM=; b=mkr3dnua89UCluGeoBbBLTrmyr5yU7TksKmkOgNACaEC4i1KSEjmbdXqjO7ttbqTQY LLsSF8vnW44dMeSuxETRIjzqBmhf/LfFzofv4lop0LKC0WSe/cgpzpHtsj0IbtpqqaDB MosER4jg3yQIduvUk6k6FUuY/OPmSwp8/AEJ+/IJBNiNMxDF2LiMunBF2HpWFqEPyTb6 R4S10JJxvPWECZ4DNWRPGG9VGp9VMJGjUa+qoekKp/HkvmnLPLuO+0Ege3DQxbVYFe6C nLuTP6KCaWAWxE7nN8SLzD/UyMHpMk8sNb/VmH89OPYdB7Z8Y9aGduNAr97D72tW+R1i 23Zw== 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 25-20020a631159000000b0043895144315si36140pgr.650.2022.09.09.02.40.51; Fri, 09 Sep 2022 02:41:03 -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 S230420AbiIIJ1q (ORCPT + 99 others); Fri, 9 Sep 2022 05:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbiIIJ05 (ORCPT ); Fri, 9 Sep 2022 05:26:57 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE05A4B13 for ; Fri, 9 Sep 2022 02:25:31 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9V96Vw2zlVnt; Fri, 9 Sep 2022 17:21:37 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:28 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 08/16] mm/page_alloc: add missing is_migrate_isolate() check in set_page_guard() Date: Fri, 9 Sep 2022 17:24:43 +0800 Message-ID: <20220909092451.24883-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) 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 In MIGRATE_ISOLATE case, zone freepage state shouldn't be modified as caller will take care of it. Add missing is_migrate_isolate() here to avoid possible unbalanced freepage state. Signed-off-by: Miaohe Lin --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a35ef385d906..94baf33da865 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -873,7 +873,8 @@ static inline bool set_page_guard(struct zone *zone, struct page *page, INIT_LIST_HEAD(&page->buddy_list); set_page_private(page, order); /* Guard pages are not available for any usage */ - __mod_zone_freepage_state(zone, -(1 << order), migratetype); + if (!is_migrate_isolate(migratetype)) + __mod_zone_freepage_state(zone, -(1 << order), migratetype); return true; } -- 2.23.0