linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Mel Gorman <mgorman@techsingularity.net>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Aaron Lu <aaron.lu@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Michal Hocko <mhocko@kernel.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH 1/5] mm/page_alloc: Fetch the correct pcp buddy during bulk free
Date: Wed, 16 Feb 2022 12:16:48 +0100	[thread overview]
Message-ID: <95a205bc-fd35-565e-5597-deaadbf8b98a@suse.cz> (raw)
In-Reply-To: <20220215145111.27082-2-mgorman@techsingularity.net>

On 2/15/22 15:51, Mel Gorman wrote:
> 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 <mgorman@techsingularity.net>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  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));



  reply	other threads:[~2022-02-16 11:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 14:51 [PATCH 0/5] Follow-up on high-order PCP caching Mel Gorman
2022-02-15 14:51 ` [PATCH 1/5] mm/page_alloc: Fetch the correct pcp buddy during bulk free Mel Gorman
2022-02-16 11:16   ` Vlastimil Babka [this message]
2022-02-15 14:51 ` [PATCH 2/5] mm/page_alloc: Track range of active PCP lists " Mel Gorman
2022-02-16 12:02   ` Vlastimil Babka
2022-02-16 13:05     ` Mel Gorman
2022-02-15 14:51 ` [PATCH 3/5] mm/page_alloc: Simplify how many pages are selected per pcp list " Mel Gorman
2022-02-16 12:20   ` Vlastimil Babka
2022-02-15 14:51 ` [PATCH 4/5] mm/page_alloc: Free pages in a single pass " Mel Gorman
2022-02-16 14:24   ` Vlastimil Babka
2022-02-15 14:51 ` [PATCH 5/5] mm/page_alloc: Limit number of high-order pages on PCP " Mel Gorman
2022-02-16 14:37   ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95a205bc-fd35-565e-5597-deaadbf8b98a@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aaron.lu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=brouer@redhat.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).