linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Huang Shijie <sjhuang@iluvatar.ai>, akpm@linux-foundation.org
Cc: kirill.shutemov@linux.intel.com, linux-mm@kvack.org
Subject: Re: [PATCH] mm:rmap: use the pra.mapcount to do the check
Date: Thu, 4 Apr 2019 16:08:33 -0700	[thread overview]
Message-ID: <de5865e2-a9e4-f0f9-f740-f1301679258a@oracle.com> (raw)
In-Reply-To: <20190404054828.2731-1-sjhuang@iluvatar.ai>

On 4/3/19 10:48 PM, Huang Shijie wrote:
> We have the pra.mapcount already, and there is no need to call
> the page_mapped() which may do some complicated computing
> for compound page.
> 
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>

This looks good to me.  I had to convince myself that there were no
issues if we were operating on a sub-page of a compound-page.  However,
Kirill is the expert here and would know of any subtle issues I may have
overlooked.

-- 
Mike Kravetz

> ---
>  mm/rmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 76c8dfd3ae1c..6c5843dddb5a 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -850,7 +850,7 @@ int page_referenced(struct page *page,
>  	};
>  
>  	*vm_flags = 0;
> -	if (!page_mapped(page))
> +	if (!pra.mapcount)
>  		return 0;
>  
>  	if (!page_rmapping(page))
> 


  reply	other threads:[~2019-04-04 23:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  5:48 [PATCH] mm:rmap: use the pra.mapcount to do the check Huang Shijie
2019-04-04 23:08 ` Mike Kravetz [this message]
2019-04-05  0:09   ` Andrew Morton
2019-04-05 12:36   ` Kirill A. Shutemov

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=de5865e2-a9e4-f0f9-f740-f1301679258a@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=sjhuang@iluvatar.ai \
    /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).