2013-06-20 10:07:25

by Tang Chen

[permalink] [raw]
Subject: [PATCH 0/5] 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(-)


2013-06-20 10:07:27

by Tang Chen

[permalink] [raw]
Subject: [PATCH 3/5] aio: Fix wrong comment in aio_complete()

ctx->ctx_lock should be ctx->completion_lock.

Signed-off-by: Tang Chen <[email protected]>
---
fs/aio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 2bbcacf..e4a01fa 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -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);
--
1.7.1

2013-06-20 10:07:39

by Tang Chen

[permalink] [raw]
Subject: [PATCH 5/5] bootmem, numa: Fix a comment typo in register_page_bootmem_info_node()

Signed-off-by: Tang Chen <[email protected]>
---
mm/memory_hotplug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 1ad92b4..12ee2a0 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -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);
--
1.7.1

2013-06-20 10:07:52

by Tang Chen

[permalink] [raw]
Subject: [PATCH 4/5] memblock: Fix wrong comment in __next_free_mem_range()

Remove one redundant "nid" in the comment.

Signed-off-by: Tang Chen <[email protected]>
---
mm/memblock.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index c5fad93..a847bfe 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -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
--
1.7.1

2013-06-20 10:08:09

by Tang Chen

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

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

Signed-off-by: Tang Chen <[email protected]>
---
include/linux/fs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 43db02e..c1a76ac 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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

2013-06-20 10:08:31

by Tang Chen

[permalink] [raw]
Subject: [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.

Signed-off-by: Tang Chen <[email protected]>
---
mm/page_isolation.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 383bdbb..0cee10f 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -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,
--
1.7.1

2013-06-20 13:18:06

by Zhang Yanfei

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

On 06/20/2013 06:10 PM, Tang Chen wrote:
> pageblock_nr_page should be pageblock_nr_pages, and fist is
> a typo of first.
>
> Signed-off-by: Tang Chen <[email protected]>
> ---
> mm/page_isolation.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index 383bdbb..0cee10f 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -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.

> + * 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,


--
Thanks.
Zhang Yanfei

2013-06-21 01:09:52

by Tang Chen

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

On 06/20/2013 09:17 PM, Zhang Yanfei wrote:
> On 06/20/2013 06:10 PM, Tang Chen wrote:
>> pageblock_nr_page should be pageblock_nr_pages, and fist is
>> a typo of first.
>>
>> Signed-off-by: Tang Chen<[email protected]>
>> ---
>> mm/page_isolation.c | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
>> index 383bdbb..0cee10f 100644
>> --- a/mm/page_isolation.c
>> +++ b/mm/page_isolation.c
>> @@ -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.

Hum, yes. Since we have:
#define pageblock_nr_pages (1UL << pageblock_order)

it should be pageblock_order.
>
>> + * 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,
>
>

2013-08-20 11:02:54

by Jiri Kosina

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

On Thu, 20 Jun 2013, Tang Chen wrote:

> 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.

>
> Signed-off-by: Tang Chen <[email protected]>
> ---
> include/linux/fs.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 43db02e..c1a76ac 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -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
>

--
Jiri Kosina
SUSE Labs

2013-08-20 11:06:49

by Tang Chen

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

On 08/20/2013 07:02 PM, Jiri Kosina wrote:
> On Thu, 20 Jun 2013, Tang Chen wrote:
>
>> 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. :)

>
>>
>> Signed-off-by: Tang Chen<[email protected]>
>> ---
>> include/linux/fs.h | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/fs.h b/include/linux/fs.h
>> index 43db02e..c1a76ac 100644
>> --- a/include/linux/fs.h
>> +++ b/include/linux/fs.h
>> @@ -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
>>
>