From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>,
Pavel Emelyanov <xemul@virtuozzo.com>,
linux-mm@kvack.org
Subject: [PATCH] mm: page_idle_get_page() does not need zone_lru_lock
Date: Mon, 5 Dec 2016 21:55:10 -0800 (PST) [thread overview]
Message-ID: <alpine.LSU.2.11.1612052152560.13021@eggly.anvils> (raw)
Rechecking PageLRU() after get_page_unless_zero() may have value, but
holding zone_lru_lock around that serves no useful purpose: delete it.
Signed-off-by: Hugh Dickins <hughd@google.com>
---
mm/page_idle.c | 4 ----
1 file changed, 4 deletions(-)
--- 4.9-rc8/mm/page_idle.c 2016-10-02 16:24:33.000000000 -0700
+++ linux/mm/page_idle.c 2016-12-05 19:44:32.646625435 -0800
@@ -30,7 +30,6 @@
static struct page *page_idle_get_page(unsigned long pfn)
{
struct page *page;
- struct zone *zone;
if (!pfn_valid(pfn))
return NULL;
@@ -40,13 +39,10 @@ static struct page *page_idle_get_page(u
!get_page_unless_zero(page))
return NULL;
- zone = page_zone(page);
- spin_lock_irq(zone_lru_lock(zone));
if (unlikely(!PageLRU(page))) {
put_page(page);
page = NULL;
}
- spin_unlock_irq(zone_lru_lock(zone));
return page;
}
--
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 reply other threads:[~2016-12-06 5:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 5:55 Hugh Dickins [this message]
2016-12-07 8:32 ` Vlastimil Babka
2016-12-07 11:08 ` Vladimir Davydov
2016-12-07 13:07 ` Vlastimil Babka
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=alpine.LSU.2.11.1612052152560.13021@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=vdavydov.dev@gmail.com \
--cc=xemul@virtuozzo.com \
/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