linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: SeongJae Park <sjpark@amazon.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	SeongJae Park <sjpark@amazon.de>
Subject: Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages
Date: Fri, 5 Jun 2020 11:27:00 +0200	[thread overview]
Message-ID: <dabb8aad-d3c2-6667-44e0-7e07606bb820@redhat.com> (raw)
In-Reply-To: <20200605092502.18018-2-sjpark@amazon.com>

On 05.06.20 11:25, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> 'Idle page tracking' users can pass random pfn that might be mapped to
> an offline page.  To avoid accessing such pages, this commit modifies
> the 'page_idle_get_page()' to use 'pfn_to_online_page()' instead of
> 'pfn_valid()' and 'pfn_to_page()' combination, so that the pfn mapped to
> an offline page can be skipped.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> Reported-by: David Hildenbrand <david@redhat.com>
> ---
>  mm/page_idle.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/page_idle.c b/mm/page_idle.c
> index 295512465065..057c61df12db 100644
> --- a/mm/page_idle.c
> +++ b/mm/page_idle.c
> @@ -4,6 +4,7 @@
>  #include <linux/fs.h>
>  #include <linux/sysfs.h>
>  #include <linux/kobject.h>
> +#include <linux/memory_hotplug.h>
>  #include <linux/mm.h>
>  #include <linux/mmzone.h>
>  #include <linux/pagemap.h>
> @@ -30,13 +31,9 @@
>   */
>  static struct page *page_idle_get_page(unsigned long pfn)
>  {
> -	struct page *page;
> +	struct page *page = pfn_to_online_page(pfn);
>  	pg_data_t *pgdat;
>  
> -	if (!pfn_valid(pfn))
> -		return NULL;
> -
> -	page = pfn_to_page(pfn);
>  	if (!page || !PageLRU(page) ||
>  	    !get_page_unless_zero(page))
>  		return NULL;
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-06-05  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  9:25 [PATCH 0/2] Trivial fixups SeongJae Park
2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
2020-06-05  9:27   ` David Hildenbrand [this message]
2020-06-05  9:31   ` Pankaj Gupta
2020-06-05  9:25 ` [PATCH 2/2] scripts/spelling: Add a few more typos SeongJae Park
2020-06-05  9:36   ` David Hildenbrand

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=dabb8aad-d3c2-6667-44e0-7e07606bb820@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjpark@amazon.com \
    --cc=sjpark@amazon.de \
    /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).