Re: [RFC][PATCH 4/7 v2] memcg: use res_counter_uncharge_until in move_parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





+/*
    * A helper function to get mem_cgroup from ID. must be called under
    * rcu_read_lock(). The caller must check css_is_removed() or some if
    * it's concern. (dropping refcnt from swap can be called against removed
@@ -2677,16 +2695,28 @@ static int mem_cgroup_move_parent(struct page *page,
       nr_pages = hpage_nr_pages(page);

       parent = mem_cgroup_from_cont(pcg);
-     ret = __mem_cgroup_try_charge(NULL, gfp_mask, nr_pages,&parent, false);
-     if (ret)
-             goto put_back;
+     if (!parent->use_hierarchy) {
Can we avoid testing for use hierarchy ?
Specially given this might go away.

parent_mem_cgroup() already bundles this information. So maybe we can
test for parent_mem_cgroup(parent) == NULL. It is the same thing after all.
+             ret = __mem_cgroup_try_charge(NULL,
+                                     gfp_mask, nr_pages,&parent, false);
+             if (ret)
+                     goto put_back;
+     }

Why? If we are not hierarchical, we should not charge the parent, right?

This is how it is implemented today and I think he changed that to
move to root on the next patch.

Yeah, I was under the impression that that was the idea, but I might have missed one of the patches

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  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@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]