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


Groups > linux.kernel > #1617604

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

From Vladimir Davydov <vdavydov.dev@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum
Date 2017-04-06 10:50 +0200
Message-ID <ttbh8-6aP-11@gated-at.bofh.it> (permalink)
References <tsEOd-2oP-7@gated-at.bofh.it> <tsEOe-2oP-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 04, 2017 at 06:01:46PM -0400, Johannes Weiner wrote:
> The current duplication is a high-maintenance mess, and it's painful
> to add new items.
> 
> This increases the size of the event array, but we'll eventually want
> most of the VM events tracked on a per-cgroup basis anyway.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>

Although the increase in the mem_cgroup struct introduced by this patch
looks scary, I agree this is a reasonable step toward unification of
vmstat, as most vm_even_item entries do make sense to be accounted per
cgroup as well.

Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>

> @@ -608,9 +601,9 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg,
>  
>  	/* pagein of a big page is an event. So, ignore page size */
>  	if (nr_pages > 0)
> -		__this_cpu_inc(memcg->stat->events[MEM_CGROUP_EVENTS_PGPGIN]);
> +		__this_cpu_inc(memcg->stat->events[PGPGIN]);
>  	else {
> -		__this_cpu_inc(memcg->stat->events[MEM_CGROUP_EVENTS_PGPGOUT]);
> +		__this_cpu_inc(memcg->stat->events[PGPGOUT]);
>  		nr_pages = -nr_pages; /* for event */
>  	}

AFAIR this doesn't exactly match system-wide PGPGIN/PGPGOUT: they are
supposed to account only paging events involving IO while currently they
include faulting in zero pages and zapping a process address space.
Probably, this should be revised before rolling out to cgroup v2.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] mm: memcontrol: clean up memory.events counting function Johannes Weiner <hannes@cmpxchg.org> - 2017-04-05 00:10 +0200
  [PATCH 4/4] mm: memcontrol: use node page state naming scheme for memcg Johannes Weiner <hannes@cmpxchg.org> - 2017-04-05 00:10 +0200
    Re: [PATCH 4/4] mm: memcontrol: use node page state naming scheme  for memcg Vladimir Davydov <vdavydov.dev@gmail.com> - 2017-04-06 11:10 +0200
    Re: [PATCH 4/4] mm: memcontrol: use node page state naming scheme  for memcg Michal Hocko <mhocko@kernel.org> - 2017-04-07 15:00 +0200
  [PATCH 2/4] mm: memcontrol: re-use global VM event enum Johannes Weiner <hannes@cmpxchg.org> - 2017-04-05 00:10 +0200
    Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum Vladimir Davydov <vdavydov.dev@gmail.com> - 2017-04-06 10:50 +0200
      Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum Johannes Weiner <hannes@cmpxchg.org> - 2017-04-10 16:20 +0200
    Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum Michal Hocko <mhocko@kernel.org> - 2017-04-07 14:50 +0200
      Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum Johannes Weiner <hannes@cmpxchg.org> - 2017-04-10 16:20 +0200
  Re: [PATCH 1/4] mm: memcontrol: clean up memory.events counting  function Vladimir Davydov <vdavydov.dev@gmail.com> - 2017-04-06 10:40 +0200
  Re: [PATCH 1/4] mm: memcontrol: clean up memory.events counting  function Michal Hocko <mhocko@kernel.org> - 2017-04-07 14:30 +0200

csiph-web