Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621219 > unrolled thread

Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum

Started byMichal Hocko <mhocko@kernel.org>
First post2017-04-11 14:40 +0200
Last post2017-04-11 14:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum Michal Hocko <mhocko@kernel.org> - 2017-04-11 14:40 +0200

#1621219 — Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum

FromMichal Hocko <mhocko@kernel.org>
Date2017-04-11 14:40 +0200
SubjectRe: [PATCH 2/4] mm: memcontrol: re-use global VM event enum
Message-ID<tv3fs-70f-25@gated-at.bofh.it>
On Mon 10-04-17 10:13:34, Johannes Weiner wrote:
> On Fri, Apr 07, 2017 at 02:47:02PM +0200, Michal Hocko wrote:
> > I do agree that we should share global and memcg specific events constants
> > but I am not sure we want to share all of them. Would it make sense to
> > reorganize the global enum and put those that are shared to the
> > beginning? We wouldn't need the memcg specific translation then.
> 
> I'm not sure I follow. Which translation?

Sorry, I should have said s@translation@filtering@ by memcg1_events*

> > Anyway, two comments on the current implementation.
> > 
> > On Tue 04-04-17 18:01:46, Johannes Weiner wrote:
> > [...]
> > > +/* Cgroup-specific events, on top of universal VM events */
> > > +enum memcg_event_item {
> > > +	MEMCG_LOW = NR_VM_EVENT_ITEMS,
> > > +	MEMCG_HIGH,
> > > +	MEMCG_MAX,
> > > +	MEMCG_OOM,
> > > +	MEMCG_NR_EVENTS,
> > > +};
> > 
> > The above should mention that each supported global VM event should
> > provide the corresponding translation
> > 
> > [...]
> > 
> > here...
> > > +/* Universal VM events cgroup1 shows, original sort order */
> > > +unsigned int memcg1_events[] = {
> > > +	PGPGIN,
> > > +	PGPGOUT,
> > > +	PGFAULT,
> > > +	PGMAJFAULT,
> > > +};
> > > +
> > > +static const char *const memcg1_event_names[] = {
> > > +	"pgpgin",
> > > +	"pgpgout",
> > > +	"pgfault",
> > > +	"pgmajfault",
> > > +};
> > 
> > the naming doesn't make it easier to undestand why we need this.
> > global2memcg_event?
> 
> This is just to keep the file order consistent. It could have been
> done like memory.stat in cgroup2, where we simply do
> 
>    seq_printf(s, "pgmajfault %lu\n", stat[PGMAJFAULT]);
> 
> but I didn't want to change the v1 code too much. So these two arrays
> are just a sorted list of global VM events shown in v1's memory.stat.

You would still have to know which are the relevant parts of the global
starts that we account for memcg.
-- 
Michal Hocko
SUSE Labs

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web