Thread (7 messages) 7 messages, 4 authors, 2011-02-28

Re: [PATCH] memcg: clean up migration

From: Daisuke Nishimura <hidden>
Date: 2011-02-28 02:45:58
Also in: lkml

quoted
quoted
@@ -678,13 +675,11 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
A  A  A  }

A  A  A  /* charge against new page */
- A  A  charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
- A  A  if (charge == -ENOMEM) {
- A  A  A  A  A  A  rc = -ENOMEM;
+ A  A  rc = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
+ A  A  if (rc)
A  A  A  A  A  A  A  goto unlock;
- A  A  }
- A  A  BUG_ON(charge);

+ A  A  rc = -EAGAIN;
A  A  A  if (PageWriteback(page)) {
A  A  A  A  A  A  A  if (!force || !sync)
A  A  A  A  A  A  A  A  A  A  A  goto uncharge;
How about

A  A  A  A if (mem_cgroup_prepare_migration(..)) {
A  A  A  A  A  A  A  A rc = -ENOMEM;
A  A  A  A  A  A  A  A goto unlock;
A  A  A  A }

?

Re-setting "rc" to -EAGAIN is not necessary in this case.
"if (mem_cgroup_...)" is commonly used in many places.
It works now but Johannes doesn't like it and me, either.
It makes unnecessary dependency which mem_cgroup_preparre_migration
can't propagate error to migrate_pages.
Although we don't need it, I want to remove such unnecessary dependency.
I see.
Thank you for your explanation.

Daisuke Nishimura.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help