Re: [PATCH] memcg: reduce the size of struct memcg 244-fold.

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

 



>>  	struct mem_cgroup *memcg;
>> -	int size = sizeof(struct mem_cgroup);
>> +	int size = memcg_size();
>>  
>> -	/* Can be very big if MAX_NUMNODES is very big */
>> +	/* Can be very big if nr_node_ids is very big */
>>  	if (size < PAGE_SIZE)
>>  		memcg = kzalloc(size, GFP_KERNEL);
>>  	else
>> @@ -5933,7 +5943,7 @@ out_free:
>>  static void __mem_cgroup_free(struct mem_cgroup *memcg)
>>  {
>>  	int node;
>> -	int size = sizeof(struct mem_cgroup);
>> +	int size = memcg_size();
>>  
>>  	mem_cgroup_remove_from_trees(memcg);
>>  	free_css_id(&mem_cgroup_subsys, &memcg->css);
> 
> Really everything here should be using size_t - a minor
> cosmetic/readability thing.
> 
I agree

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