Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-11 Thread Michal Hocko
On Mon 09-11-15 21:28:40, Vladimir Davydov wrote: > On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: [...] > > > Vladimir Davydov (5): > > > Revert "kernfs: do not account ino_ida allocations to memcg" > > > Revert "gfp: add __GFP_NOACCOUNT" > > > > The patch ordering would break

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-11 Thread Michal Hocko
On Mon 09-11-15 21:28:40, Vladimir Davydov wrote: > On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: [...] > > > Vladimir Davydov (5): > > > Revert "kernfs: do not account ino_ida allocations to memcg" > > > Revert "gfp: add __GFP_NOACCOUNT" > > > > The patch ordering would break

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 03:30:53PM -0500, Tejun Heo wrote: ... > Hmm can't we simply merge among !SLAB_ACCOUNT and SLAB_ACCOUNT > kmem_caches within themselves? I don't think we'd be losing anything > by restricting merge at that level. For anything to be tagged > SLAB_ACCOUNT, it has to

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladimir. On Mon, Nov 09, 2015 at 11:12:18PM +0300, Vladimir Davydov wrote: > Because we won't be able to distinguish kmem_cache_alloc calls that > should be accounted from those that shouldn't. The problem is if two > caches > > A = kmem_cache_create(...) > > and > > B =

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 02:32:53PM -0500, Tejun Heo wrote: > On Mon, Nov 09, 2015 at 10:27:47PM +0300, Vladimir Davydov wrote: > > Of course, we could rework slab merging so that kmem_cache_create > > returned a new dummy cache even if it was actually merged. Such a cache > > would point to the

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladmir. On Mon, Nov 09, 2015 at 10:27:47PM +0300, Vladimir Davydov wrote: > Of course, we could rework slab merging so that kmem_cache_create > returned a new dummy cache even if it was actually merged. Such a cache > would point to the real cache, which would be used for allocations.

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 01:54:01PM -0500, Tejun Heo wrote: > On Mon, Nov 09, 2015 at 09:28:40PM +0300, Vladimir Davydov wrote: > > > I am _all_ for this semantic I am just not sure what to do with the > > > legacy kmem controller. Can we change its semantic? If we cannot do that > > > > I think

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladmir. On Mon, Nov 09, 2015 at 09:28:40PM +0300, Vladimir Davydov wrote: > > I am _all_ for this semantic I am just not sure what to do with the > > legacy kmem controller. Can we change its semantic? If we cannot do that > > I think we can. If somebody reports a "bug" caused by this

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: ... > > Therefore this patch switches to the white list policy. Now kmalloc > > users have to explicitly opt in by passing __GFP_ACCOUNT flag. > > > > Currently, the list of accounted objects is quite limited and only > > includes

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Johannes Weiner
On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: > I am _all_ for this semantic I am just not sure what to do with the > legacy kmem controller. Can we change its semantic? If we cannot do that > we would have to distinguish legacy and unified hierarchies during > runtime and add the

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Michal Hocko
On Sat 07-11-15 23:07:04, Vladimir Davydov wrote: > Hi, > > Currently, all kmem allocations (namely every kmem_cache_alloc, kmalloc, > alloc_kmem_pages call) are accounted to memory cgroup automatically. > Callers have to explicitly opt out if they don't want/need accounting > for some reason.

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Michal Hocko
On Sat 07-11-15 23:07:04, Vladimir Davydov wrote: > Hi, > > Currently, all kmem allocations (namely every kmem_cache_alloc, kmalloc, > alloc_kmem_pages call) are accounted to memory cgroup automatically. > Callers have to explicitly opt out if they don't want/need accounting > for some reason.

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladmir. On Mon, Nov 09, 2015 at 09:28:40PM +0300, Vladimir Davydov wrote: > > I am _all_ for this semantic I am just not sure what to do with the > > legacy kmem controller. Can we change its semantic? If we cannot do that > > I think we can. If somebody reports a "bug" caused by this

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: ... > > Therefore this patch switches to the white list policy. Now kmalloc > > users have to explicitly opt in by passing __GFP_ACCOUNT flag. > > > > Currently, the list of accounted objects is quite limited and only > > includes

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Johannes Weiner
On Mon, Nov 09, 2015 at 03:08:32PM +0100, Michal Hocko wrote: > I am _all_ for this semantic I am just not sure what to do with the > legacy kmem controller. Can we change its semantic? If we cannot do that > we would have to distinguish legacy and unified hierarchies during > runtime and add the

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 02:32:53PM -0500, Tejun Heo wrote: > On Mon, Nov 09, 2015 at 10:27:47PM +0300, Vladimir Davydov wrote: > > Of course, we could rework slab merging so that kmem_cache_create > > returned a new dummy cache even if it was actually merged. Such a cache > > would point to the

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladimir. On Mon, Nov 09, 2015 at 11:12:18PM +0300, Vladimir Davydov wrote: > Because we won't be able to distinguish kmem_cache_alloc calls that > should be accounted from those that shouldn't. The problem is if two > caches > > A = kmem_cache_create(...) > > and > > B =

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 01:54:01PM -0500, Tejun Heo wrote: > On Mon, Nov 09, 2015 at 09:28:40PM +0300, Vladimir Davydov wrote: > > > I am _all_ for this semantic I am just not sure what to do with the > > > legacy kmem controller. Can we change its semantic? If we cannot do that > > > > I think

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Tejun Heo
Hello, Vladmir. On Mon, Nov 09, 2015 at 10:27:47PM +0300, Vladimir Davydov wrote: > Of course, we could rework slab merging so that kmem_cache_create > returned a new dummy cache even if it was actually merged. Such a cache > would point to the real cache, which would be used for allocations.

Re: [PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-09 Thread Vladimir Davydov
On Mon, Nov 09, 2015 at 03:30:53PM -0500, Tejun Heo wrote: ... > Hmm can't we simply merge among !SLAB_ACCOUNT and SLAB_ACCOUNT > kmem_caches within themselves? I don't think we'd be losing anything > by restricting merge at that level. For anything to be tagged > SLAB_ACCOUNT, it has to

[PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-07 Thread Vladimir Davydov
Hi, Currently, all kmem allocations (namely every kmem_cache_alloc, kmalloc, alloc_kmem_pages call) are accounted to memory cgroup automatically. Callers have to explicitly opt out if they don't want/need accounting for some reason. Such a design decision leads to several problems: - kmalloc

[PATCH 0/5] memcg/kmem: switch to white list policy

2015-11-07 Thread Vladimir Davydov
Hi, Currently, all kmem allocations (namely every kmem_cache_alloc, kmalloc, alloc_kmem_pages call) are accounted to memory cgroup automatically. Callers have to explicitly opt out if they don't want/need accounting for some reason. Such a design decision leads to several problems: - kmalloc