From patchwork Tue Sep 20 00:49:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 12981183 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 4A0D9C6FA82 for ; Tue, 20 Sep 2022 00:49:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 511FE940008; Mon, 19 Sep 2022 20:49:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 49945940007; Mon, 19 Sep 2022 20:49:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33953940008; Mon, 19 Sep 2022 20:49:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1FDC4940007 for ; Mon, 19 Sep 2022 20:49:44 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DD292AB1A3 for ; Tue, 20 Sep 2022 00:49:43 +0000 (UTC) X-FDA: 79930631046.05.AF3F7B2 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf22.hostedemail.com (Postfix) with ESMTP id 87F3EC0009 for ; Tue, 20 Sep 2022 00:49:42 +0000 (UTC) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id 28K0nMrm065312 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 20 Sep 2022 08:49:22 +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, 20 Sep 2022 08:49:21 +0800 From: "zhaoyang.huang" To: Mel Gorman , Andrew Morton , Zhaoyang Huang , , , Subject: [PATCHv2] mm: check high-order page when free it to pcp Date: Tue, 20 Sep 2022 08:49:00 +0800 Message-ID: <1663634940-6515-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: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 28K0nMrm065312 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663634983; 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=WP1ELaWKz8MwY0MdBHr3f3BVLpkhPXHK8EdyA0Yadjg=; b=vpXaolDgKuO73MvcHJzDosoO2jyKVRIf72lMV4I9UnO/sshd8t6jqnlasJwt5fa0gyIEZD f0mbOUnCRbjPrHjmGkMlYG7p0dHpJ4jIcVT9tzYeUEXNjTHqPt4nacHUAAJDrDDg3F9//f S7/Nll4Ko+GVwvfHeBJxc74HNPUxq40= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663634983; a=rsa-sha256; cv=none; b=ebr5DkTe1Md7LrDyjx7HTMVzjMQqyybUqbZkZ4xcZX9ygpALzfu/Yzb1uaJ5GvL/vZT+qd VUd5qPSY4tCOi8iXddO+2IoiM7061gU8/583ZwGIJB/5aYWe2yDOmOZ9iARwMlOrdzP/Sp lwpLwy63wUUrGpND/ts7yS4h2LLga7w= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 87F3EC0009 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com X-Stat-Signature: pdyw9cm9ixzngpyejqjfafbgs3skyorg X-HE-Tag: 1663634982-851666 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 High-order pcp page escaped from checking when both of DEBUG_VM and debug_pagealloc are all disabled if it allocated again from pcp_list without going to global free list, which should be introduced by 44042b4498. fix:44042b4498 Signed-off-by: Zhaoyang Huang --- changes of v2: update comments --- --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e008a3d..b54976d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1412,7 +1412,7 @@ static __always_inline bool free_pages_prepare(struct page *page, #ifdef CONFIG_DEBUG_VM /* - * With DEBUG_VM enabled, order-0 pages are checked immediately when being freed + * With DEBUG_VM enabled, pages are checked immediately when being freed * to pcp lists. With debug_pagealloc also enabled, they are also rechecked when * moved from pcp lists to free lists. */ @@ -1430,14 +1430,14 @@ static bool bulkfree_pcp_prepare(struct page *page) } #else /* - * With DEBUG_VM disabled, order-0 pages being freed are checked only when + * With DEBUG_VM disabled, pages being freed are checked only when * moving from pcp lists to free list in order to reduce overhead. With * debug_pagealloc enabled, they are checked also immediately when being freed * to the pcp lists. */ static bool free_pcp_prepare(struct page *page, unsigned int order) { - if (debug_pagealloc_enabled_static()) + if (debug_pagealloc_enabled_static() || order) return free_pages_prepare(page, order, true, FPI_NONE); else return free_pages_prepare(page, order, false, FPI_NONE);