Skip to contentSkip to conversation

mm/page_alloc: Modify the comment section for alloc_contig_pages()

PATCH Applied Anshuman Khandual 2 participants 2 messages Dec 15, 2021 – Dec 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/page_alloc: Modify the comment section for alloc_contig_pages()

Just clarify, that the alloc_contig_pages() allocated range will always be aligned to the requested nr_pages.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
index c5952749ad40..0d74ea524dd4 100644
@@ -9214,8 +9214,8 @@ static bool zone_spans_last_pfn(const struct zone *zone,
  * for allocation requests which can not be fulfilled with the buddy allocator.
  *
  * The allocated memory is always aligned to a page boundary. If nr_pages is a
- * power of two then the alignment is guaranteed to be to the given nr_pages
- * (e.g. 1GB request would be aligned to 1GB).
+ * power of two, then allocated range is also guaranteed to be aligned to same
+ * nr_pages (e.g. 1GB request would be aligned to 1GB).
  *
  * Allocated pages can be freed with free_contig_range() or by manually calling
  * __free_page() on each allocated page.
Signature · 1 line
2.20.1
#1 lore raw
Quoted 17 lines · Anshuman Khandual

Just clarify, that the alloc_contig_pages() allocated range will always be aligned to the requested nr_pages.

---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +0 -0
index c5952749ad40..0d74ea524dd4 100644

mm/page_alloc.c static bool zone_spans_last_pfn(const struct zone *zone, · line 9221

Quoted 10 lines
mm/page_alloc.c +2 -2
@@ -9214,8 +9214,8 @@ static bool zone_spans_last_pfn(const struct zone *zone,
  * for allocation requests which can not be fulfilled with the buddy allocator.
  *
  * The allocated memory is always aligned to a page boundary. If nr_pages is a
- * power of two then the alignment is guaranteed to be to the given nr_pages
- * (e.g. 1GB request would be aligned to 1GB).
+ * power of two, then allocated range is also guaranteed to be aligned to same
+ * nr_pages (e.g. 1GB request would be aligned to 1GB).
  *
  * Allocated pages can be freed with free_contig_range() or by manually calling
  * __free_page() on each allocated page.

To me new vs. old express exactly the same. But it might be an improvement so I won't object :)

Signature · 3 lines
Thanks,

David / dhildenb