All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum
Date: Thu, 6 Apr 2017 11:49:24 +0300	[thread overview]
Message-ID: <20170406084923.GB2268@esperanza> (raw)
In-Reply-To: <20170404220148.28338-2-hannes@cmpxchg.org>

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.

WARNING: multiple messages have this Message-ID
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum
Date: Thu, 6 Apr 2017 11:49:24 +0300	[thread overview]
Message-ID: <20170406084923.GB2268@esperanza> (raw)
In-Reply-To: <20170404220148.28338-2-hannes@cmpxchg.org>

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.

--
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-04-06  8:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 22:01 [PATCH 1/4] mm: memcontrol: clean up memory.events counting function Johannes Weiner
2017-04-04 22:01 ` Johannes Weiner
2017-04-04 22:01 ` [PATCH 2/4] mm: memcontrol: re-use global VM event enum Johannes Weiner
2017-04-04 22:01   ` Johannes Weiner
2017-04-06  8:49   ` Vladimir Davydov [this message]
2017-04-06  8:49     ` Vladimir Davydov
2017-04-10 14:17     ` Johannes Weiner
2017-04-10 14:17       ` Johannes Weiner
2017-04-07 12:47   ` Michal Hocko
2017-04-07 12:47     ` Michal Hocko
2017-04-10 14:13     ` Johannes Weiner
2017-04-10 14:13       ` Johannes Weiner
2017-04-11 12:30       ` Michal Hocko
2017-04-11 12:30         ` Michal Hocko
2017-04-04 22:01 ` [PATCH 3/4] mm: memcontrol: re-use node VM page state enum Johannes Weiner
2017-04-04 22:01   ` Johannes Weiner
2017-04-06  8:59   ` Vladimir Davydov
2017-04-06  8:59     ` Vladimir Davydov
2017-04-04 22:01 ` [PATCH 4/4] mm: memcontrol: use node page state naming scheme for memcg Johannes Weiner
2017-04-04 22:01   ` Johannes Weiner
2017-04-06  9:01   ` Vladimir Davydov
2017-04-06  9:01     ` Vladimir Davydov
2017-04-07 12:54   ` Michal Hocko
2017-04-07 12:54     ` Michal Hocko
2017-04-06  8:31 ` [PATCH 1/4] mm: memcontrol: clean up memory.events counting function Vladimir Davydov
2017-04-06  8:31   ` Vladimir Davydov
2017-04-07 12:20 ` Michal Hocko
2017-04-07 12:20   ` Michal Hocko

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=20170406084923.GB2268@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --subject='Re: [PATCH 2/4] mm: memcontrol: re-use global VM event enum' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.