* [PATCH] mm:rmap: use the pra.mapcount to do the check
@ 2019-04-04 5:48 Huang Shijie
2019-04-04 23:08 ` Mike Kravetz
0 siblings, 1 reply; 4+ messages in thread
From: Huang Shijie @ 2019-04-04 5:48 UTC (permalink / raw)
To: akpm; +Cc: kirill.shutemov, mike.kravetz, linux-mm, Huang Shijie
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>
---
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))
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm:rmap: use the pra.mapcount to do the check
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
2019-04-05 0:09 ` Andrew Morton
2019-04-05 12:36 ` Kirill A. Shutemov
0 siblings, 2 replies; 4+ messages in thread
From: Mike Kravetz @ 2019-04-04 23:08 UTC (permalink / raw)
To: Huang Shijie, akpm; +Cc: kirill.shutemov, linux-mm
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))
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm:rmap: use the pra.mapcount to do the check
2019-04-04 23:08 ` Mike Kravetz
@ 2019-04-05 0:09 ` Andrew Morton
2019-04-05 12:36 ` Kirill A. Shutemov
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2019-04-05 0:09 UTC (permalink / raw)
To: Mike Kravetz; +Cc: Huang Shijie, kirill.shutemov, linux-mm
On Thu, 4 Apr 2019 16:08:33 -0700 Mike Kravetz <mike.kravetz@oracle.com> wrote:
> 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))
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm:rmap: use the pra.mapcount to do the check
2019-04-04 23:08 ` Mike Kravetz
2019-04-05 0:09 ` Andrew Morton
@ 2019-04-05 12:36 ` Kirill A. Shutemov
1 sibling, 0 replies; 4+ messages in thread
From: Kirill A. Shutemov @ 2019-04-05 12:36 UTC (permalink / raw)
To: Mike Kravetz; +Cc: Huang Shijie, akpm, linux-mm
On Thu, Apr 04, 2019 at 11:08:33PM +0000, Mike Kravetz wrote:
> 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.
Looks good to me.
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-05 12:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-04-05 0:09 ` Andrew Morton
2019-04-05 12:36 ` Kirill A. Shutemov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.