Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3246234rwb; Mon, 19 Sep 2022 18:00:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Ys/AkQYF2SuY9PAMlgcGwLrWqjtTM5Qi5kj9uWKrszmw1xYDNDtt2xxwnw+1vmWB16NKb X-Received: by 2002:a17:903:120c:b0:170:aa42:dbba with SMTP id l12-20020a170903120c00b00170aa42dbbamr2449497plh.67.1663635654610; Mon, 19 Sep 2022 18:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663635654; cv=none; d=google.com; s=arc-20160816; b=XPYfgj1cXmqqbPv/N+YGBhGewUY0ECrcEDfk4iMbHvotB43urUv8R2/d2O7fpybWuw BFR3Hm6sKiLGxLFyl2dCKvyzdqAJaOWU0WF+/A85BGju0lo8TyAfPN7QFY9SGP47gQEv 1ROIMEUT2ZVYM4YfsP7xI2aXMOkfNvDR0xicc46YGB7AZ1CdpjafDseAntd/c+vs+Hi3 kz/7eFSrjfcilCS7+oRlzbUEnO1BBpXwQ+IYV3ku+NHy4A9M9gntC3Eam7jLAmwhrybU 9pi5NLO7/3fnos3kUVceGo8eXGwLcRZmci4XV2Ze0Xyb5Zb/EX73PmB4c606ZPK30xrT bTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=WP1ELaWKz8MwY0MdBHr3f3BVLpkhPXHK8EdyA0Yadjg=; b=M0YcxjEca3t2lf0cLZnZv2Tkwedvce5cE0hyobNhrBrUPEZYf7qs3RXyp4Ft1S2pXX 375dSOlL1gR0LMmuzXsKfjvFBSf3N40oMesoPuO4eDcUeGQO9g0kx5bUi0WKts8JwFzg ABRwNcGS37JjEiIXZA2foMlYhrZJJJJVsAteUE9RHAkB9AgiTL3IvLupuyUPBUSnMA7r EyGTZEpnR0sWu4r5HRq3NRRjqWzMRIJyA0HBhb4rxh1/lRuZ2mgE/g4mAC810L5wHxZT U1i/tknXlA13foJn9kNY4a38pea48cv7eXtoJSoOBIZPlorhxQNye3D3gbI4CCjFzw/j qS7Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q28-20020a638c5c000000b004391b0971acsi109906pgn.100.2022.09.19.18.00.41; Mon, 19 Sep 2022 18:00:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbiITAvQ (ORCPT + 99 others); Mon, 19 Sep 2022 20:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiITAvN (ORCPT ); Mon, 19 Sep 2022 20:51:13 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBD643310 for ; Mon, 19 Sep 2022 17:51:11 -0700 (PDT) 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 Content-Type: text/plain 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 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); -- 1.9.1