Alexei Starovoitov
9f2c6e96c6
bpf: Optimize rcu_barrier usage between hash map and bpf_mem_alloc.
...
User space might be creating and destroying a lot of hash maps. Synchronous
rcu_barrier-s in a destruction path of hash map delay freeing of hash buckets
and other map memory and may cause artificial OOM situation under stress.
Optimize rcu_barrier usage between bpf hash map and bpf_mem_alloc:
- remove rcu_barrier from hash map, since htab doesn't use call_rcu
directly and there are no callback to wait for.
- bpf_mem_alloc has call_rcu_in_progress flag that indicates pending callbacks.
Use it to avoid barriers in fast path.
- When barriers are needed copy bpf_mem_alloc into temp structure
and wait for rcu barrier-s in the worker to let the rest of
hash map freeing to proceed.
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Link: https://lore.kernel.org/bpf/20220902211058.60789-17-alexei.starovoitov@gmail.com
2022-09-05 15:33:07 +02:00
..
2022-09-05 15:33:07 +02:00
2022-08-25 11:35:37 -07:00
2022-08-04 11:05:48 -07:00
2022-05-26 17:13:43 -07:00
2022-08-08 15:16:29 -07:00
2022-07-05 13:32:59 -07:00
2022-08-06 17:28:12 -07:00
2022-05-25 16:18:27 -07:00
2021-12-02 17:25:21 +09:00
2022-07-28 12:36:35 +02:00
2022-07-22 09:22:59 -06:00
2022-06-02 08:55:01 -07:00
2022-08-02 19:12:45 -07:00
2022-08-08 14:12:19 -07:00
2022-08-04 11:05:48 -07:00
2022-07-15 10:52:11 +02:00
2022-08-05 16:32:45 -07:00
2022-08-06 17:34:06 -07:00
2022-08-03 16:29:08 -07:00
2022-08-05 09:41:12 -07:00
2022-04-06 13:43:44 -07:00
2022-02-03 11:20:34 -08:00
2022-04-25 14:37:18 +02:00
2022-04-25 14:37:28 +02:00
2022-04-25 14:37:12 +02:00
2022-06-13 14:08:57 -04:00
2022-02-22 13:51:40 -05:00
2022-01-11 13:08:21 -08:00
2022-06-15 19:28:44 -04:00
2022-03-09 10:32:06 -08:00
2022-07-05 13:32:59 -07:00
2021-09-08 15:32:35 -07:00
2022-07-05 13:33:00 -07:00
2022-07-05 13:32:59 -07:00
2022-05-23 17:51:12 -07:00
2022-07-17 17:31:40 -07:00
2022-03-15 10:32:44 +01:00
2022-06-01 15:55:25 -07:00
2022-08-03 10:44:54 +02:00
2022-07-05 13:32:59 -07:00
2022-08-05 09:41:12 -07:00
2022-05-08 03:16:59 +09:00
2022-07-15 18:21:49 +00:00
2022-07-29 18:12:35 -07:00
2022-04-15 14:49:55 -07:00
2022-06-24 09:48:55 +02:00
2022-07-17 17:31:39 -07:00
2022-08-07 10:03:24 -07:00
2022-03-31 10:36:55 +02:00
2022-05-25 13:05:42 -07:00
2022-07-15 12:21:16 -04:00
2022-08-07 10:03:24 -07:00
2021-09-08 15:32:34 -07:00
2022-08-02 11:47:29 +02:00
2022-03-23 19:00:33 -07:00
2022-06-16 19:11:30 -07:00
2022-04-21 11:40:59 -07:00
2022-08-01 07:42:56 +02:00
2022-05-19 19:30:30 +02:00
2022-06-15 07:58:04 -07:00
2022-01-31 11:21:46 +11:00
2022-08-02 19:34:45 -07:00
2021-12-28 11:26:18 +01:00
2022-04-29 14:38:00 -07:00
2021-10-14 13:29:18 +02:00
2022-07-29 18:12:36 -07:00
2022-07-09 11:06:19 -07:00
2022-06-23 19:11:28 +02:00
2022-05-12 20:38:37 -07:00
2022-07-21 17:19:25 -07:00
2022-08-01 15:21:42 +02:00
2022-04-11 17:07:29 -07:00
2022-03-24 19:06:48 -07:00
2022-05-03 14:11:58 -07:00
2022-07-07 09:53:43 -07:00
2022-07-19 11:40:00 -07:00
2022-04-12 14:13:01 +02:00
2022-07-05 13:32:59 -07:00
2022-05-08 01:33:09 -07:00
2022-02-25 09:36:06 +01:00
2022-04-05 09:59:38 +02:00
2022-04-05 09:59:38 +02:00
2022-05-24 11:11:13 -07:00
2022-01-15 16:30:30 +02:00
2022-04-22 18:50:54 +01:00
2022-08-08 09:01:36 -07:00
2022-04-30 08:39:32 -06:00
2022-04-29 14:38:03 -07:00
2022-02-01 17:24:39 -08:00
2022-04-29 14:38:03 -07:00
2022-02-17 09:11:57 -06:00
2022-05-06 14:49:44 -05:00
2022-02-25 10:40:14 -06:00
2021-09-08 11:50:27 -07:00
2022-05-19 23:25:47 -04:00
2022-08-02 19:24:24 -07:00
2022-06-23 18:41:40 +02:00
2022-08-06 16:38:17 -07:00
2021-08-17 07:49:10 -10:00
2022-08-03 19:52:08 -07:00