Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp197303pxb; Thu, 17 Feb 2022 01:53:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzda7XOsLQWVOFvjPWLLZdVGPSF6JepSEsmyxeTLY0y7ZkWUWeFu8UxOXLcBywhZT2SuurW X-Received: by 2002:a17:90a:d70a:b0:1b8:9e00:f3bb with SMTP id y10-20020a17090ad70a00b001b89e00f3bbmr2223107pju.189.1645091639308; Thu, 17 Feb 2022 01:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645091639; cv=none; d=google.com; s=arc-20160816; b=hPTOwmq21R2uuhMLg0lDLVtdwkmFA3wcPXLRxIc6zlBrWoJ7Az+R3WLSA/NZL/4L1N 4w+V3zCKufi6t4K0fagNMLpjmVuHXYH+2JAbs732ahjWv/j5UvAMjgPlp5iFp3EhIKqT nL31ld31LJSX6s3kTKK+CsnuMiNULj3Wb6MB5qkinAMo1PsnTRFT7gmOf8mie8gPnVxG aVbRSZy9lGR0fYV2C7PSpG4F/mX10pI5gF7Ik9Lze89gDMgydEdNmX8lMmtDujffFdQy Mr0GpBTidQtMpg+cE3IaePJ4guHGDgZqwaqU4xQ0Nc8h5cyRqrx63WmAHVEV/ngFMyP8 spxA== 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=ysQghgx+k1y3LGaPIyA5nZ5r4qKWwoeTtGhmP3C3SBA=; b=Oub8a3AImC2Hgrf3sogUvQzLLp41sZNhv5A74+WYKDbXxjq11O6gHt70ZJg6/8GQMd 3xjU3i+XoVhMiBwyMZA8z++5d0e7uFsvTaxscptZwx/2MaYkZF/iIm456shrq1QdFZ4a Tpt6rfO8qzOHNoGvl3lvZ2ffdQVrv1Yr4D8qSGNVNpyeSYlDqW2xp/OOISZRZo71PLKk io3cqOIYr713lA9imNoZwGAvpyLkPnXGhmaHBjYoVzdVxI6YKRFYBUkrvKEJJM2ibWBD S1vegtJWAQ+odInaW64gNdaSolMcs5AhZi9RA1kAWGKU9toupMlAktwF61vi9BaJ6ypM EorQ== 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 u70si7540563pgd.186.2022.02.17.01.53.43; Thu, 17 Feb 2022 01:53:59 -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 S231882AbiBQAXH (ORCPT + 99 others); Wed, 16 Feb 2022 19:23:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238694AbiBQAXD (ORCPT ); Wed, 16 Feb 2022 19:23:03 -0500 Received: from outbound-smtp19.blacknight.com (outbound-smtp19.blacknight.com [46.22.139.246]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EC351390E7 for ; Wed, 16 Feb 2022 16:22:50 -0800 (PST) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp19.blacknight.com (Postfix) with ESMTPS id 157851C424D for ; Thu, 17 Feb 2022 00:22:49 +0000 (GMT) Received: (qmail 22567 invoked from network); 17 Feb 2022 00:22:48 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.223]) by 81.17.254.9 with ESMTPA; 17 Feb 2022 00:22:48 -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/6] mm/page_alloc: Fetch the correct pcp buddy during bulk free Date: Thu, 17 Feb 2022 00:22:22 +0000 Message-Id: <20220217002227.5739-2-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220217002227.5739-1-mgorman@techsingularity.net> References: <20220217002227.5739-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 Reviewed-by: Vlastimil Babka --- 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