lkml.org 
[lkml]   [2017]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] memcg: refactor mem_cgroup_resize_limit()
On Sun, Jun 04, 2017 at 01:04:37PM -0700, Yu Zhao wrote:
> @@ -2498,22 +2449,24 @@ static int mem_cgroup_resize_memsw_limit(struct mem_cgroup *memcg,
> }
>
> mutex_lock(&memcg_limit_mutex);
> - if (limit < memcg->memory.limit) {
> + inverted = memsw ? limit < memcg->memory.limit :
> + limit > memcg->memsw.limit;
> + if (inverted)
> mutex_unlock(&memcg_limit_mutex);
> ret = -EINVAL;
> break;
> }

For some reason, I liked this patch more without this extra variable :-)

\
 
 \ /
  Last update: 2017-06-05 00:19    [W:0.168 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site