All of lore.kernel.org
 help / color / mirror / Atom feed
* libbpf not properly detecting support for memcg-based memory accounting
@ 2022-10-28 14:18 Grant Seltzer Richman
  2022-10-28 17:22 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Seltzer Richman @ 2022-10-28 14:18 UTC (permalink / raw)
  To: bpf

It appears that while using libbpf 1.0.1 on a 5.10 kernel, libbpf is
not properly recognizing a lack of support for memcg-based memory
accounting. This is happening in Google's default Kubernetes
environment (GKE). The error message we receive is:

```
libbpf: map 'sys_32_to_64_map': failed to create: operation not permitted(-1)
libbpf: permission error while running as root; try raising 'ulimit
-l'? current value: 64.0 KiB
libbpf: failed to load object 'embedded-core'
```

We were able to fix this issue by manually bumping the memory rlimit,
leading to the conclusion that the detection of memcg-based memory is
not functioning properly, and therefore libbpf is not handling this
manual bump as advertised.

Environment:

```
Linux ubuntu 5.10.123+ #1 SMP Sat Jul 9 14:51:14 UTC 2022 x86_64
x86_64 x86_64 GNU/Linux
```

Thanks so much,
Grant Seltzer

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

* Re: libbpf not properly detecting support for memcg-based memory accounting
  2022-10-28 14:18 libbpf not properly detecting support for memcg-based memory accounting Grant Seltzer Richman
@ 2022-10-28 17:22 ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2022-10-28 17:22 UTC (permalink / raw)
  To: Grant Seltzer Richman; +Cc: bpf

On Fri, Oct 28, 2022 at 7:26 AM Grant Seltzer Richman
<grantseltzer@gmail.com> wrote:
>
> It appears that while using libbpf 1.0.1 on a 5.10 kernel, libbpf is
> not properly recognizing a lack of support for memcg-based memory
> accounting. This is happening in Google's default Kubernetes
> environment (GKE). The error message we receive is:

Yes, unfortunately the way the switch to memcg accounting is
implemented makes it hard to detect it easily. So libbpf is detecting
another feature that went together with memcg switch (see
probe_memcg_account()). So it's kind of known, though unfortunate,
state of the things.

Do you have some good ideas on how to implement this better? And yes,
the ability to bump memory limits manually is sort of an intended
work-around.

>
> ```
> libbpf: map 'sys_32_to_64_map': failed to create: operation not permitted(-1)
> libbpf: permission error while running as root; try raising 'ulimit
> -l'? current value: 64.0 KiB
> libbpf: failed to load object 'embedded-core'
> ```
>
> We were able to fix this issue by manually bumping the memory rlimit,
> leading to the conclusion that the detection of memcg-based memory is
> not functioning properly, and therefore libbpf is not handling this
> manual bump as advertised.
>
> Environment:
>
> ```
> Linux ubuntu 5.10.123+ #1 SMP Sat Jul 9 14:51:14 UTC 2022 x86_64
> x86_64 x86_64 GNU/Linux
> ```
>
> Thanks so much,
> Grant Seltzer

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

end of thread, other threads:[~2022-10-28 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 14:18 libbpf not properly detecting support for memcg-based memory accounting Grant Seltzer Richman
2022-10-28 17:22 ` Andrii Nakryiko

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.