cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/9] memcg: accounting for fib6_nodes cache
@ 2021-03-09  8:03 Vasily Averin
       [not found] ` <f105248d-bd21-8e6f-bdac-4f2c4792fc4b-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Vasily Averin @ 2021-03-09  8:03 UTC (permalink / raw
  To: cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg
  Cc: Johannes Weiner, Michal Hocko, Vladimir Davydov

Objects can be created from memcg-limited tasks
but its misuse may lead to host OOM.

Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
---
 net/ipv6/ip6_fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ef9d022..fa92ed1 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -2445,7 +2445,7 @@ int __init fib6_init(void)
 
 	fib6_node_kmem = kmem_cache_create("fib6_nodes",
 					   sizeof(struct fib6_node),
-					   0, SLAB_HWCACHE_ALIGN,
+					   0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
 					   NULL);
 	if (!fib6_node_kmem)
 		goto out;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/9] memcg: accounting for fib6_nodes cache
       [not found] ` <f105248d-bd21-8e6f-bdac-4f2c4792fc4b-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
@ 2021-03-09 21:16   ` Shakeel Butt
       [not found]     ` <CALvZod5QnzwpKwGqCYDKMUpHgPcvtS99go+u34NYGKaWsr0UAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Shakeel Butt @ 2021-03-09 21:16 UTC (permalink / raw
  To: Vasily Averin
  Cc: Cgroups, Linux MM, Johannes Weiner, Michal Hocko,
	Vladimir Davydov

On Tue, Mar 9, 2021 at 12:04 AM Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org> wrote:
>
> Objects can be created from memcg-limited tasks
> but its misuse may lead to host OOM.
>
> Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
> ---
>  net/ipv6/ip6_fib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index ef9d022..fa92ed1 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -2445,7 +2445,7 @@ int __init fib6_init(void)
>
>         fib6_node_kmem = kmem_cache_create("fib6_nodes",

Can you talk a bit more about the lifetime of the object created from
this kmem cache? Also who and what operation can trigger allocation?

Similarly can you add this information to the remaining patches of
your series as well?

>                                            sizeof(struct fib6_node),
> -                                          0, SLAB_HWCACHE_ALIGN,
> +                                          0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
>                                            NULL);
>         if (!fib6_node_kmem)
>                 goto out;
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/9] memcg: accounting for fib6_nodes cache
       [not found]     ` <CALvZod5QnzwpKwGqCYDKMUpHgPcvtS99go+u34NYGKaWsr0UAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-03-10  0:13       ` Roman Gushchin
  0 siblings, 0 replies; 3+ messages in thread
From: Roman Gushchin @ 2021-03-10  0:13 UTC (permalink / raw
  To: Shakeel Butt
  Cc: Vasily Averin, Cgroups, Linux MM, Johannes Weiner, Michal Hocko,
	Vladimir Davydov

On Tue, Mar 09, 2021 at 01:16:13PM -0800, Shakeel Butt wrote:
> On Tue, Mar 9, 2021 at 12:04 AM Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org> wrote:
> >
> > Objects can be created from memcg-limited tasks
> > but its misuse may lead to host OOM.
> >
> > Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
> > ---
> >  net/ipv6/ip6_fib.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> > index ef9d022..fa92ed1 100644
> > --- a/net/ipv6/ip6_fib.c
> > +++ b/net/ipv6/ip6_fib.c
> > @@ -2445,7 +2445,7 @@ int __init fib6_init(void)
> >
> >         fib6_node_kmem = kmem_cache_create("fib6_nodes",
> 
> Can you talk a bit more about the lifetime of the object created from
> this kmem cache? Also who and what operation can trigger allocation?

The lifetime is less of a concern since we have a slab reparenting mechanism,
unless it's a very short-living object.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-10  0:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09  8:03 [PATCH 2/9] memcg: accounting for fib6_nodes cache Vasily Averin
     [not found] ` <f105248d-bd21-8e6f-bdac-4f2c4792fc4b-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2021-03-09 21:16   ` Shakeel Butt
     [not found]     ` <CALvZod5QnzwpKwGqCYDKMUpHgPcvtS99go+u34NYGKaWsr0UAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-03-10  0:13       ` Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).