From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
Shaohua Li <shli@kernel.org>,
Yalin.Wang@sonymobile.com
Subject: Re: [PATCH 3/4] mm: move lazy free pages to inactive list
Date: Tue, 31 Mar 2015 14:57:29 +0900 [thread overview]
Message-ID: <20150331055729.GC16825@blaptop> (raw)
In-Reply-To: <20150330222847.f255962c.akpm@linux-foundation.org>
On Mon, Mar 30, 2015 at 10:28:47PM -0700, Andrew Morton wrote:
> On Tue, 31 Mar 2015 13:45:25 +0900 Minchan Kim <minchan@kernel.org> wrote:
> > >
> > > deactivate_page() doesn't look at or alter PageReferenced(). Should it?
> >
> > Absolutely true. Thanks.
> > Here it goes.
> >
> > >From 2b2c92eb73a1cceac615b9abd4c0f5f0c3395ff5 Mon Sep 17 00:00:00 2001
> > From: Minchan Kim <minchan@kernel.org>
> > Date: Tue, 31 Mar 2015 13:38:46 +0900
> > Subject: [PATCH] mm: lru_deactivate_fn should clear PG_referenced
> >
> > deactivate_page aims for accelerate for reclaiming through
> > moving pages from active list to inactive list so we should
> > clear PG_referenced for the goal.
> >
> > ...
> >
> > --- a/mm/swap.c
> > +++ b/mm/swap.c
> > @@ -800,6 +800,7 @@ static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec,
> >
> > del_page_from_lru_list(page, lruvec, lru + LRU_ACTIVE);
> > ClearPageActive(page);
> > + ClearPageReferenced(page);
> > add_page_to_lru_list(page, lruvec, lru);
> >
> > __count_vm_event(PGDEACTIVATE);
>
> What if we have
>
> PageLRU(page) && !PageActive(page) && PageReferenced(page)
>
> if we really want to "accelerate the reclaim of @page" then we should
> clear PG_referenced there too.
The function's name is *deactivate*_page. IOW, I think it should work
for only pages in active list, IMHO.
>
> (And what about page_referenced(page) :))
Yes, I considered it when you mentioned PG_referenced. Now, madvise_free
clear out access bit of page table when the syscall is called so
shrink_page_list could reclaim pages easily.
Of course, we could clear access bit by page_referenced for general purpose,
not only madvise_free but it would hurt performance for madvise_free so
I'd like to leave it unless there is a need for the function.
--
Kind regards,
Minchan Kim
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
Shaohua Li <shli@kernel.org>,
Yalin.Wang@sonymobile.com
Subject: Re: [PATCH 3/4] mm: move lazy free pages to inactive list
Date: Tue, 31 Mar 2015 14:57:29 +0900 [thread overview]
Message-ID: <20150331055729.GC16825@blaptop> (raw)
In-Reply-To: <20150330222847.f255962c.akpm@linux-foundation.org>
On Mon, Mar 30, 2015 at 10:28:47PM -0700, Andrew Morton wrote:
> On Tue, 31 Mar 2015 13:45:25 +0900 Minchan Kim <minchan@kernel.org> wrote:
> > >
> > > deactivate_page() doesn't look at or alter PageReferenced(). Should it?
> >
> > Absolutely true. Thanks.
> > Here it goes.
> >
> > >From 2b2c92eb73a1cceac615b9abd4c0f5f0c3395ff5 Mon Sep 17 00:00:00 2001
> > From: Minchan Kim <minchan@kernel.org>
> > Date: Tue, 31 Mar 2015 13:38:46 +0900
> > Subject: [PATCH] mm: lru_deactivate_fn should clear PG_referenced
> >
> > deactivate_page aims for accelerate for reclaiming through
> > moving pages from active list to inactive list so we should
> > clear PG_referenced for the goal.
> >
> > ...
> >
> > --- a/mm/swap.c
> > +++ b/mm/swap.c
> > @@ -800,6 +800,7 @@ static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec,
> >
> > del_page_from_lru_list(page, lruvec, lru + LRU_ACTIVE);
> > ClearPageActive(page);
> > + ClearPageReferenced(page);
> > add_page_to_lru_list(page, lruvec, lru);
> >
> > __count_vm_event(PGDEACTIVATE);
>
> What if we have
>
> PageLRU(page) && !PageActive(page) && PageReferenced(page)
>
> if we really want to "accelerate the reclaim of @page" then we should
> clear PG_referenced there too.
The function's name is *deactivate*_page. IOW, I think it should work
for only pages in active list, IMHO.
>
> (And what about page_referenced(page) :))
Yes, I considered it when you mentioned PG_referenced. Now, madvise_free
clear out access bit of page table when the syscall is called so
shrink_page_list could reclaim pages easily.
Of course, we could clear access bit by page_referenced for general purpose,
not only madvise_free but it would hurt performance for madvise_free so
I'd like to leave it unless there is a need for the function.
--
Kind regards,
Minchan Kim
next prev parent reply other threads:[~2015-03-31 5:57 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 1:20 [PATCH 1/4] mm: free swp_entry in madvise_free Minchan Kim
2015-03-11 1:20 ` Minchan Kim
2015-03-11 1:20 ` [PATCH 2/4] mm: change deactivate_page with deactivate_file_page Minchan Kim
2015-03-11 1:20 ` Minchan Kim
2015-03-11 1:20 ` [PATCH 3/4] mm: move lazy free pages to inactive list Minchan Kim
2015-03-11 1:20 ` Minchan Kim
2015-03-11 2:14 ` Wang, Yalin
2015-03-11 2:14 ` Wang, Yalin
2015-03-11 4:30 ` Minchan Kim
2015-03-11 4:30 ` Minchan Kim
2015-04-01 20:38 ` Rik van Riel
2015-04-01 20:38 ` Rik van Riel
2015-03-11 9:05 ` [RFC ] mm: don't ignore file map pages for madvise_free( ) Wang, Yalin
2015-03-11 9:05 ` Wang, Yalin
2015-03-11 9:47 ` [RFC] mm:do recheck for freeable page in reclaim path Wang, Yalin
2015-03-11 9:47 ` Wang, Yalin
2015-03-20 22:43 ` [PATCH 3/4] mm: move lazy free pages to inactive list Andrew Morton
2015-03-20 22:43 ` Andrew Morton
2015-03-30 5:35 ` Minchan Kim
2015-03-30 5:35 ` Minchan Kim
2015-03-30 21:20 ` Andrew Morton
2015-03-30 21:20 ` Andrew Morton
2015-03-31 4:45 ` Minchan Kim
2015-03-31 4:45 ` Minchan Kim
2015-03-31 5:28 ` Andrew Morton
2015-03-31 5:28 ` Andrew Morton
2015-03-31 5:57 ` Minchan Kim [this message]
2015-03-31 5:57 ` Minchan Kim
2015-03-11 1:20 ` [PATCH 4/4] mm: make every pte dirty on do_swap_page Minchan Kim
2015-03-11 1:20 ` Minchan Kim
2015-03-30 5:22 ` Minchan Kim
2015-03-30 5:22 ` Minchan Kim
2015-03-30 8:51 ` Cyrill Gorcunov
2015-03-30 8:51 ` Cyrill Gorcunov
2015-03-30 8:59 ` Minchan Kim
2015-03-30 8:59 ` Minchan Kim
2015-03-30 21:14 ` Cyrill Gorcunov
2015-03-30 21:14 ` Cyrill Gorcunov
2015-03-31 4:38 ` Minchan Kim
2015-03-31 4:38 ` Minchan Kim
2015-04-08 23:50 ` Minchan Kim
2015-04-08 23:50 ` Minchan Kim
2015-04-09 20:59 ` Andrew Morton
2015-04-09 20:59 ` Andrew Morton
2015-04-10 0:08 ` Minchan Kim
2015-04-10 0:08 ` Minchan Kim
2015-04-10 0:14 ` Rik van Riel
2015-04-10 0:14 ` Rik van Riel
2015-04-11 21:40 ` Hugh Dickins
2015-04-11 21:40 ` Hugh Dickins
2015-04-12 14:48 ` Minchan Kim
2015-04-12 14:48 ` Minchan Kim
2015-04-15 6:49 ` Minchan Kim
2015-04-15 6:49 ` Minchan Kim
2015-03-19 0:46 ` [PATCH 1/4] mm: free swp_entry in madvise_free Minchan Kim
2015-03-19 0:46 ` Minchan Kim
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=20150331055729.GC16825@blaptop \
--to=minchan@kernel.org \
--cc=Yalin.Wang@sonymobile.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=riel@redhat.com \
--cc=shli@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 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.