Song Liu
a10787e6d5
bpf: Enable task local storage for tracing programs
...
To access per-task data, BPF programs usually creates a hash table with
pid as the key. This is not ideal because:
1. The user need to estimate the proper size of the hash table, which may
be inaccurate;
2. Big hash tables are slow;
3. To clean up the data properly during task terminations, the user need
to write extra logic.
Task local storage overcomes these issues and offers a better option for
these per-task data. Task local storage is only available to BPF_LSM. Now
enable it for tracing programs.
Unlike LSM programs, tracing programs can be called in IRQ contexts.
Helpers that access task local storage are updated to use
raw_spin_lock_irqsave() instead of raw_spin_lock_bh().
Tracing programs can attach to functions on the task free path, e.g.
exit_creds(). To avoid allocating task local storage after
bpf_task_storage_free(). bpf_task_storage_get() is updated to not allocate
new storage when the task is not refcounted (task->usage == 0).
Signed-off-by: Song Liu <songliubraving@fb.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: KP Singh <kpsingh@kernel.org >
Acked-by: Martin KaFai Lau <kafai@fb.com >
Link: https://lore.kernel.org/bpf/20210225234319.336131-2-songliubraving@fb.com
2021-02-26 11:51:47 -08:00
..
2021-01-27 10:01:46 +01:00
2020-12-28 20:34:33 +01:00
2021-01-05 18:00:09 +01:00
2020-12-17 12:52:23 -08:00
2021-02-16 14:47:46 -08:00
2020-12-16 16:38:41 -08:00
2021-01-16 18:32:36 +00:00
2020-12-15 16:18:23 -08:00
2021-02-20 21:36:51 -08:00
2021-02-16 14:53:30 -08:00
2020-12-16 18:48:16 +01:00
2020-12-11 22:29:38 -08:00
2021-01-13 15:08:41 +00:00
2021-02-20 21:32:37 -08:00
2021-01-28 21:24:40 -08:00
2021-01-21 12:35:42 +00:00
2021-01-09 13:51:36 -08:00
2021-02-17 14:08:17 +01:00
2021-02-20 18:42:28 -08:00
2020-12-15 14:10:09 -08:00
2021-01-26 19:21:49 +01:00
2021-02-08 13:23:42 +02:00
2021-02-21 10:22:20 -08:00
2021-02-20 21:32:37 -08:00
2021-02-20 21:50:59 -08:00
2021-02-15 12:36:27 -08:00
2021-02-21 11:02:48 -08:00
2020-12-15 22:46:16 -08:00
2020-12-15 22:46:15 -08:00
2021-02-08 08:33:16 -07:00
2021-02-10 16:38:02 +01:00
2021-02-10 07:44:40 -07:00
2021-02-26 11:51:47 -08:00
2021-02-26 11:51:47 -08:00
2021-02-12 17:37:23 -08:00
2021-01-27 18:18:15 -08:00
2021-02-26 11:51:47 -08:00
2021-02-16 15:23:23 -08:00
2021-01-12 17:24:30 -08:00
2020-12-29 15:36:49 -08:00
2021-01-14 19:29:58 -08:00
2020-12-14 15:26:13 +01:00
2020-12-15 12:13:40 -08:00
2021-02-17 14:07:48 +01:00
2020-12-20 17:17:25 -08:00
2021-01-27 19:29:32 +01:00
2020-12-15 12:13:45 -08:00
2020-12-19 11:18:38 -08:00
2021-01-04 10:47:38 -08:00
2021-01-15 10:04:49 +00:00
2021-01-22 11:08:56 +01:00
2020-12-16 11:06:49 -08:00
2021-01-08 11:02:18 -08:00
2021-01-06 16:24:59 -08:00
2021-02-04 19:25:47 +01:00
2020-12-22 19:50:40 +01:00
2020-12-15 22:46:15 -08:00
2021-02-04 16:36:28 +05:30
2021-01-21 20:12:40 +01:00
2021-01-08 15:57:29 -05:00
2020-12-15 10:57:29 +01:00
2020-12-22 13:19:43 -08:00
2020-12-16 16:38:41 -08:00
2020-12-22 19:50:40 +01:00
2020-12-14 11:51:46 +01:00
2021-01-19 17:57:15 +01:00
2021-01-24 18:19:46 -07:00
2021-01-06 08:40:56 -05:00
2021-01-06 08:38:29 -05:00
2021-02-17 14:12:42 +01:00
2021-02-17 14:12:43 +01:00
2021-02-03 18:37:29 -08:00
2021-01-30 11:47:12 -05:00
2021-01-27 15:20:02 -08:00
2021-01-04 11:42:26 -05:00
2021-02-11 16:19:20 +01:00
2021-01-16 18:14:53 +00:00
2021-01-27 15:20:05 -08:00
2020-12-17 11:18:00 -08:00
2021-02-07 14:51:11 -08:00
2021-01-24 18:17:20 -07:00
2021-02-06 11:57:28 -08:00
2021-01-22 08:52:02 +00:00
2020-12-15 12:53:37 -08:00
2020-12-15 12:13:44 -08:00
2021-02-05 11:03:47 -08:00
2021-02-04 18:37:56 -08:00
2021-02-11 13:24:44 -08:00
2020-12-16 11:06:07 -08:00
2021-02-16 13:14:06 -08:00
2021-01-07 14:35:14 +00:00
2020-12-15 16:19:30 +01:00
2021-02-10 07:28:43 -07:00
2021-02-21 10:29:20 -08:00
2020-12-15 22:46:15 -08:00
2021-02-02 15:57:23 +01:00
2020-12-15 16:39:06 -08:00
2021-01-26 18:39:45 -08:00
2021-02-05 20:48:28 +01:00
2020-12-15 16:19:31 +01:00
2020-12-15 15:03:31 -08:00
2021-01-22 11:08:56 +01:00
2020-12-17 13:30:45 -05:00
2021-01-22 11:08:56 +01:00
2020-12-22 12:55:08 -08:00
2021-02-05 11:03:47 -08:00
2021-01-07 16:17:31 +01:00
2021-01-07 14:17:29 +01:00
2020-12-29 15:36:49 -08:00
2020-12-15 16:19:31 +01:00
2021-02-17 14:12:42 +01:00
2021-01-29 15:39:48 -05:00
2021-01-22 15:09:42 +01:00
2021-01-12 21:13:01 +01:00
2021-01-14 17:18:25 +01:00
2021-01-04 13:35:14 -08:00
2021-01-14 11:20:17 +01:00
2021-01-14 11:20:17 +01:00
2021-01-14 11:20:17 +01:00
2020-12-15 22:46:16 -08:00
2020-12-16 11:01:04 -08:00
2020-12-15 22:46:15 -08:00
2021-01-19 12:02:20 -08:00
2021-01-19 11:47:31 -08:00
2021-01-12 18:12:54 -08:00
2020-12-17 13:34:25 -08:00
2021-01-27 16:45:21 +05:30
2020-12-15 12:13:45 -08:00
2021-01-29 20:02:29 +01:00
2021-02-21 12:04:41 -08:00
2020-12-15 12:13:41 -08:00
2020-12-19 11:18:37 -08:00
2020-12-15 14:48:04 -08:00
2020-12-17 13:01:31 -08:00
2020-12-22 12:55:08 -08:00
2021-01-30 01:22:31 +01:00
2021-02-10 14:44:40 +01:00
2021-01-04 11:42:21 -05:00
2021-02-11 13:24:44 -08:00
2021-02-25 00:56:02 +01:00
2021-01-25 22:06:11 +01:00
2021-02-04 18:05:59 -08:00
2021-01-25 09:36:27 -05:00
2021-02-02 10:26:12 +01:00
2021-02-17 13:17:49 -08:00
2020-12-15 14:02:26 -08:00
2020-12-15 12:13:38 -08:00
2020-12-22 12:55:08 -08:00
2020-12-15 14:55:10 -08:00
2020-12-15 12:13:39 -08:00
2020-12-15 15:11:08 -06:00
2021-02-01 15:31:36 +01:00
2020-12-14 17:34:12 -08:00
2021-02-16 15:23:23 -08:00
2020-12-15 15:03:31 -08:00
2021-01-27 18:45:29 +01:00
2021-01-22 17:08:28 +01:00
2021-02-04 16:30:14 +05:30
2021-01-27 19:29:32 +01:00
2020-12-15 12:13:46 -08:00
2020-12-15 15:03:31 -08:00
2020-12-15 22:46:15 -08:00
2021-02-05 10:08:10 +01:00
2020-12-17 14:19:01 +01:00
2021-02-17 14:07:44 +01:00
2020-12-15 22:46:15 -08:00
2021-01-06 16:24:19 -08:00
2021-02-21 12:35:04 -08:00
2020-12-15 22:46:18 -08:00
2021-01-25 17:32:10 +01:00
2020-12-15 22:46:18 -08:00
2020-12-15 12:13:39 -08:00
2020-12-20 10:12:06 -08:00
2020-12-15 15:57:25 -08:00
2021-02-26 11:51:47 -08:00
2020-12-16 16:38:41 -08:00
2020-12-16 11:30:10 -08:00
2020-12-16 11:01:04 -08:00
2020-12-15 12:13:43 -08:00
2020-12-15 12:13:39 -08:00
2020-12-29 15:36:49 -08:00
2021-02-13 14:32:04 -08:00
2021-01-28 00:35:03 +01:00
2021-01-22 15:16:01 -08:00
2021-01-04 13:53:38 -08:00
2021-01-04 13:53:38 -08:00
2021-02-17 14:12:42 +01:00
2021-02-17 14:12:42 +01:00
2021-02-17 14:25:50 -08:00
2020-12-22 12:55:08 -08:00
2021-01-15 13:23:36 +00:00
2021-01-27 09:51:49 -07:00
2020-12-11 15:43:41 -05:00
2021-02-12 12:54:58 +01:00
2021-01-22 18:20:52 -08:00
2021-02-02 14:50:15 +01:00
2021-02-06 00:21:42 +01:00
2021-02-04 10:45:24 +03:00
2020-12-14 16:40:27 -08:00
2020-12-16 00:07:17 -08:00
2021-01-06 16:24:59 -08:00
2021-01-27 17:26:42 +01:00
2021-01-06 17:17:22 -08:00
2020-12-16 12:33:35 -08:00
2021-02-02 09:32:02 -05:00
2021-01-20 16:48:47 -08:00
2021-02-20 21:28:04 -08:00
2021-02-04 18:56:56 -08:00
2021-02-15 18:50:01 +01:00
2020-12-18 16:14:31 -05:00
2021-02-12 12:56:55 +01:00
2020-12-15 12:13:40 -08:00
2021-01-07 16:17:31 +01:00
2021-02-08 22:58:55 +01:00