Skip to contentSkip to conversation

Fix some wrong comments.

PATCH In review Tang Chen 3 participants 10 messages Jun 20, 2013 – Aug 20, 2013

Subsystems (6)
lore
Share & tools
lore

Tang Chen

author
#0 lore raw

cover Fix some wrong comments.

Fix some wrong comments found when reading code.

Tang Chen (5):
page_isolation: Fix a comment typo in test_pages_isolated()
page_migrate: Fix wrong comment in

    address_space_operations->migratepage()

aio: Fix wrong comment in aio_complete()
memblock: Fix wrong comment in __next_free_mem_range() bootmem, numa: Fix a comment typo in
register_page_bootmem_info_node()

 fs/aio.c            |    2 +-
 include/linux/fs.h  |    4 ++--
 mm/memblock.c       |    2 +-
 mm/memory_hotplug.c |    4 ++--
 mm/page_isolation.c |    8 ++++----
 5 files changed, 10 insertions(+), 10 deletions(-)
author
#1 lore raw

PATCH 1/5 page_isolation: Fix a comment typo in test_pages_isolated()

pageblock_nr_page should be pageblock_nr_pages, and fist is a typo of first.

---
 mm/page_isolation.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
mm/page_isolation.c +4 -4
index 383bdbb..0cee10f 100644
@@ -226,9 +226,9 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
 	int ret;
 
 	/*
-	 * Note: pageblock_nr_page != MAX_ORDER. Then, chunks of free page
-	 * is not aligned to pageblock_nr_pages.
-	 * Then we just check pagetype fist.
+	 * Note: pageblock_nr_pages != MAX_ORDER. Then, chunks of free pages
+	 * are not aligned to pageblock_nr_pages.
+	 * Then we just check migratetype first.
 	 */
 	for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
 		page = __first_valid_page(pfn, pageblock_nr_pages);
@@ -238,7 +238,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
 	page = __first_valid_page(start_pfn, end_pfn - start_pfn);
 	if ((pfn < end_pfn) || !page)
 		return -EBUSY;
-	/* Check all pages are free or Marked as ISOLATED */
+	/* Check all pages are free or marked as ISOLATED */
 	zone = page_zone(page);
 	spin_lock_irqsave(&zone->lock, flags);
 	ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/5] page_isolation: Fix a comment typo in test_pages_isolated()

Quoted 13 lines · Tang Chen

pageblock_nr_page should be pageblock_nr_pages, and fist is a typo of first.

---
 mm/page_isolation.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
mm/page_isolation.c +0 -0
index 383bdbb..0cee10f 100644

mm/page_isolation.c int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn, · line 229

Quoted 7 lines
mm/page_isolation.c +1 -3
@@ -226,9 +226,9 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
 	int ret;
 
 	/*
-	 * Note: pageblock_nr_page != MAX_ORDER. Then, chunks of free page
-	 * is not aligned to pageblock_nr_pages.
-	 * Then we just check pagetype fist.
+	 * Note: pageblock_nr_pages != MAX_ORDER. Then, chunks of free pages

pageblock_nr_pages is the count of pages while MAX_ORDER is a order. Here may be pageblock_order != MAX_ORDER.

Quoted 14 lines
mm/page_isolation.c +3 -1
+	 * are not aligned to pageblock_nr_pages.
+	 * Then we just check migratetype first.
 	 */
 	for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
 		page = __first_valid_page(pfn, pageblock_nr_pages);
@@ -238,7 +238,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
 	page = __first_valid_page(start_pfn, end_pfn - start_pfn);
 	if ((pfn < end_pfn) || !page)
 		return -EBUSY;
-	/* Check all pages are free or Marked as ISOLATED */
+	/* Check all pages are free or marked as ISOLATED */
 	zone = page_zone(page);
 	spin_lock_irqsave(&zone->lock, flags);
 	ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
Signature · 2 lines
Thanks.
Zhang Yanfei
author
#3 lore raw

Re: [PATCH 1/5] page_isolation: Fix a comment typo in test_pages_isolated()

Quoted 16 lines · Zhang Yanfei
Quoted 15 lines · Tang Chen

pageblock_nr_page should be pageblock_nr_pages, and fist is a typo of first.

---
  mm/page_isolation.c |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)
mm/page_isolation.c +0 -0
index 383bdbb..0cee10f 100644
@@ -226,9 +226,9 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
  	int ret;
 
Quoted 8 lines

mm/page_isolation.c int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn, · line 229

Quoted 5 lines
mm/page_isolation.c +1 -3
  	/*
-	 * Note: pageblock_nr_page != MAX_ORDER. Then, chunks of free page
-	 * is not aligned to pageblock_nr_pages.
-	 * Then we just check pagetype fist.
+	 * Note: pageblock_nr_pages != MAX_ORDER. Then, chunks of free pages

pageblock_nr_pages is the count of pages while MAX_ORDER is a order. Here may be pageblock_order != MAX_ORDER.

Hum, yes. Since we have:

	#define pageblock_nr_pages      (1UL << pageblock_order)

it should be pageblock_order.

Quoted 17 lines
Quoted 15 lines
mm/page_isolation.c +3 -1
+	 * are not aligned to pageblock_nr_pages.
+	 * Then we just check migratetype first.
  	 */
  	for (pfn = start_pfn; pfn<  end_pfn; pfn += pageblock_nr_pages) {
  		page = __first_valid_page(pfn, pageblock_nr_pages);
@@ -238,7 +238,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
  	page = __first_valid_page(start_pfn, end_pfn - start_pfn);
  	if ((pfn<  end_pfn) || !page)
  		return -EBUSY;
-	/* Check all pages are free or Marked as ISOLATED */
+	/* Check all pages are free or marked as ISOLATED */
  	zone = page_zone(page);
  	spin_lock_irqsave(&zone->lock, flags);
  	ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
author
#4 lore raw

PATCH 2/5 page_migrate: Fix wrong comment in address_space_operations->migratepage()

In reply to Tang Chen

There is no parameter "sync" in address_space_operations->migratepage(). It should be mograte_mode. And the comment is for MIGRATE_ASYNC.

---
 include/linux/fs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/fs.h +2 -2
index 43db02e..c1a76ac 100644
@@ -372,8 +372,8 @@ struct address_space_operations {
 	int (*get_xip_mem)(struct address_space *, pgoff_t, int,
 						void **, unsigned long *);
 	/*
-	 * migrate the contents of a page to the specified target. If sync
-	 * is false, it must not block.
+	 * migrate the contents of a page to the specified target. If
+	 * migrate_mode is MIGRATE_ASYNC, it must not block.
 	 */
 	int (*migratepage) (struct address_space *,
 			struct page *, struct page *, enum migrate_mode);
Signature · 1 line
1.7.1
#5 lore raw

Re: [PATCH 2/5] page_migrate: Fix wrong comment in address_space_operations->migratepage()

Quoted 2 lines · Tang Chen

There is no parameter "sync" in address_space_operations->migratepage(). It should be mograte_mode. And the comment is for MIGRATE_ASYNC.

I am fixing this typo in changelog :) and applying the series.

Quoted 24 lines
---
 include/linux/fs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/fs.h +2 -2
index 43db02e..c1a76ac 100644
@@ -372,8 +372,8 @@ struct address_space_operations {
 	int (*get_xip_mem)(struct address_space *, pgoff_t, int,
 						void **, unsigned long *);
 	/*
-	 * migrate the contents of a page to the specified target. If sync
-	 * is false, it must not block.
+	 * migrate the contents of a page to the specified target. If
+	 * migrate_mode is MIGRATE_ASYNC, it must not block.
 	 */
 	int (*migratepage) (struct address_space *,
 			struct page *, struct page *, enum migrate_mode);
Signature · 1 line
1.7.1
Signature · 2 lines
Jiri Kosina
SUSE Labs
author
#6 lore raw

Re: [PATCH 2/5] page_migrate: Fix wrong comment in address_space_operations->migratepage()

Quoted 6 lines · Jiri Kosina
Quoted 2 lines · Tang Chen

There is no parameter "sync" in address_space_operations->migratepage(). It should be mograte_mode. And the comment is for MIGRATE_ASYNC.

I am fixing this typo in changelog :) and applying the series.

Hi Jiri,

Thanks a lot. :)

Quoted 26 lines
Quoted 25 lines
---
  include/linux/fs.h |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/fs.h +2 -3
index 43db02e..c1a76ac 100644
@@ -372,8 +372,8 @@ struct address_space_operations {
  	int (*get_xip_mem)(struct address_space *, pgoff_t, int,
  						void **, unsigned long *);
  	/*
-	 * migrate the contents of a page to the specified target. If sync
-	 * is false, it must not block.
+	 * migrate the contents of a page to the specified target. If
+	 * migrate_mode is MIGRATE_ASYNC, it must not block.
  	 */
  	int (*migratepage) (struct address_space *,
  			struct page *, struct page *, enum migrate_mode);
--

1.7.1

author
#7 lore raw

PATCH 3/5 aio: Fix wrong comment in aio_complete()

In reply to Tang Chen

ctx->ctx_lock should be ctx->completion_lock.

---
 fs/aio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/aio.c +1 -1
index 2bbcacf..e4a01fa 100644
@@ -623,7 +623,7 @@ void aio_complete(struct kiocb *iocb, long res, long res2)
 
 	/*
 	 * Add a completion event to the ring buffer. Must be done holding
-	 * ctx->ctx_lock to prevent other code from messing with the tail
+	 * ctx->completion_lock to prevent other code from messing with the tail
 	 * pointer since we might be called from irq context.
 	 */
 	spin_lock_irqsave(&ctx->completion_lock, flags);
Signature · 1 line
1.7.1
author
#8 lore raw

PATCH 4/5 memblock: Fix wrong comment in __next_free_mem_range()

In reply to Tang Chen

Remove one redundant "nid" in the comment.

---
 mm/memblock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memblock.c +1 -1
index c5fad93..a847bfe 100644
@@ -566,7 +566,7 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 /**
  * __next_free_mem_range - next function for for_each_free_mem_range()
  * @idx: pointer to u64 loop variable
- * @nid: nid: node selector, %MAX_NUMNODES for all nodes
+ * @nid: node selector, %MAX_NUMNODES for all nodes
  * @out_start: ptr to phys_addr_t for start address of the range, can be %NULL
  * @out_end: ptr to phys_addr_t for end address of the range, can be %NULL
  * @out_nid: ptr to int for nid of the range, can be %NULL
Signature · 1 line
1.7.1
author
#9 lore raw

PATCH 5/5 bootmem, numa: Fix a comment typo in register_page_bootmem_info_node()

In reply to Tang Chen
---
 mm/memory_hotplug.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/memory_hotplug.c +2 -2
index 1ad92b4..12ee2a0 100644
@@ -220,13 +220,13 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
 	pfn = pgdat->node_start_pfn;
 	end_pfn = pgdat_end_pfn(pgdat);
 
-	/* register_section info */
+	/* register section info */
 	for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
 		/*
 		 * Some platforms can assign the same pfn to multiple nodes - on
 		 * node0 as well as nodeN.  To avoid registering a pfn against
 		 * multiple nodes we check that this pfn does not already
-		 * reside in some other node.
+		 * reside in some other nodes.
 		 */
 		if (pfn_valid(pfn) && (pfn_to_nid(pfn) == node))
 			register_page_bootmem_info_section(pfn);
Signature · 1 line
1.7.1