Re: [PATCH] perf lock contention: Do not use BPF task local storage

From: Martin KaFai Lau
Date: Mon Nov 21 2022 - 12:33:11 EST


On 11/18/22 11:01 AM, Namhyung Kim wrote:
It caused some troubles when a lock inside kmalloc is contended
because task local storage would allocate memory using kmalloc.
It'd create a recusion and even crash in my system.

There could be a couple of workarounds but I think the simplest
one is to use a pre-allocated hash map.

Acked-by: Martin KaFai Lau <martin.lau@xxxxxxxxxx>

We could fix the task local storage to use the safe BPF allocator,
but it takes time so let's change this until it happens actually.

I also got another report on the kfree_rcu path. I am also looking into this direction on using the BPF allocator.