Enable the memcg-based memory accounting for the memory used by
the bpf ringbuffer.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/ringbuf.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
index
Do not use rlimit-based memory accounting for bpf local storage maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/bpf_local_storage.c | 11 ---
1 file changed, 11 deletions(-)
diff --git a/kernel/bpf
Do not use rlimit-based memory accounting for devmap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/devmap.c | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/kernel/bpf
Do not use rlimit-based memory accounting for reuseport_array maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/reuseport_array.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git
Since bpf is not using rlimit memlock for the memory accounting
and control, do not change the limit in sample applications.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
samples/bpf/map_perf_test_user.c| 6 --
samples/bpf/offwaketime_user.c | 6 --
samples/bpf
Remove rlimit-based accounting infrastructure code, which is not used
anymore.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
include/linux/bpf.h | 12
kernel/bpf/syscall.c | 64 +--
.../selftests/bpf/progs
Do not use rlimit-based memory accounting for lpm_trie maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/lpm_trie.c | 13 -
1 file changed, 13 deletions(-)
diff --git a/kernel/bpf/lpm_trie.c b/kernel
Do not use rlimit-based memory accounting for arraymap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/arraymap.c | 24
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git
Include memory used by bpf programs into the memcg-based accounting.
This includes the memory used by programs itself, auxiliary data,
statistics and bpf line info. A memory cgroup containing the
process which loads the program is getting charged.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
Include map metadata and the node size (struct bpf_dtab_netdev)
into the accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/devmap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 2b5ca93c17de
e then, make CC=clang W=1 warns:
>
> mm/memcontrol.c:3421:20:
> warning: unused function 'memcg_has_children' [-Wunused-function]
>
> Simply remove this obsolete unused function.
>
> Signed-off-by: Lukas Bulwahn
> ---
> applies cleanly on next-20201113, not on cur
On Fri, Nov 13, 2020 at 08:08:58PM -0500, Zi Yan wrote:
> On 13 Nov 2020, at 19:15, Roman Gushchin wrote:
>
> > On Wed, Nov 11, 2020 at 03:40:05PM -0500, Zi Yan wrote:
> > > From: Zi Yan
> > >
> > > It adds a new_order parameter to set new page
On Wed, Nov 11, 2020 at 03:40:06PM -0500, Zi Yan wrote:
> From: Zi Yan
>
> To split a THP to any lower order pages, we need to reform THPs on
> subpages at given order and add page refcount based on the new page
> order. Also we need to reinitialize page_deferred_list after removing
> the page
ings.
> */
> -void mem_cgroup_split_huge_fixup(struct page *head)
> +void mem_cgroup_split_huge_fixup(struct page *head, unsigned int new_nr)
I'd go with unsigned int new_order, then it's obvious that we can split
the original page without any leftovers.
Other than tha
On Wed, Nov 11, 2020 at 03:40:05PM -0500, Zi Yan wrote:
> From: Zi Yan
>
> It adds a new_order parameter to set new page order in page owner.
> It prepares for upcoming changes to support split huge page to any lower
> order.
>
> Signed-off-by: Zi Yan
> ---
> include/linux/page_owner.h | 7
вт, 10 нояб. 2020 г. в 07:16, Mike Rapoport :
>
> From: Mike Rapoport
>
> Account memory consumed by secretmem to memcg. The accounting is updated
> when the memory is actually allocated and freed.
>
> Signed-off-by: Mike Rapoport
> ---
> mm/filemap.c | 2 +-
> mm/secretmem.c | 42
On Fri, Nov 13, 2020 at 09:46:49AM -0800, Song Liu wrote:
>
>
> > On Nov 12, 2020, at 2:15 PM, Roman Gushchin wrote:
>
> [...]
>
> >
> > +#ifdef CONFIG_MEMCG_KMEM
> > +static __always_inline int __bpf_map_update_e
On Fri, Nov 13, 2020 at 10:14:48AM -0800, Song Liu wrote:
>
>
> > On Nov 12, 2020, at 2:15 PM, Roman Gushchin wrote:
> >
> > Do not use rlimit-based memory accounting for bpf local storage maps.
> > It has been replaced with the memcg-based memory accounting.
On Fri, Nov 13, 2020 at 06:25:53AM -0800, Shakeel Butt wrote:
> On Thu, Nov 12, 2020 at 8:02 PM Roman Gushchin wrote:
> >
> > On Thu, Nov 12, 2020 at 07:25:48PM -0800, Alexei Starovoitov wrote:
> > > On Thu, Nov 12, 2020 at 7:18 PM Andrew Morton
> > > wrote:
&g
On Thu, Nov 12, 2020 at 07:25:48PM -0800, Alexei Starovoitov wrote:
> On Thu, Nov 12, 2020 at 7:18 PM Andrew Morton
> wrote:
> >
> > On Thu, 12 Nov 2020 19:04:56 -0800 Alexei Starovoitov
> > wrote:
> >
> > > On Thu, Nov 12, 2020 at
On Thu, Nov 12, 2020 at 05:12:39PM -0800, Andrew Morton wrote:
> On Thu, 12 Nov 2020 16:19:26 -0800 Roman Gushchin wrote:
>
> > >From 8b28d91475d54c552e503e66f169e1e00475c856 Mon Sep 17 00:00:00 2001
> > From: Roman Gushchin
> > Date: Wed, 16 Sep 2020 15:43:48 -0700
On Fri, Nov 13, 2020 at 09:56:32AM +1100, Stephen Rothwell wrote:
> Hi Roman,
>
> On Thu, 12 Nov 2020 14:15:10 -0800 Roman Gushchin wrote:
> >
> > Patch series "mm: allow mapping accounted kernel pages to userspace", v6.
> >
> > Currently a
On Thu, Nov 12, 2020 at 11:23:03AM -0500, Johannes Weiner wrote:
> On Tue, Nov 10, 2020 at 11:57:53AM -0800, Roman Gushchin wrote:
> > In general it's unknown in advance if a slab page will contain
> > accounted objects or not. In order to avoid memory waste, an
> > obj_cgrou
Do not use rlimit-based memory accounting for cpumap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/cpumap.c | 16 +---
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/kernel/bpf
Do not use rlimit-based memory accounting for arraymap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/arraymap.c | 24
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git
Include lpm trie and lpm trie node objects into the memcg-based memory
accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/lpm_trie.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
index 00e32f2ec3e6
Since bpf is not using rlimit memlock for the memory accounting
and control, do not change the limit in sample applications.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
samples/bpf/map_perf_test_user.c| 6 --
samples/bpf/offwaketime_user.c | 6 --
samples/bpf
Enable the memcg-based memory accounting for the memory used by
the bpf ringbuffer.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/ringbuf.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c
index
Do not use rlimit-based memory accounting for lpm_trie maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/lpm_trie.c | 13 -
1 file changed, 13 deletions(-)
diff --git a/kernel/bpf/lpm_trie.c b/kernel
Do not use rlimit-based memory accounting for hashtab maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/hashtab.c | 19 +--
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/kernel/bpf
Include percpu objects and the size of map metadata into the
accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
Reviewed-by: Shakeel Butt
---
kernel/bpf/hashtab.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf
Do not use rlimit-based memory accounting for bpf_struct_ops maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/bpf_struct_ops.c | 19 +++
1 file changed, 3 insertions(+), 16 deletions(-)
diff
Do not use rlimit-based memory accounting for sockmap and sockhash maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
net/core/sock_map.c | 33 ++---
1 file changed, 6 insertions(+), 27 deletions
Include internal metadata into the memcg-based memory accounting.
Also include the memory allocated on updating an element.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
net/core/sock_map.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/core/sock_map.c b
Do not use rlimit-based memory accounting for stackmap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/stackmap.c | 16 +++-
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/kernel/bpf
Extend xskmap memory accounting to include the memory taken by
the xsk_map_node structure.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
net/xdp/xskmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c
index 49da2b8ace8b
Do not use rlimit-based memory accounting for xskmap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
Signed-off-by: Roman Gushchin
---
net/xdp/xskmap.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff
Include map metadata and the node size (struct bpf_dtab_netdev)
into the accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/devmap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 2b5ca93c17de
Do not use rlimit-based memory accounting for bpf progs. It has been
replaced with memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
include/linux/bpf.h | 11 --
kernel/bpf/core.c| 12 ++-
kernel/bpf/syscall.c | 86
Do not use rlimit-based memory accounting for cgroup storage maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/local_storage.c | 21 +
1 file changed, 1 insertion(+), 20 deletions(-)
diff
Do not use rlimit-based memory accounting for queue_stack maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/queue_stack_maps.c | 16
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git
Do not use rlimit-based memory accounting for reuseport_array maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/reuseport_array.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git
Account memory used by bpf local storage maps:
per-socket and per-inode storages.
Signed-off-by: Roman Gushchin
---
kernel/bpf/bpf_local_storage.c | 7 ---
net/core/bpf_sk_storage.c | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/bpf_local_storage.c b
Do not use rlimit-based memory accounting for devmap maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/devmap.c | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/kernel/bpf
Include percpu arrays and auxiliary data into the memcg-based memory
accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/arraymap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index c6c81eceb68f
Include metadata and percpu data into the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/cpumap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index c61a23b564aa..563f96cc8a9d
Account memory used by cgroup storage maps including metadata
structures.
Account the percpu memory for the percpu flavor of cgroup storage.
Signed-off-by: Roman Gushchin
Acked-by: Song Liu
---
kernel/bpf/local_storage.c | 17 -
1 file changed, 8 insertions(+), 9 deletions
This patch enables memcg-based memory accounting for memory allocated
by __bpf_map_area_alloc(), which is used by many types of bpf maps for
large memory allocations.
Following patches in the series will refine the accounting for
some of the map types.
Signed-off-by: Roman Gushchin
---
kernel
ved, and this cgroup is getting charged for all
allocations made from an interrupt context.
Allocations made from a process context will be accounted in a usual way.
Signed-off-by: Roman Gushchin
---
include/linux/bpf.h | 4
kernel/bpf/helpers.c | 37 +
Include memory used by bpf programs into the memcg-based accounting.
This includes the memory used by programs itself, auxiliary data,
statistics and bpf line info. A memory cgroup containing the
process which loads the program is getting charged.
Signed-off-by: Roman Gushchin
---
kernel/bpf
Do not use rlimit-based memory accounting for bpf local storage maps.
It has been replaced with the memcg-based memory accounting.
Signed-off-by: Roman Gushchin
---
kernel/bpf/bpf_local_storage.c | 11 ---
1 file changed, 11 deletions(-)
diff --git a/kernel/bpf/bpf_local_storage.c b
Remove rlimit-based accounting infrastructure code, which is not used
anymore.
Signed-off-by: Roman Gushchin
---
include/linux/bpf.h | 12
kernel/bpf/syscall.c | 64 +--
.../selftests/bpf/progs/bpf_iter_bpf_map.c| 2
- added some clarifications to the cover letter
v3:
- droped the userspace part for further discussions/refinements,
by Andrii and Song
v2:
- fixed build issue, caused by the remaining rlimit-based accounting
for sockhash maps
Roman Gushchin (34):
mm: memcontrol: use helpers to r
With the deprecation of the non-hierarchical mode of the memory
controller there are no more examples of broken hierarchies left.
Let's remove the cgroup core code which was supposed to print
warnings about creating of broken hierarchies.
Signed-off-by: Roman Gushchin
Reviewed-by: Shakeel Butt
wly. The only report
we have seen so far was a LTP test suite which doesn't really reflect
any real life usecase.
v1:
- added a note from Michal
- added acks and reviews
rfc:
- https://lwn.net/Articles/835983/
Roman Gushchin (3):
mm: memcg: deprecate the non-hierarchical mode
docs: cgroup
Update cgroup v1 docs after the deprecation of the non-hierarchical
mode of the memory controller.
Signed-off-by: Roman Gushchin
Reviewed-by: Shakeel Butt
Acked-by: Michal Hocko
Acked-by: David Rientjes
---
.../admin-guide/cgroup-v1/memcg_test.rst | 8 ++--
.../admin-guide/cgroup-v1
uot; passes silently, writing of any other value fails with
-EINVAL and a warning to dmesg (on the first occasion).
Signed-off-by: Roman Gushchin
Acked-by: Michal Hocko
Reviewed-by: Shakeel Butt
Acked-by: David Rientjes
---
include/linux/memcontrol.h | 7 ---
kernel/cgroup/cgroup.c | 5
On Tue, Nov 10, 2020 at 12:50:08PM -0800, Andrew Morton wrote:
> On Tue, 10 Nov 2020 11:57:53 -0800 Roman Gushchin wrote:
>
> > In general it's unknown in advance if a slab page will contain
> > accounted objects or not. In order to avoid memory waste, an
> > obj_cg
vm_area_struct, anon_vma, task_struct, etc.
In such cases we can pre-allocate the objcgs vector and simple assign
it to the page without any atomic operations, because at this early
stage the page is not visible to anyone else.
Signed-off-by: Roman Gushchin
---
include/linux/memcontrol.h | 14
ng any functional change, but is required for
further optimizations.
Signed-off-by: Roman Gushchin
---
mm/slub.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 8c9fa24ebbf3..ccdbb62e025d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1622,9 +1622,6 @@
On Tue, Nov 10, 2020 at 07:11:28AM -0800, Shakeel Butt wrote:
> On Mon, Nov 9, 2020 at 5:28 PM Roman Gushchin wrote:
> >
> > On Fri, Oct 23, 2020 at 12:30:53PM -0400, Johannes Weiner wrote:
> > > On Wed, Oct 21, 2020 at 12:33:22PM -0700, Roman Gushchin wrote:
> > >
g_id is not used as a gate for kmem accounting since
commit 0b8f73e10428 ("mm: memcontrol: clean up alloc, online,
offline, free functions")
Signed-off-by: Roman Gushchin
---
include/linux/memcontrol.h | 6 ++
mm/memcontrol.c| 6 --
2 files changed, 2 insertions
On Tue, Nov 10, 2020 at 10:21:43AM -0500, Johannes Weiner wrote:
> On Mon, Nov 09, 2020 at 05:06:15PM -0800, Roman Gushchin wrote:
> > Many kernel memory accounting paths are guarded by the
> > memcg_kmem_enabled_key static key. It changes it's state during
> > the onlining
On Thu, Oct 29, 2020 at 02:15:43PM +0800, Muchun Song wrote:
> On Thu, Oct 29, 2020 at 8:14 AM Roman Gushchin wrote:
> >
> > On Wed, Oct 28, 2020 at 10:56:20AM +0800, Muchun Song wrote:
> > > On Wed, Oct 28, 2020 at 2:48 AM Roman Gushchin wrote:
> > > >
> &
On Fri, Oct 23, 2020 at 12:30:53PM -0400, Johannes Weiner wrote:
> On Wed, Oct 21, 2020 at 12:33:22PM -0700, Roman Gushchin wrote:
> > On Tue, Oct 20, 2020 at 02:18:22PM -0400, Johannes Weiner wrote:
> > > On Tue, Oct 20, 2020 at 10:07:17AM -0700, Roman Gushchin wrote:
ble the slab
memory accounting atomically.
The patch also removes obsolete comments related to already deleted
members of kmem_cache->memcg_params.
Signed-off-by: Roman Gushchin
Fixes: 10befea91b61 ("mm: memcg/slab: use a single set of kmem_caches for all
allocations")
---
include/li
cgroup_page_lruvec() with mem_cgroup_lruvec().
>
> v1->v2:
> use page_memcg() instead of 'page->mem_cgroup'.
>
> Acked-by: Michal Hocko
> Acked-by: Johannes Weiner
> Reviewed-by: Shakeel Butt
> Signed-off-by: Hui Su
Acked-by: Roman Gushchin
Thanks!
small number of VMs having large number of VCPUs, this unaccounted
> memory can be very significant. So, charge this memory to the memcg of
> the VMM. Please note that lifetime of these allocations corresponds to
> the lifetime of the VMM.
>
> Signed-off-by: Shakeel Butt
> ---
Ack
imilar cases,
I think it's more obvious than "page_memcg(page) being stable".
Maybe it helps to address Ira's comment.
Anyway, please feel free to add:
Acked-by: Roman Gushchin
Thanks!
On Wed, Nov 04, 2020 at 09:37:46AM +0100, Michal Hocko wrote:
> On Tue 03-11-20 13:27:23, Roman Gushchin wrote:
> > The non-hierarchical cgroup v1 mode is a legacy of early days
> > of the memory controller and doesn't bring any value today.
>
> This is a bold statement
On Wed, Nov 04, 2020 at 11:14:57PM +0800, Hui Su wrote:
> We have supplied the inline func: mem_cgroup_is_root().
> So we may use mem_cgroup_is_root() instead of using
> 'memcg == root_mem_cgroup' or 'memcg != root_mem_cgroup'
> directly, which is more readable.
Most of these comparisons will go
On Wed, Nov 04, 2020 at 10:25:16PM +0800, Hui Su wrote:
> mem_cgroup_page_lruvec() in memcontrol.c and
> mem_cgroup_lruvec() in memcontrol.h is very similar
> except for the param(page and memcg) which also can be
> convert to each other.
>
> So rewrite mem_cgroup_page_lruvec() with
On Tue, Nov 03, 2020 at 02:22:21PM +0100, Michal Hocko wrote:
> Hi,
> I am sorry but I was quite busy at the time this has been discussed.
> Now that I got to this thread finally I am wondering whether this
> resp. other root cgroup exceptions have any follow up.
I'll address a feedback I've got
Update cgroup v1 docs after the deprecation of the non-hierarchical
mode of the memory controller.
Signed-off-by: Roman Gushchin
---
.../admin-guide/cgroup-v1/memcg_test.rst | 8 ++--
.../admin-guide/cgroup-v1/memory.rst | 40 ++-
2 files changed, 16 insertions
uot; passes silently, writing of any other value fails with
-EINVAL and a warning to dmesg (on the first occasion).
Signed-off-by: Roman Gushchin
---
include/linux/memcontrol.h | 7 ---
kernel/cgroup/cgroup.c | 5 ---
mm/memcontrol.c| 90 ++
the internal logic, adjusts the user interface and updates
the documentation. The alt patch removes some bits of the cgroup
core code, which become obsolete.
Roman Gushchin (3):
mm: memcg: deprecate the non-hierarchical mode
docs: cgroup-v1: reflect the deprecation of the non-hierarchical mode
cgroup
With the deprecation of the non-hierarchical mode of the memory
controller there are no more examples of broken hierarchies left.
Let's remove the cgroup core code which was supposed to print
warnings about creating of broken hierarchies.
Signed-off-by: Roman Gushchin
---
include/linux/cgroup
On Thu, Oct 29, 2020 at 01:34:57PM -0700, Shakeel Butt wrote:
> On Thu, Oct 29, 2020 at 10:10 AM Roman Gushchin wrote:
> >
> > On Thu, Oct 29, 2020 at 08:48:45AM -0700, Shakeel Butt wrote:
> > > On Tue, Oct 27, 2020 at 8:50 PM Muchun Song
> > > wrote:
>
On Thu, Oct 29, 2020 at 08:48:45AM -0700, Shakeel Butt wrote:
> On Tue, Oct 27, 2020 at 8:50 PM Muchun Song wrote:
> >
> > Consider the following memcg hierarchy.
> >
> > root
> >/\
> > A B
> >
> > If we get the objcg of memcg A
On Thu, Oct 29, 2020 at 04:39:21PM +0100, Michal Koutny wrote:
> Hi.
>
> On Mon, Oct 26, 2020 at 04:13:26PM -0700, Roman Gushchin wrote:
> > Please note, that in the non-hierarchical mode all objcgs are always
> > reparented to the root memory cgroup, even if the hierarch
n return the wrong objcg for the root memcg.
>
> Fixes: bf4f059954dc ("mm: memcg/slab: obj_cgroup API")
> Signed-off-by: Muchun Song
Acked-by: Roman Gushchin
Thanks!
On Wed, Oct 28, 2020 at 10:56:20AM +0800, Muchun Song wrote:
> On Wed, Oct 28, 2020 at 2:48 AM Roman Gushchin wrote:
> >
> > On Tue, Oct 27, 2020 at 04:02:55PM +0800, Muchun Song wrote:
> > > If we reparent the slab objects to the root memcg, when we free
> > > t
On Wed, Oct 28, 2020 at 11:20:30AM +0530, Bharata B Rao wrote:
> Hi,
>
> On POWER systems, where 64K PAGE_SIZE is default, I see that slub
> consumes higher amount of memory compared to any 4K page-size system.
> While slub is obviously going to consume more memory on 64K page-size
> systems
On Sat, Oct 24, 2020 at 08:59:59AM +0100, Christoph Hellwig wrote:
> Btw, I think we also need to use this nonblocking version from
> dma_free_contiguous. dma_free* is defined to not block. In practice
> callers mostly care if they also did GFP_ATOMIC allocations, which
> don't dip into CMA, but
On Tue, Oct 27, 2020 at 10:42:36AM -0700, Roman Gushchin wrote:
> On Tue, Oct 27, 2020 at 04:02:52PM +0800, Muchun Song wrote:
> > Consider the following memcg hierarchy.
> >
> > root
> >/\
> > A
On Tue, Oct 27, 2020 at 04:02:55PM +0800, Muchun Song wrote:
> If we reparent the slab objects to the root memcg, when we free
> the slab object, we need to update the per-memcg vmstats to keep
> it correct for the root memcg. Now this at least affects the vmstat
> of NR_KERNEL_STACK_KB for
gt; kmem.
I agree, I think we've even discussed such a renaming in the past.
Please, drop the addition of VM_BUG_ON() (it's not related to the renaming,
right?).
Other than that:
Acked-by: Roman Gushchin
Thanks!
>
> Signed-off-by: Muchun Song
> ---
> include
= obj_cgroup_memcg(objcg);
> - css_get(>css);
> + if (!css_tryget(>css))
if (unlikely(!css_tryget(>css)))
maybe?
> + goto retry;
Otherwise the fix looks good to me.
Please, feel free to add
Acked-by: Roman Gushchin
after extending the commit description.
Thanks!
On Tue, Oct 27, 2020 at 04:02:52PM +0800, Muchun Song wrote:
> Consider the following memcg hierarchy.
>
> root
>/\
> A B
>
> If we get the objcg of memcg A failed, the get_obj_cgroup_from_current
> can return the wrong objcg for
MemcgKmem() and an open-coded OR operation setting the memcg
pointer with the MEMCG_DATA_KMEM bit. __ClearPageKmemcg() can be
simple deleted, as the whole memcg_data is zeroed at once.
As a bonus, on !CONFIG_MEMCG build the PageMemcgKmem() check will
be compiled out.
Signed-off-by: Roman Gushchin
Acked-by:
, struct obj_cgroup **objcgs);
They are similar to the corresponding API for generic pages, except
that the setter can return false, indicating that the value has been
already set from a different thread.
Signed-off-by: Roman Gushchin
Acked-by: Johannes Weiner
Reviewed-by: Shakeel Butt
ULL.
page_memcg() contains a VM_BUG_ON_PAGE() check for the page not
being a slab page.
To make sure nobody uses a direct access, struct page's
mem_cgroup/obj_cgroups is converted to unsigned long memcg_data.
Signed-off-by: Roman Gushchin
Acked-by: Johannes Weiner
Reviewed-by: Shakeel Butt
Acked-by: Mic
ght be added later.
Signed-off-by: Roman Gushchin
Reviewed-by: Shakeel Butt
Acked-by: Johannes Weiner
Acked-by: Michal Hocko
---
include/linux/memcontrol.h | 32
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/li
- dropped the memcg flags mutual exclusion requirement, by Shakeel
v1:
- added and fixed comments, by Shakeel
- added some VM_BUG_ON() checks
- fixed the debug output format of page->memcg_data
Roman Gushchin (4):
mm: memcontrol: use helpers to read page's memcg data
mm: memco
orting, debugging and providing an
alternative version of the fix!
Reported-by: l...@lists.linux.it
Debugged-by: Richard Palethorpe
Fixes: bf4f059954dc ("mm: memcg/slab: obj_cgroup API")
Signed-off-by: Roman Gushchin
Reviewed-by: Shakeel Butt
Acked-by: Johannes Weiner
Cc: sta...@vger.ke
On Mon, Oct 26, 2020 at 07:32:39AM +, Richard Palethorpe wrote:
> Hello Roman,
>
> Roman Gushchin writes:
>
> > On Thu, Oct 22, 2020 at 04:59:56PM -0700, Shakeel Butt wrote:
> >> On Thu, Oct 22, 2020 at 10:25 AM Roman Gushchin wrote:
> >> >
> >
On Thu, Oct 22, 2020 at 08:58:10PM -0400, Zi Yan wrote:
> On 22 Oct 2020, at 20:47, Roman Gushchin wrote:
>
> > On Thu, Oct 22, 2020 at 07:42:45PM -0400, Zi Yan wrote:
> >> On 22 Oct 2020, at 18:53, Roman Gushchin wrote:
> >>
> >>> This small
On Thu, Oct 22, 2020 at 07:42:45PM -0400, Zi Yan wrote:
> On 22 Oct 2020, at 18:53, Roman Gushchin wrote:
>
> > This small patchset introduces a non-blocking version of cma_release()
> > and simplifies the code in hugetlbfs, where previously we had to
> > temporarily
On Thu, Oct 22, 2020 at 04:59:56PM -0700, Shakeel Butt wrote:
> On Thu, Oct 22, 2020 at 10:25 AM Roman Gushchin wrote:
> >
> [snip]
> > >
> > > Since bf4f059954dc ("mm: memcg/slab: obj_cgroup API") is in 5.9, I
> > > think we can take thi
Replace blocking cma_release() with a non-blocking cma_release_nowait()
call, so there is no more need to temporarily drop hugetlb_lock.
Signed-off-by: Roman Gushchin
---
mm/hugetlb.c | 11 +++
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
401 - 500 of 2791 matches
Mail list logo