Skip to contentSkip to conversation

mm/migrate.c: clean up comment

PATCH Superseded Figo.zhang 2 participants 2 messages May 6, 2011 – May 9, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Figo.zhang

author
#0 lore raw

PATCH 1/1 mm/migrate.c: clean up comment

clean up comment. prepare cgroup return 0 or -ENOMEN, others return -EAGAIN. avoid conflict meanings.

---
mm/migrate.c | 3 +--

 1 files changed, 1 insertions(+), 2 deletions(-)
mm/migrate.c +1 -2
index 34132f8..d65b351 100644
@@ -647,7 +647,6 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 		if (unlikely(split_huge_page(page)))
 			goto move_newpage;
 
-	/* prepare cgroup just returns 0 or -ENOMEM */
 	rc = -EAGAIN;
 
 	if (!trylock_page(page)) {
@@ -687,7 +686,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 		goto unlock;
 	}
 
-	/* charge against new page */
+	/* charge against new page, return 0 or -ENOMEM */
 	charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
 	if (charge == -ENOMEM) {
 		rc = -ENOMEM;
maintainer
#1 lore raw
Quoted 22 lines · On Sat, 07 May 2011 00:03:11 +0800 "Figo.zhang" <[email protected]> wrote:

clean up comment. prepare cgroup return 0 or -ENOMEN, others return -EAGAIN. avoid conflict meanings.

---
mm/migrate.c | 3 +--

 1 files changed, 1 insertions(+), 2 deletions(-)
mm/migrate.c +0 -1
index 34132f8..d65b351 100644
@@ -647,7 +647,6 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 		if (unlikely(split_huge_page(page)))
 			goto move_newpage;
 
-	/* prepare cgroup just returns 0 or -ENOMEM */
 	rc = -EAGAIN;
 
 	if (!trylock_page(page)) {

mm/migrate.c static int unmap_and_move(new_page_t get_new_page, unsigned long private, · line 692

Quoted 8 lines
mm/migrate.c +1 -1
@@ -687,7 +686,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 		goto unlock;
 	}
 
-	/* charge against new page */
+	/* charge against new page, return 0 or -ENOMEM */
 	charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
 	if (charge == -ENOMEM) {
 		rc = -ENOMEM;

Well it's still pretty confusing - the function can also return -EAGAIN and -EBUSY, at least.

It would be better to remove this random sprinkle of commentlets and to properly document unmap_and_move()'s interface in the usual fashion, in its leading comment block.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>