From: Minchan Kim <minchan@kernel.org>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Vlastimil Babka <vbabka@suse.cz>, Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change
Date: Tue, 19 Jul 2016 08:58:49 +0900 [thread overview]
Message-ID: <20160718235849.GB9161@bbox> (raw)
In-Reply-To: <1468853426-12858-3-git-send-email-mgorman@techsingularity.net>
On Mon, Jul 18, 2016 at 03:50:25PM +0100, Mel Gorman wrote:
> With node-lru, the locking is based on the pgdat. As Minchan pointed
> out, there is an opportunity to reduce LRU lock release/acquire in
> check_move_unevictable_pages by only changing lock on a pgdat change.
>
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> ---
> mm/vmscan.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 45344acf52ba..a6f31617a08c 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -3775,24 +3775,24 @@ int page_evictable(struct page *page)
> void check_move_unevictable_pages(struct page **pages, int nr_pages)
> {
> struct lruvec *lruvec;
> - struct zone *zone = NULL;
> + struct pglist_data *pgdat = NULL;
> int pgscanned = 0;
> int pgrescued = 0;
> int i;
>
> for (i = 0; i < nr_pages; i++) {
> struct page *page = pages[i];
> - struct zone *pagezone;
> + struct pglist_data *pagepgdat = page_pgdat(page);
No need to initialize in here.
>
> pgscanned++;
> - pagezone = page_zone(page);
> - if (pagezone != zone) {
> - if (zone)
> - spin_unlock_irq(zone_lru_lock(zone));
> - zone = pagezone;
> - spin_lock_irq(zone_lru_lock(zone));
> + pagepgdat = page_pgdat(page);
Double initialize. Please remove either one.
> + if (pagepgdat != pgdat) {
> + if (pgdat)
> + spin_unlock_irq(&pgdat->lru_lock);
> + pgdat = pagepgdat;
> + spin_lock_irq(&pgdat->lru_lock);
> }
> - lruvec = mem_cgroup_page_lruvec(page, zone->zone_pgdat);
> + lruvec = mem_cgroup_page_lruvec(page, pgdat);
>
> if (!PageLRU(page) || !PageUnevictable(page))
> continue;
> @@ -3808,10 +3808,10 @@ void check_move_unevictable_pages(struct page **pages, int nr_pages)
> }
> }
>
> - if (zone) {
> + if (pgdat) {
> __count_vm_events(UNEVICTABLE_PGRESCUED, pgrescued);
> __count_vm_events(UNEVICTABLE_PGSCANNED, pgscanned);
> - spin_unlock_irq(zone_lru_lock(zone));
> + spin_unlock_irq(&pgdat->lru_lock);
> }
> }
> #endif /* CONFIG_SHMEM */
> --
> 2.6.4
>
--
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>
next prev parent reply other threads:[~2016-07-18 23:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 14:50 [PATCH 0/3] Follow-up fixes to node-lru series v3 Mel Gorman
2016-07-18 14:50 ` [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones() Mel Gorman
2016-07-18 16:11 ` Johannes Weiner
2016-07-18 23:54 ` Minchan Kim
2016-07-18 14:50 ` [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change Mel Gorman
2016-07-18 16:13 ` Johannes Weiner
2016-07-18 23:58 ` Minchan Kim [this message]
2016-07-18 14:50 ` [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Mel Gorman
2016-07-18 16:14 ` Johannes Weiner
2016-07-18 23:59 ` Minchan Kim
2016-07-18 20:02 ` [PATCH 0/3] Follow-up fixes to node-lru series v3 Johannes Weiner
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=20160718235849.GB9161@bbox \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=vbabka@suse.cz \
/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).