mm/memory_hotplug: Easier calculation to get pages to next section boundary
Subsystems (2)
PATCH 1/1 mm/memory_hotplug: Easier calculation to get pages to next section boundary
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
--- mm/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/memory_hotplug.c +2 -1
@@ -528,7 +528,8 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,for (; pfn < end_pfn; pfn += cur_nr_pages) {cond_resched ();/* Select all remaining pages up to the next section boundary */ - cur_nr_pages =min (end_pfn - pfn, -(pfn |PAGE_SECTION_MASK )); + cur_nr_pages =min (end_pfn - pfn, +SECTION_ALIGN_UP (pfn +1 ) - pfn);__remove_section (pfn, cur_nr_pages, map_offset, altmap); map_offset =0 ; }
Signature · 1 line
2.24.1
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>
BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function check_hotplug_memory_range() guard the range.
This function says the range should be block_size aligned. And if I am correct, block size on x86 should be in the range
[MIN_MEMORY_BLOCK_SIZE, MEM_SIZE_FOR_LARGE_BLOCK]
And MIN_MEMORY_BLOCK_SIZE is section size.
Seems currently we support subsection hotplug? Then how a subsection range got hotplug? Or this patch is a pre-requisite?
Quoted 20 lines
---
mm/memory_hotplug.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)mm/memory_hotplug.c +2
-1@@ -528,7 +528,8 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,for (; pfn < end_pfn; pfn += cur_nr_pages) {cond_resched ();/* Select all remaining pages up to the next section boundary */ - cur_nr_pages =min (end_pfn - pfn, -(pfn |PAGE_SECTION_MASK )); + cur_nr_pages =min (end_pfn - pfn, +SECTION_ALIGN_UP (pfn +1 ) - pfn);__remove_section (pfn, cur_nr_pages, map_offset, altmap); map_offset =0 ; }Signature · 1 line
2.24.1
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 25 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.This function says the range should be
block_sizealigned. And if I am correct, block size on x86 should be in the range
Quoted 7 lines
[
MIN_MEMORY_BLOCK_SIZE,MEM_SIZE_FOR_LARGE_BLOCK]And
MIN_MEMORY_BLOCK_SIZEis section size.Seems currently we support subsection hotplug? Then how a subsection range got hotplug? Or this patch is a pre-requisite?
One more question is we support hot-add subsection memory but not support hot-online subsection memory.
Is my understanding correct?
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 16 lines · Wei Yang
Quoted 15 lines · Wei Yang
Quoted 13 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>
Quoted 6 lines
Quoted 6 lines
Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
It truly has a risk that system ram is very huge to make the block size is 2G, someone try to insert a 1G memory board. However, it should only exist in experiment environment, e.g build a guest with enough ram, then hot add 1G DIMM. In reality, we don't need to worry about it, at least what I saw is 512G order of magnitude.
Quoted 7 lines
Quoted 7 lines
This function says the range should be
block_sizealigned. And if I am correct, block size on x86 should be in the range[
MIN_MEMORY_BLOCK_SIZE,MEM_SIZE_FOR_LARGE_BLOCK]And
MIN_MEMORY_BLOCK_SIZEis section size.
No, if I got it right, the range on x86 is
[MIN_MEMORY_BLOCK_SIZE, MAX_BLOCK_SIZE].
MEM_SIZE_FOR_LARGE_BLOCK is the starting point from which block size can be adjusted. Otherwise it's MIN_MEMORY_BLOCK_SIZE.
/* Amount of ram needed to start using large blocks */ #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30)
Quoted 3 lines
Quoted 3 lines
Seems currently we support subsection hotplug? Then how a subsection range got hotplug? Or this patch is a pre-requisite?
The sub-section hotplug feature was added by your colleague Dan Williams. It intends to fix a nvdimms issue that nvdimms device could be mapped into a non section size aligned starting address. And nvdimms makes use of the existing memory hotplug mechanism to manage pages. Not sure if we are saying the same thing.
Quoted 11 lines
Quoted 1 line
One more question is we support hot-add subsection memory but not support hot-online subsection memory.
Is my understanding correct?
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 19 lines · Baoquan He
Quoted 18 lines · Wei Yang
Quoted 17 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
Quoted 45 lines
It truly has a risk that system ram is very huge to make the block size is 2G, someone try to insert a 1G memory board. However, it should only exist in experiment environment, e.g build a guest with enough ram, then hot add 1G DIMM. In reality, we don't need to worry about it, at least what I saw is 512G order of magnitude.
Quoted 7 lines
Quoted 7 lines
This function says the range should be
block_sizealigned. And if I am correct, block size on x86 should be in the range[
MIN_MEMORY_BLOCK_SIZE,MEM_SIZE_FOR_LARGE_BLOCK]And
MIN_MEMORY_BLOCK_SIZEis section size.No, if I got it right, the range on x86 is
[MIN_MEMORY_BLOCK_SIZE,MAX_BLOCK_SIZE].
MEM_SIZE_FOR_LARGE_BLOCKis the starting point from which block size can be adjusted. Otherwise it'sMIN_MEMORY_BLOCK_SIZE./* Amount of ram needed to start using large blocks */ #define
MEM_SIZE_FOR_LARGE_BLOCK(64UL << 30)Quoted 3 lines
Quoted 3 lines
Seems currently we support subsection hotplug? Then how a subsection range got hotplug? Or this patch is a pre-requisite?
The sub-section hotplug feature was added by your colleague Dan Williams. It intends to fix a nvdimms issue that nvdimms device could be mapped into a non section size aligned starting address. And nvdimms makes use of the existing memory hotplug mechanism to manage pages. Not sure if we are saying the same thing.
Quoted 11 lines
Quoted 1 line
One more question is we support hot-add subsection memory but not support hot-online subsection memory.
Is my understanding correct?
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 22 lines · Baoquan He
Quoted 21 lines · Baoquan He
Quoted 20 lines · Wei Yang
Quoted 19 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Check the code again, there are two memory range check:
* check_hotplug_memory_range(), block/section aligned
* check_pfn_span(), subsection aligned
The second check, check_pfn_span() in __add_pages(), enable the capability to add a memory range with subsection size.
This means hotplug still keeps section alignment.
BTW, __add_pages() share the same logic as __remove_pages(). Why not change it too? Do I miss something or I don't have the latest source code?
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 26 lines · Wei Yang
Quoted 25 lines · Baoquan He
Quoted 24 lines · Baoquan He
Quoted 22 lines · Wei Yang
Quoted 21 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Believe he won't, :-) If you like, we can talk off line.
Quoted 10 lines
Check the code again, there are two memory range check:
*
check_hotplug_memory_range(), block/section aligned
*check_pfn_span(), subsection alignedThe second check,
check_pfn_span()in__add_pages(), enable the capability to add a memory range with subsection size.This means hotplug still keeps section alignment.
memremap_pages() also call add_pages(), it doesn't have the check_hotplug_memory_range() invocation. check_pfn_span() is made for it specifically.
Quoted 3 lines
BTW,
__add_pages()share the same logic as__remove_pages(). Why not change it too? Do I miss something or I don't have the latest source code?
Good question, and I think it need. Just David is refactoring/cleaning up the remove_pages() code path, this is found out by Segher from patch reviewing.
Quoted 44 lines · Baoquan He
Quoted 26 lines · Wei Yang
Quoted 25 lines · Baoquan He
Quoted 24 lines · Baoquan He
Quoted 22 lines · Wei Yang
Quoted 21 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Believe he won't, :-) If you like, we can talk off line.
Quoted 6 lines
Check the code again, there are two memory range check:
*
check_hotplug_memory_range(), block/section aligned
*check_pfn_span(), subsection aligned
Quoted 9 lines
Quoted 4 lines
The second check,
check_pfn_span()in__add_pages(), enable the capability to add a memory range with subsection size.This means hotplug still keeps section alignment.
memremap_pages()also calladd_pages(), it doesn't have thecheck_hotplug_memory_range()invocation.check_pfn_span()is made for it specifically.
If my understanding is correct, memremap_pages() is used to add some dev memory to system. This is the use case which Dan want to enable for sub-section. Since memremap_pages() is not called in mem-hotplug path, this doesn't affect the hotplug range alignment.
Quoted 7 lines
Quoted 3 lines
BTW,
__add_pages()share the same logic as__remove_pages(). Why not change it too? Do I miss something or I don't have the latest source code?Good question, and I think it need. Just David is refactoring/cleaning up the
remove_pages()code path, this is found out by Segher from patch reviewing.
Ah, we may need a following cleanup :-)
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 55 lines · Wei Yang
Quoted 44 lines · Baoquan He
Quoted 26 lines · Wei Yang
Quoted 25 lines · Baoquan He
Quoted 24 lines · Baoquan He
Quoted 22 lines · Wei Yang
Quoted 21 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Believe he won't, :-) If you like, we can talk off line.
Quoted 6 lines
Check the code again, there are two memory range check:
*
check_hotplug_memory_range(), block/section aligned
*check_pfn_span(), subsection alignedQuoted 9 lines
Quoted 4 lines
The second check,
check_pfn_span()in__add_pages(), enable the capability to add a memory range with subsection size.This means hotplug still keeps section alignment.
memremap_pages()also calladd_pages(), it doesn't have thecheck_hotplug_memory_range()invocation.check_pfn_span()is made for it specifically.
Quoted 4 lines
If my understanding is correct,
memremap_pages()is used to add some dev memory to system. This is the use case which Dan want to enable for sub-section. Sincememremap_pages()is not called in mem-hotplug path, this doesn't affect the hotplug range alignment.
Yeah, we are on the same page.
Quoted 10 lines
Quoted 8 lines
Quoted 4 lines
BTW,
__add_pages()share the same logic as__remove_pages(). Why not change it too? Do I miss something or I don't have the latest source code?Good question, and I think it need. Just David is refactoring/cleaning up the
remove_pages()code path, this is found out by Segher from patch reviewing.Ah, we may need a following cleanup :-)
Agree. See what David will say. Fold it into this patch, or anyone post a new one.
Quoted 56 lines · Baoquan He
Quoted 55 lines · Wei Yang
Quoted 53 lines · Baoquan He
Quoted 26 lines · Wei Yang
Quoted 25 lines · Baoquan He
Quoted 24 lines · Baoquan He
Quoted 22 lines · Wei Yang
Quoted 21 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Believe he won't, :-) If you like, we can talk off line.
Quoted 10 lines
Check the code again, there are two memory range check:
*
check_hotplug_memory_range(), block/section aligned
*check_pfn_span(), subsection alignedThe second check,
check_pfn_span()in__add_pages(), enable the capability to add a memory range with subsection size.This means hotplug still keeps section alignment.
memremap_pages()also calladd_pages(), it doesn't have thecheck_hotplug_memory_range()invocation.check_pfn_span()is made for it specifically.
Quoted 6 lines
Quoted 4 lines
If my understanding is correct,
memremap_pages()is used to add some dev memory to system. This is the use case which Dan want to enable for sub-section. Sincememremap_pages()is not called in mem-hotplug path, this doesn't affect the hotplug range alignment.Yeah, we are on the same page.
We allow sub-section hoy-add only for device memory/hmm. BIOS often align PMEM devices to sub-sections, and not supporting this makes life difficult to support these devices. (You cannot simply cut off something of a disk :) )
System memory can only be hotplugged in memory block granularity, the same granularity onlining/offlining from user space will happen. Boot memory, however, can be sub-section aligned, but can never be offlined (as it contains holes) and therefore never be removed.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
BTW,
__add_pages()share the same logic as__remove_pages(). Why not change it too? Do I miss something or I don't have the latest source code?
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Good question, and I think it need. Just David is refactoring/cleaning up the
remove_pages()code path, this is found out by Segher from patch reviewing.Ah, we may need a following cleanup :-)
Agree. See what David will say. Fold it into this patch, or anyone post a new one.
Yes, I only cleaned up __remove_pages() for now. I can send a similar cleanup for __add_pages().
Will resend this patch, also taking care of __add_pages(). Thanks!
Signature · 3 lines
Thanks, David / dhildenb
Quoted 69 lines · David Hildenbrand
Quoted 56 lines · Baoquan He
Quoted 55 lines · Wei Yang
Quoted 53 lines · Baoquan He
Quoted 26 lines · Wei Yang
Quoted 25 lines · Baoquan He
Quoted 24 lines · Baoquan He
Quoted 22 lines · Wei Yang
Quoted 21 lines · Wei Yang
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>Reviewed-by Wei Yang <[email protected]>BTW, I got one question about hotplug size requirement.
I thought the hotplug range should be section size aligned, while taking a look into current code function
check_hotplug_memory_range()guard the range.Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
A good question. The current code should be block size aligned. I remember in some places we assume each block comprise all the sections. Can't imagine one or some of them are half section filled.
I could be wrong, half filled block may not cause problem.
David must be angry about our flooding the mail list :-)
Believe he won't, :-) If you like, we can talk off line.
Quoted 10 lines
Check the code again, there are two memory range check:
*
check_hotplug_memory_range(), block/section aligned
*check_pfn_span(), subsection alignedThe second check,
check_pfn_span()in__add_pages(), enable the capability to add a memory range with subsection size.This means hotplug still keeps section alignment.
memremap_pages()also calladd_pages(), it doesn't have thecheck_hotplug_memory_range()invocation.check_pfn_span()is made for it specifically.Quoted 6 lines
Quoted 4 lines
If my understanding is correct,
memremap_pages()is used to add some dev memory to system. This is the use case which Dan want to enable for sub-section. Sincememremap_pages()is not called in mem-hotplug path, this doesn't affect the hotplug range alignment.Yeah, we are on the same page.
We allow sub-section hoy-add only for device memory/hmm. BIOS often align PMEM devices to sub-sections, and not supporting this makes life difficult to support these devices. (You cannot simply cut off something of a disk :) )
Quoted 5 lines
System memory can only be hotplugged in memory block granularity, the same granularity onlining/offlining from user space will happen. Boot memory, however, can be sub-section aligned, but can never be offlined (as it contains holes) and therefore never be removed.
This makes life easier.
Thanks for your explanation.
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 6 lines · David Hildenbrand
Let's use a calculation that's easier to understand and calculates the same result. Reusing existing macros makes this look nicer.
We always want to have the number of pages (> 0) to the next section boundary, starting from the current pfn.
Quoted 7 lines
Suggested-by Segher Boessenkool <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Oscar Salvador <[email protected]>Cc Baoquan He <[email protected]>Cc Wei Yang <[email protected]>Signed-off-by David Hildenbrand <[email protected]>
LGTM.
Quoted 21 lines
--- mm/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/memory_hotplug.c +2
-1@@ -528,7 +528,8 @@ void __remove_pages(unsigned long pfn, unsigned long nr_pages,for (; pfn < end_pfn; pfn += cur_nr_pages) {cond_resched ();/* Select all remaining pages up to the next section boundary */ - cur_nr_pages =min (end_pfn - pfn, -(pfn |PAGE_SECTION_MASK )); + cur_nr_pages =min (end_pfn - pfn, +SECTION_ALIGN_UP (pfn +1 ) - pfn);__remove_section (pfn, cur_nr_pages, map_offset, altmap); map_offset =0 ; }Signature · 1 line
2.24.1