diff mbox series

[7/9] mm: Calc the right pfn if page size is not 4K

Message ID 20220326064632.131637-8-mawupeng1@huawei.com
State Superseded
Headers show
Series introduce mirrored memory support for arm64 | expand

Commit Message

mawupeng March 26, 2022, 6:46 a.m. UTC
From: Ma Wupeng <mawupeng1@huawei.com>

Pervious 0x100000 is used to check the 4G limit in
find_zone_movable_pfns_for_nodes(). This is right in x86 because
the page size can only be 4K. But 16K and 64K are available in
arm64. So replate it with SIZE_4G >> PAGE_SHIFT.

Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand March 28, 2022, 12:33 p.m. UTC | #1
On 26.03.22 07:46, Wupeng Ma wrote:
> From: Ma Wupeng <mawupeng1@huawei.com>
> 
> Pervious 0x100000 is used to check the 4G limit in

s/Pervious/Previous/

> find_zone_movable_pfns_for_nodes(). This is right in x86 because
> the page size can only be 4K. But 16K and 64K are available in
> arm64. So replate it with SIZE_4G >> PAGE_SHIFT.

s/replate/replace/

> 
> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
> ---
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 6e0b4596cde9..41fd987b5b93 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -7811,7 +7811,7 @@ static void __init find_zone_movable_pfns_for_nodes(void)
>  
>  			usable_startpfn = memblock_region_memory_base_pfn(r);
>  
> -			if (usable_startpfn < 0x100000) {
> +			if (usable_startpfn < (SZ_4G >> PAGE_SHIFT)) {

PHYS_PFN(SZ_4G)

?

>  				mem_below_4gb_not_mirrored = true;
>  				continue;
>  			}
mawupeng March 29, 2022, 1:14 a.m. UTC | #2
在 2022/3/28 20:33, David Hildenbrand 写道:
> On 26.03.22 07:46, Wupeng Ma wrote:
>> From: Ma Wupeng <mawupeng1@huawei.com>
>>
>> Pervious 0x100000 is used to check the 4G limit in
> 
> s/Pervious/Previous/
> 
>> find_zone_movable_pfns_for_nodes(). This is right in x86 because
>> the page size can only be 4K. But 16K and 64K are available in
>> arm64. So replate it with SIZE_4G >> PAGE_SHIFT.
> 
> s/replate/replace/
> 
>>
>> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
>> ---
>>   mm/page_alloc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 6e0b4596cde9..41fd987b5b93 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -7811,7 +7811,7 @@ static void __init find_zone_movable_pfns_for_nodes(void)
>>   
>>   			usable_startpfn = memblock_region_memory_base_pfn(r);
>>   
>> -			if (usable_startpfn < 0x100000) {
>> +			if (usable_startpfn < (SZ_4G >> PAGE_SHIFT)) {
> 
> PHYS_PFN(SZ_4G)
> 
> ?
> 
Thanks for reviewing, will be fixed in the next version.

Thanks.
>>   				mem_below_4gb_not_mirrored = true;
>>   				continue;
>>   			}
> 
>
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6e0b4596cde9..41fd987b5b93 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7811,7 +7811,7 @@  static void __init find_zone_movable_pfns_for_nodes(void)
 
 			usable_startpfn = memblock_region_memory_base_pfn(r);
 
-			if (usable_startpfn < 0x100000) {
+			if (usable_startpfn < (SZ_4G >> PAGE_SHIFT)) {
 				mem_below_4gb_not_mirrored = true;
 				continue;
 			}