* [PATCH] memory-hotplug: use PFN_DOWN in should_add_memory_movable
@ 2015-11-18 13:31 Geliang Tang
2015-11-18 16:51 ` Michal Hocko
0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2015-11-18 13:31 UTC (permalink / raw)
To: Andrew Morton, Gu Zheng, Vlastimil Babka, Tang Chen,
Naoya Horiguchi, David Vrabel
Cc: Geliang Tang, linux-mm, linux-kernel
Use PFN_DOWN() in should_add_memory_movable() to keep the consistency
of this file.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
mm/memory_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 67d488a..7c44ff7 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1205,7 +1205,7 @@ static int check_hotplug_memory_range(u64 start, u64 size)
*/
static int should_add_memory_movable(int nid, u64 start, u64 size)
{
- unsigned long start_pfn = start >> PAGE_SHIFT;
+ unsigned long start_pfn = PFN_DOWN(start);
pg_data_t *pgdat = NODE_DATA(nid);
struct zone *movable_zone = pgdat->node_zones + ZONE_MOVABLE;
--
2.5.0
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] memory-hotplug: use PFN_DOWN in should_add_memory_movable
2015-11-18 13:31 [PATCH] memory-hotplug: use PFN_DOWN in should_add_memory_movable Geliang Tang
@ 2015-11-18 16:51 ` Michal Hocko
0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2015-11-18 16:51 UTC (permalink / raw)
To: Geliang Tang
Cc: Andrew Morton, Gu Zheng, Vlastimil Babka, Tang Chen,
Naoya Horiguchi, David Vrabel, linux-mm, linux-kernel
On Wed 18-11-15 21:31:32, Geliang Tang wrote:
> Use PFN_DOWN() in should_add_memory_movable() to keep the consistency
> of this file.
I really detest this patch and c8e861a531b0 ("mm/memory_hotplug.c: use
PFN_DOWN()") which has started to use PFN_DOWN in that file likewise.
It obfuscates a perfectly understandable construct of addr->pfn
conversion by a macro which I have to really check what it does because
the name suggests I am rounding an existing pfn down.
This really doesn't help the readability.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> mm/memory_hotplug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 67d488a..7c44ff7 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1205,7 +1205,7 @@ static int check_hotplug_memory_range(u64 start, u64 size)
> */
> static int should_add_memory_movable(int nid, u64 start, u64 size)
> {
> - unsigned long start_pfn = start >> PAGE_SHIFT;
> + unsigned long start_pfn = PFN_DOWN(start);
> pg_data_t *pgdat = NODE_DATA(nid);
> struct zone *movable_zone = pgdat->node_zones + ZONE_MOVABLE;
>
> --
> 2.5.0
>
>
> --
> 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>
--
Michal Hocko
SUSE Labs
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-18 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 13:31 [PATCH] memory-hotplug: use PFN_DOWN in should_add_memory_movable Geliang Tang
2015-11-18 16:51 ` Michal Hocko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox