cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
To: Glauber Costa <glommer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-mm <linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	cgroups <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Kamezawa Hiroyuki
	<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
	Glauber Costa <glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v2 0/2] slightly rework memcg cache id determination
Date: Mon, 17 Jun 2013 15:30:49 +0200	[thread overview]
Message-ID: <20130617133049.GC5018@dhcp22.suse.cz> (raw)
In-Reply-To: <1371233076-936-1-git-send-email-glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>

On Fri 14-06-13 14:04:34, Glauber Costa wrote:
> Michal,
> 
> Let me know if this is more acceptable to you. I didn't take your suggestion of
> having an id and idx functions, because I think this could potentially be even
> more confusing: in the sense that people would need to wonder a bit what is the
> difference between them.

Any clean up is better than nothing. I still think that split up and
making the 2 functions explicit would be better but I do not think this
is really that important. 

> Note please that we never use the id as an array index outside of memcg core.

Now but that doesn't prevent future abuse.

> So for memcg core, I have changed, in Patch 2, each direct use of idx as an
> index to include a VM_BUG_ON in case we would get an invalid index.

OK. If you had an _idx variant then you wouldn't need to add that
VM_BUG_ON at every single place where you use it as an index and do not
risk that future calls would forget about VM_BUG_ON.

> For the other cases, I have consolidated a bit the usage pattern around
> memcg_cache_id.  Now the tests are all pretty standardized.

OK, Great!
 
> Glauber Costa (2):
>   memcg: make cache index determination more robust
>   memcg: consolidate callers of memcg_cache_id
> 
>  mm/memcontrol.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> -- 
> 1.8.1.4
> 

-- 
Michal Hocko
SUSE Labs

  parent reply	other threads:[~2013-06-17 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 18:04 [PATCH v2 0/2] slightly rework memcg cache id determination Glauber Costa
     [not found] ` <1371233076-936-1-git-send-email-glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2013-06-14 18:04   ` [PATCH v2 1/2] memcg: make cache index determination more robust Glauber Costa
2013-06-17 13:30   ` Michal Hocko [this message]
2013-06-17 23:13     ` [PATCH v2 0/2] slightly rework memcg cache id determination Glauber Costa
2013-06-14 18:04 ` [PATCH v2 2/2] memcg: consolidate callers of memcg_cache_id Glauber Costa

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=20130617133049.GC5018@dhcp22.suse.cz \
    --to=mhocko-alswssmvlrq@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
    --cc=glommer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@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;
as well as URLs for NNTP newsgroup(s).