From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave.hansen@intel.com>,
Linux MM <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org
Cc: wangnan0@huawei.com
Subject: [PATCH] memory-hotplug: remove redundant call of page_to_pfn
Date: Tue, 11 Nov 2014 17:13:39 +0800 [thread overview]
Message-ID: <5461D343.60803@huawei.com> (raw)
In-Reply-To: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com>
The start_pfn can be obtained directly by
phys_index << PFN_SECTION_SHIFT.
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
drivers/base/memory.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7c5d871..85be040 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -228,8 +228,8 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
struct page *first_page;
int ret;
- first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
- start_pfn = page_to_pfn(first_page);
+ start_pfn = phys_index << PFN_SECTION_SHIFT;
+ first_page = pfn_to_page(start_pfn);
switch (action) {
case MEM_ONLINE:
--
1.8.1.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>
WARNING: multiple messages have this Message-ID (diff)
From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave.hansen@intel.com>,
Linux MM <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Cc: <wangnan0@huawei.com>
Subject: [PATCH] memory-hotplug: remove redundant call of page_to_pfn
Date: Tue, 11 Nov 2014 17:13:39 +0800 [thread overview]
Message-ID: <5461D343.60803@huawei.com> (raw)
In-Reply-To: <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com>
The start_pfn can be obtained directly by
phys_index << PFN_SECTION_SHIFT.
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
drivers/base/memory.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7c5d871..85be040 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -228,8 +228,8 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
struct page *first_page;
int ret;
- first_page = pfn_to_page(phys_index << PFN_SECTION_SHIFT);
- start_pfn = page_to_pfn(first_page);
+ start_pfn = phys_index << PFN_SECTION_SHIFT;
+ first_page = pfn_to_page(start_pfn);
switch (action) {
case MEM_ONLINE:
--
1.8.1.4
.
next parent reply other threads:[~2014-11-11 9:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-11-11 9:13 ` Zhang Zhen [this message]
2014-11-11 9:13 ` [PATCH] memory-hotplug: remove redundant call of page_to_pfn Zhang Zhen
2014-11-12 3:16 ` Yasuaki Ishimatsu
2014-11-12 3:16 ` Yasuaki Ishimatsu
2014-11-12 3:42 ` Zhang Zhen
2014-11-12 3:42 ` Zhang Zhen
2014-11-17 19:45 ` David Rientjes
2014-11-17 19:45 ` David Rientjes
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=5461D343.60803@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=wangnan0@huawei.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 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.