lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170604203116.GA19053@google.com>
Date:   Sun, 4 Jun 2017 13:31:16 -0700
From:   Yu Zhao <yuzhao@...gle.com>
To:     Vladimir Davydov <vdavydov.dev@...il.com>
Cc:     Johannes Weiner <hannes@...xchg.org>,
        Michal Hocko <mhocko@...nel.org>, cgroups@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        n.borisov.lkml@...il.com
Subject: Re: [PATCH v2] memcg: refactor mem_cgroup_resize_limit()

On Sun, Jun 04, 2017 at 11:09:42PM +0300, Vladimir Davydov wrote:
> 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 :-)
Well, I'll refrain myself from commenting more because we are now at
the risk of starting a coding style war over this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ