From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] mm: workingset: eviction buckets for bigmem/lowbit machines
Date: Wed, 27 Jan 2016 17:39:38 +0300 [thread overview]
Message-ID: <20160127143938.GD9623@esperanza> (raw)
In-Reply-To: <1453842006-29265-5-git-send-email-hannes@cmpxchg.org>
On Tue, Jan 26, 2016 at 04:00:05PM -0500, Johannes Weiner wrote:
> For per-cgroup thrash detection, we need to store the memcg ID inside
> the radix tree cookie as well. However, on 32 bit that doesn't leave
> enough bits for the eviction timestamp to cover the necessary range of
> recently evicted pages. The radix tree entry would look like this:
>
> [ RADIX_TREE_EXCEPTIONAL(2) | ZONEID(2) | MEMCGID(16) | EVICTION(12) ]
>
> 12 bits means 4096 pages, means 16M worth of recently evicted pages.
> But refaults are actionable up to distances covering half of memory.
> To not miss refaults, we have to stretch out the range at the cost of
> how precisely we can tell when a page was evicted. This way we can
> shave off lower bits from the eviction timestamp until the necessary
> range is covered. E.g. grouping evictions into 1M buckets (256 pages)
> will stretch the longest representable refault distance to 4G.
>
> This patch implements eviction buckets that are automatically sized
> according to the available bits and the necessary refault range, in
> preparation for per-cgroup thrash detection.
>
> The maximum actionable distance is currently half of memory, but to
> support memory hotplug of up to 200% of boot-time memory, we size the
> buckets to cover double the distance. Beyond that, thrashing won't be
> detectable anymore.
>
> During boot, the kernel will print out the exact parameters, like so:
>
> [ 0.113929] workingset: timestamp_bits=12 max_order=18 bucket_order=6
>
> In this example, there are 12 radix entry bits available for the
> eviction timestamp, to cover a maximum distance of 2^18 pages (this is
> a 1G machine). Consequently, evictions must be grouped into buckets of
> 2^6 pages, or 256K.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
One nit below.
> +/*
> + * Eviction timestamps need to be able to cover the full range of
> + * actionable refaults. However, bits are tight in the radix tree
> + * entry, and after storing the identifier for the lruvec there might
> + * not be enough left to represent every single actionable refault. In
> + * that case, we have to sacrifice granularity for distance, and group
> + * evictions into coarser buckets by shaving off lower timestamp bits.
> + */
> +static unsigned int bucket_order;
__read_mostly?
Thanks,
Vladimir
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] mm: workingset: eviction buckets for bigmem/lowbit machines
Date: Wed, 27 Jan 2016 17:39:38 +0300 [thread overview]
Message-ID: <20160127143938.GD9623@esperanza> (raw)
In-Reply-To: <1453842006-29265-5-git-send-email-hannes@cmpxchg.org>
On Tue, Jan 26, 2016 at 04:00:05PM -0500, Johannes Weiner wrote:
> For per-cgroup thrash detection, we need to store the memcg ID inside
> the radix tree cookie as well. However, on 32 bit that doesn't leave
> enough bits for the eviction timestamp to cover the necessary range of
> recently evicted pages. The radix tree entry would look like this:
>
> [ RADIX_TREE_EXCEPTIONAL(2) | ZONEID(2) | MEMCGID(16) | EVICTION(12) ]
>
> 12 bits means 4096 pages, means 16M worth of recently evicted pages.
> But refaults are actionable up to distances covering half of memory.
> To not miss refaults, we have to stretch out the range at the cost of
> how precisely we can tell when a page was evicted. This way we can
> shave off lower bits from the eviction timestamp until the necessary
> range is covered. E.g. grouping evictions into 1M buckets (256 pages)
> will stretch the longest representable refault distance to 4G.
>
> This patch implements eviction buckets that are automatically sized
> according to the available bits and the necessary refault range, in
> preparation for per-cgroup thrash detection.
>
> The maximum actionable distance is currently half of memory, but to
> support memory hotplug of up to 200% of boot-time memory, we size the
> buckets to cover double the distance. Beyond that, thrashing won't be
> detectable anymore.
>
> During boot, the kernel will print out the exact parameters, like so:
>
> [ 0.113929] workingset: timestamp_bits=12 max_order=18 bucket_order=6
>
> In this example, there are 12 radix entry bits available for the
> eviction timestamp, to cover a maximum distance of 2^18 pages (this is
> a 1G machine). Consequently, evictions must be grouped into buckets of
> 2^6 pages, or 256K.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
One nit below.
> +/*
> + * Eviction timestamps need to be able to cover the full range of
> + * actionable refaults. However, bits are tight in the radix tree
> + * entry, and after storing the identifier for the lruvec there might
> + * not be enough left to represent every single actionable refault. In
> + * that case, we have to sacrifice granularity for distance, and group
> + * evictions into coarser buckets by shaving off lower timestamp bits.
> + */
> +static unsigned int bucket_order;
__read_mostly?
Thanks,
Vladimir
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>, <linux-mm@kvack.org>,
<cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-team@fb.com>
Subject: Re: [PATCH 4/5] mm: workingset: eviction buckets for bigmem/lowbit machines
Date: Wed, 27 Jan 2016 17:39:38 +0300 [thread overview]
Message-ID: <20160127143938.GD9623@esperanza> (raw)
In-Reply-To: <1453842006-29265-5-git-send-email-hannes@cmpxchg.org>
On Tue, Jan 26, 2016 at 04:00:05PM -0500, Johannes Weiner wrote:
> For per-cgroup thrash detection, we need to store the memcg ID inside
> the radix tree cookie as well. However, on 32 bit that doesn't leave
> enough bits for the eviction timestamp to cover the necessary range of
> recently evicted pages. The radix tree entry would look like this:
>
> [ RADIX_TREE_EXCEPTIONAL(2) | ZONEID(2) | MEMCGID(16) | EVICTION(12) ]
>
> 12 bits means 4096 pages, means 16M worth of recently evicted pages.
> But refaults are actionable up to distances covering half of memory.
> To not miss refaults, we have to stretch out the range at the cost of
> how precisely we can tell when a page was evicted. This way we can
> shave off lower bits from the eviction timestamp until the necessary
> range is covered. E.g. grouping evictions into 1M buckets (256 pages)
> will stretch the longest representable refault distance to 4G.
>
> This patch implements eviction buckets that are automatically sized
> according to the available bits and the necessary refault range, in
> preparation for per-cgroup thrash detection.
>
> The maximum actionable distance is currently half of memory, but to
> support memory hotplug of up to 200% of boot-time memory, we size the
> buckets to cover double the distance. Beyond that, thrashing won't be
> detectable anymore.
>
> During boot, the kernel will print out the exact parameters, like so:
>
> [ 0.113929] workingset: timestamp_bits=12 max_order=18 bucket_order=6
>
> In this example, there are 12 radix entry bits available for the
> eviction timestamp, to cover a maximum distance of 2^18 pages (this is
> a 1G machine). Consequently, evictions must be grouped into buckets of
> 2^6 pages, or 256K.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
One nit below.
> +/*
> + * Eviction timestamps need to be able to cover the full range of
> + * actionable refaults. However, bits are tight in the radix tree
> + * entry, and after storing the identifier for the lruvec there might
> + * not be enough left to represent every single actionable refault. In
> + * that case, we have to sacrifice granularity for distance, and group
> + * evictions into coarser buckets by shaving off lower timestamp bits.
> + */
> +static unsigned int bucket_order;
__read_mostly?
Thanks,
Vladimir
next prev parent reply other threads:[~2016-01-27 14:39 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 21:00 [PATCH 0/5] mm: workingset: per-cgroup thrash detection Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
2016-01-26 21:00 ` [PATCH 1/5] mm: memcontrol: generalize locking for the page->mem_cgroup binding Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
[not found] ` <1453842006-29265-2-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-27 14:30 ` Vladimir Davydov
2016-01-27 14:30 ` Vladimir Davydov
2016-01-27 14:30 ` Vladimir Davydov
2016-01-29 16:43 ` Johannes Weiner
2016-01-29 16:43 ` Johannes Weiner
2016-01-26 21:00 ` [PATCH 2/5] mm: workingset: #define radix entry eviction mask Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
[not found] ` <1453842006-29265-3-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-27 14:32 ` Vladimir Davydov
2016-01-27 14:32 ` Vladimir Davydov
2016-01-27 14:32 ` Vladimir Davydov
2016-01-26 21:00 ` [PATCH 3/5] mm: workingset: separate shadow unpacking and refault calculation Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
[not found] ` <1453842006-29265-4-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-27 14:34 ` Vladimir Davydov
2016-01-27 14:34 ` Vladimir Davydov
2016-01-27 14:34 ` Vladimir Davydov
2016-01-26 21:00 ` [PATCH 4/5] mm: workingset: eviction buckets for bigmem/lowbit machines Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
2016-01-27 14:39 ` Vladimir Davydov [this message]
2016-01-27 14:39 ` Vladimir Davydov
2016-01-27 14:39 ` Vladimir Davydov
[not found] ` <1453842006-29265-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-26 21:00 ` [PATCH 5/5] mm: workingset: per-cgroup cache thrash detection Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
2016-01-26 21:00 ` Johannes Weiner
[not found] ` <1453842006-29265-6-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2016-01-27 14:58 ` Vladimir Davydov
2016-01-27 14:58 ` Vladimir Davydov
2016-01-27 14:58 ` Vladimir Davydov
2016-01-29 17:30 ` Johannes Weiner
2016-01-29 17:30 ` Johannes Weiner
2016-01-29 17:30 ` Johannes Weiner
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=20160127143938.GD9623@esperanza \
--to=vdavydov@virtuozzo.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.cz \
/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 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.