Re: [PATCH] memcg: convert threshold to bytes

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

 



On Mon, 5 Oct 2015 14:44:22 -0700 Shaohua Li <shli@xxxxxx> wrote:

> The page_counter_memparse() returns pages for the threshold, while
> mem_cgroup_usage() returns bytes for memory usage. Convert the threshold
> to bytes.
> 
> Looks a regression introduced by 3e32cb2e0a12b69150

That was two years ago.  Why hasn't anyone noticed before now?

> ...
>
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3387,6 +3387,7 @@ static int __mem_cgroup_usage_register_event(struct mem_cgroup *memcg,
>  	ret = page_counter_memparse(args, "-1", &threshold);
>  	if (ret)
>  		return ret;
> +	threshold <<= PAGE_SHIFT;
>  
>  	mutex_lock(&memcg->thresholds_lock);

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