Re: [PATCH v8 1/9] Basic kernel memory functionality for the Memory Controller

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

 



On 12/08/2011 11:21 PM, KAMEZAWA Hiroyuki wrote:
Hm, why you check val != parent->kmem_independent_accounting ?

	if (parent&&  parent->use_hierarchy)
		return -EINVAL;
?

BTW, you didn't check this cgroup has children or not.
I think

	if (this_cgroup->use_hierarchy&&
              !list_empty(this_cgroup->childlen))
		return -EINVAL;

How about this?

        val = !!val;

        /*
         * This follows the same hierarchy restrictions than
         * mem_cgroup_hierarchy_write()
         */
        if (!parent || !parent->use_hierarchy) {
                if (list_empty(&cgroup->children))
                        memcg->kmem_independent_accounting = val;
                else
                        return -EBUSY;
        }
        else
                return -EINVAL;

        return 0;

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