From patchwork Fri Sep 9 09:24:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971376 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 329ABECAAD3 for ; Fri, 9 Sep 2022 09:25:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAF82940007; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC87E8D000A; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DB4794000C; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4A68F94000B for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 23B3A120B00 for ; Fri, 9 Sep 2022 09:25:32 +0000 (UTC) X-FDA: 79892014104.17.B7C1342 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf16.hostedemail.com (Postfix) with ESMTP id 874E718007F for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) 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 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715531; a=rsa-sha256; cv=none; b=ddGoCdlUJDF+Vg2mWkQ0mLaPCgS02LvXFICrXpltVxmOmgoR3sDDeFsAtoadqFHecs+4wh laBtbuGu2ots/ePPWfapVfxEXNk3jT2kUhQiUUr85HtS80fn3/FnaC0hfFKMrWoxLKgb0K woicqcdWIB0O0uPp4QGop7vN0ofi4Tw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715531; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YVVTr0RqI3YnuTSfe3vXnfsVLNPKWXIWLmHR02GsolM=; b=5gt0wQAQV5d4nKLdi2TyY06iJym257ljIHxF3SIU5MnwRObe1iZE+cX9+GkCNnO6BHSAem /frN3rzwIb/wQU4Mqjbi5TlmuvoKbzY6PxAXgwWFnZEQwF3EyIxuSjV8FRO6+8PWOJxhSu YfyHACQORDTAEoRSzfOnaSy1WmsyHEw= X-Stat-Signature: 3m7mzaruzgrh9j47ksjpj7nn4bygs94b X-Rspamd-Queue-Id: 874E718007F X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam12 X-HE-Tag: 1662715531-337627 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Oscar Salvador --- 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; }