From: Yu Zhao <yuzhao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
To: Vladimir Davydov <vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
n.borisov.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v2] memcg: refactor mem_cgroup_resize_limit()
Date: Sun, 4 Jun 2017 13:31:16 -0700 [thread overview]
Message-ID: <20170604203116.GA19053@google.com> (raw)
In-Reply-To: <20170604200942.GA23523@esperanza>
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.
next prev parent reply other threads:[~2017-06-04 20:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 23:02 [PATCH] memcg: refactor mem_cgroup_resize_limit() Yu Zhao
2017-06-02 7:32 ` Nikolay Borisov
2017-06-04 19:44 ` Yu Zhao
2017-06-03 15:15 ` Vladimir Davydov
2017-06-04 20:04 ` [PATCH v2] " Yu Zhao
2017-06-04 20:09 ` Vladimir Davydov
2017-06-04 20:31 ` Yu Zhao [this message]
2017-06-04 21:00 ` kbuild test robot
[not found] ` <20170604200437.17815-1-yuzhao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-06-04 21:12 ` kbuild test robot
[not found] ` <20170601230212.30578-1-yuzhao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-06-04 21:18 ` [PATCH v3] " Yu Zhao
[not found] ` <20170604211807.32685-1-yuzhao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-06-13 11:35 ` Michal Hocko
2017-06-14 21:20 ` [PATCH v4] " Yu Zhao
2018-01-08 22:42 ` Yu Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170604203116.GA19053@google.com \
--to=yuzhao-hpiqsd4aklfqt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=n.borisov.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox