Thread (2 messages) flat view 2 messages, 2 authors, 2021-01-12

Re: [PATCH bpf-next 1/4] bpf: enable task local storage for tracing programs

From: Song Liu <hidden>
Date: 2021-01-12 00:48:52
Also in: bpf, lkml

On Jan 11, 2021, at 2:14 AM, KP Singh [off-list ref] wrote:

On Sat, Jan 9, 2021 at 12:35 AM Song Liu [off-list ref] wrote:
quoted
To access per-task data, BPF program typically creates a hash table with
pid as the key. This is not ideal because:
1. The use need to estimate requires size of the hash table, with may be
   inaccurate;
2. Big hash tables are slow;
3. To clean up the data properly during task terminations, the user need
   to write code.

Task local storage overcomes these issues and becomes a better option for
these per-task data. Task local storage is only available to BPF_LSM. Now
enable it for tracing programs.
Also mention here that you change the pointer from being a security blob to a
dedicated member in the task struct. I assume this is because you want to
use it without CONFIG_BPF_LSM?
Yes, exactly. I will add this to the commit log. 
quoted
Can you also mention the reasons for changing the
raw_spin_lock_bh to raw_spin_lock_irqsave in the commit log?
This is because we will use these in irq context. I will add this to the 
commit log. 

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help