linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory-hotplug: remove redundant call of page_to_pfn
       [not found] <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-11-11  9:13 ` Zhang Zhen
  2014-11-12  3:16   ` Yasuaki Ishimatsu
  2014-11-17 19:45   ` David Rientjes
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Zhen @ 2014-11-11  9:13 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton, Dave Hansen, Linux MM, linux-kernel
  Cc: wangnan0

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


.





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] memory-hotplug: remove redundant call of page_to_pfn
  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:42     ` Zhang Zhen
  2014-11-17 19:45   ` David Rientjes
  1 sibling, 1 reply; 4+ messages in thread
From: Yasuaki Ishimatsu @ 2014-11-12  3:16 UTC (permalink / raw)
  To: Zhang Zhen
  Cc: David Rientjes, Andrew Morton, Dave Hansen, Linux MM,
	linux-kernel, wangnan0

(2014/11/11 18:13), Zhang Zhen wrote:
> The start_pfn can be obtained directly by
> phys_index << PFN_SECTION_SHIFT.
>
> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
> ---

The patch looks good to me but I want you to write a purpose of the patch
to the description for other reviewer.

Thanks,
Yasuaki Ishimatsu

>   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:
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] memory-hotplug: remove redundant call of page_to_pfn
  2014-11-12  3:16   ` Yasuaki Ishimatsu
@ 2014-11-12  3:42     ` Zhang Zhen
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang Zhen @ 2014-11-12  3:42 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: David Rientjes, Andrew Morton, Dave Hansen, Linux MM,
	linux-kernel, wangnan0

On 2014/11/12 11:16, Yasuaki Ishimatsu wrote:
> (2014/11/11 18:13), Zhang Zhen wrote:
>> The start_pfn can be obtained directly by
>> phys_index << PFN_SECTION_SHIFT.
>>
>> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> ---
> 
> The patch looks good to me but I want you to write a purpose of the patch
> to the description for other reviewer.
> 
> Thanks,
> Yasuaki Ishimatsu
> 

Ok, thanks for your review.

>>   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:
>>
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] memory-hotplug: remove redundant call of page_to_pfn
  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-17 19:45   ` David Rientjes
  1 sibling, 0 replies; 4+ messages in thread
From: David Rientjes @ 2014-11-17 19:45 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: Andrew Morton, Dave Hansen, Linux MM, linux-kernel, wangnan0

On Tue, 11 Nov 2014, Zhang Zhen wrote:

> The start_pfn can be obtained directly by
> phys_index << PFN_SECTION_SHIFT.
> 
> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-17 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1415697184-26409-1-git-send-email-zhenzhang.zhang@huawei.com>
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:42     ` Zhang Zhen
2014-11-17 19:45   ` David Rientjes

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).