From patchwork Tue Sep 13 06:10:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 12974432 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 76114C6FA82 for ; Tue, 13 Sep 2022 06:12:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C98146B0073; Tue, 13 Sep 2022 02:12:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C47A06B0074; Tue, 13 Sep 2022 02:12:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B37636B0075; Tue, 13 Sep 2022 02:12:21 -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 A47C96B0073 for ; Tue, 13 Sep 2022 02:12:21 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 820DC40426 for ; Tue, 13 Sep 2022 06:12:21 +0000 (UTC) X-FDA: 79906042482.10.10A286A Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by imf21.hostedemail.com (Postfix) with ESMTP id BD6871C00A9 for ; Tue, 13 Sep 2022 06:12:19 +0000 (UTC) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id 28D6B6RY050568 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 13 Sep 2022 14:11:07 +0800 (CST) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 13 Sep 2022 14:11:06 +0800 From: "zhaoyang.huang" To: Andrew Morton , Catalin Marinas , Matthew Wilcox , Zhaoyang Huang , , , Subject: [PATCH 1/2] mm: fix logic error of bulkfree_pcp_prepare Date: Tue, 13 Sep 2022 14:10:45 +0800 Message-ID: <1663049446-22310-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 28D6B6RY050568 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663049540; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=Fk0K6sg3Ugu7cax/xJq/euasAiU3yIasU7phlif83cQ=; b=aXqVi5azL2RzCeIsrWtafaA56XKmNp71yosU0Q9o10UcM+ttU2JQiUkv9sDRVEPoQHPO5H O5TIDqUKrnZO7aUnKgl0VfMD1CCmIO5sHOObjVb0YIhFwwb5GqQXYuwmEvu8/BbL1BCPB9 RxGPfIfQGmfYwH+IoJKg+uyjdrSRHOA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663049540; a=rsa-sha256; cv=none; b=2M1Jfyt7WL9soNXqh8AyXjDUjBzhsRLuBCB3Er89NpNY0nhANmcaMay81VusjoXIyOjvLi sCenXgmUQAp5ejV3nEVOtWd4kxfG3FyDf2LHsD5hTQTMSyH9TAmMoUxgyhpr4oualbhhv3 2JiTJm3kXNwZAhmOCei+f3IhkQ1Xj5s= X-Stat-Signature: 3mmqbk4rf1pn44nf8og5w6srdty9y3o1 X-Rspamd-Queue-Id: BD6871C00A9 Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1663049539-116891 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: From: Zhaoyang Huang free_pages_check return 0 when result is ok while bulkfree_pcp_prepare treat it as false wrongly. Signed-off-by: Zhaoyang Huang Signed-off-by: Andrew Morton --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e008a3d..69b15e3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1424,7 +1424,7 @@ static bool free_pcp_prepare(struct page *page, unsigned int order) static bool bulkfree_pcp_prepare(struct page *page) { if (debug_pagealloc_enabled_static()) - return check_free_page(page); + return !check_free_page(page); else return false; } @@ -1445,7 +1445,7 @@ static bool free_pcp_prepare(struct page *page, unsigned int order) static bool bulkfree_pcp_prepare(struct page *page) { - return check_free_page(page); + return !check_free_page(page); } #endif /* CONFIG_DEBUG_VM */