Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp168225pxb; Tue, 15 Feb 2022 10:33:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvqx83m7qAbQqTfGitzViZOIfyYX4rlegii7uiCgxPSWIpZHON/V0Z0jRiaTwAXlLsWi29 X-Received: by 2002:a17:902:c1c5:: with SMTP id c5mr331351plc.82.1644950025225; Tue, 15 Feb 2022 10:33:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644950025; cv=none; d=google.com; s=arc-20160816; b=dunRQzldColmYiyqkMJIlTITMkvbE4jIKTNtrjuBycnCKOI+09+6MPFKWcyM83EFcD 7Oo3D7g2c/sw2sv9L3+wp338CKQAIg6c4WMoFSLtHhPIYveYVS19Zt10ENlBX/vrHC18 F2qQNksbkohy7mVuMmNEovt8duFlNO0qaP09mmEY7zfXUPwP5GNiguGQBUh54/eVzTVj wXP3vFRs/9KISCk/q1d3nq09GkgmXWQpvWYeRmA4gVTKwtKyW5CgjzaLRuBnzndecKFV +xEkUSi18WEmyNOGW6nWvv3tD9a5tGviWWAIihsBLaTKPgYO/kFBpoQNIHI2F5z68y0f Cw/Q== 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=CCVKBdssOq3KylzpuYiDQYGbtc+grtvsretenpqoP2w=; b=WwmPWhjpfbKLboh72npt91dupAZ37K3rF2jtJh78APqGfVQEu0l0mf4XGHenyC2SRo BaefCEeDT83UWPAPlH2GOohDvyZk6kecKHFqZxRxDaTA/Q8RfLVvQdrvMQq2/yVEKCGT 5+0hah+S6O27YOeOxEGPkFRZJo5ornWvmcZmBJfwzqBgUrgf9R0bM/LDL/eR1wqA4RQM hdW5oU/A372G9AdUq3oq+YYWXz4YCAAD4R7wpMRuOhi/+W+LpElk/xk0lbn/jecLlcYS 5pVhNBpZfrbLYBZraQZODu0LB2LXOu2ohHfLNyChH8bsyONlUNiveGcVkrK2zZl9j7LI ZGxQ== 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 w9si15903137plz.485.2022.02.15.10.33.28; Tue, 15 Feb 2022 10:33:45 -0800 (PST) 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 S239331AbiBOOxO (ORCPT + 99 others); Tue, 15 Feb 2022 09:53:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239290AbiBOOwH (ORCPT ); Tue, 15 Feb 2022 09:52:07 -0500 Received: from outbound-smtp47.blacknight.com (outbound-smtp47.blacknight.com [46.22.136.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB4A939CA for ; Tue, 15 Feb 2022 06:51:34 -0800 (PST) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp47.blacknight.com (Postfix) with ESMTPS id 34214FA89D for ; Tue, 15 Feb 2022 14:51:33 +0000 (GMT) Received: (qmail 14272 invoked from network); 15 Feb 2022 14:51:32 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.223]) by 81.17.254.9 with ESMTPA; 15 Feb 2022 14:51:32 -0000 From: Mel Gorman To: Andrew Morton Cc: Aaron Lu , Dave Hansen , Vlastimil Babka , Michal Hocko , Jesper Dangaard Brouer , LKML , Linux-MM , Mel Gorman Subject: [PATCH 1/5] mm/page_alloc: Fetch the correct pcp buddy during bulk free Date: Tue, 15 Feb 2022 14:51:07 +0000 Message-Id: <20220215145111.27082-2-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220215145111.27082-1-mgorman@techsingularity.net> References: <20220215145111.27082-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 free_pcppages_bulk() prefetches buddies about to be freed but the order must also be passed in as PCP lists store multiple orders. Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") Signed-off-by: Mel Gorman --- 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 3589febc6d31..08de32cfd9bb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1432,10 +1432,10 @@ static bool bulkfree_pcp_prepare(struct page *page) } #endif /* CONFIG_DEBUG_VM */ -static inline void prefetch_buddy(struct page *page) +static inline void prefetch_buddy(struct page *page, unsigned int order) { unsigned long pfn = page_to_pfn(page); - unsigned long buddy_pfn = __find_buddy_pfn(pfn, 0); + unsigned long buddy_pfn = __find_buddy_pfn(pfn, order); struct page *buddy = page + (buddy_pfn - pfn); prefetch(buddy); @@ -1512,7 +1512,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, * prefetch buddy for the first pcp->batch nr of pages. */ if (prefetch_nr) { - prefetch_buddy(page); + prefetch_buddy(page, order); prefetch_nr--; } } while (count > 0 && --batch_free && !list_empty(list)); -- 2.31.1