linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Yu Zhao <yuzhao@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, n.borisov.lkml@gmail.com
Subject: Re: [PATCH v2] memcg: refactor mem_cgroup_resize_limit()
Date: Sun, 4 Jun 2017 23:09:42 +0300	[thread overview]
Message-ID: <20170604200942.GA23523@esperanza> (raw)
In-Reply-To: <20170604200437.17815-1-yuzhao@google.com>

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 :-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-06-04 20:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 23:02 [PATCH] " 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 [this message]
2017-06-04 20:31     ` Yu Zhao
2017-06-04 21:00   ` kbuild test robot
2017-06-04 21:12   ` kbuild test robot
2017-06-04 21:18 ` [PATCH v3] " Yu Zhao
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=20170604200942.GA23523@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=n.borisov.lkml@gmail.com \
    --cc=yuzhao@google.com \
    /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