Files
systemd/src/basic
Lennart Poettering fbe8f6928e capability-util: avoid thread_local
While stracing PID1's forking off of children I noticed that every
single forked off child reads cap_last_cap from procfs. That value is a
kernel constant, hence we can save a lot of work if we'd cache it.

Thing is, we actually do cache it, in a thread_local cache field. This
means that the forked off processes (which are considered new threads)
will have to re-query it, even though we already know the result.

Hence, let's get rid of the thread_local stuff (given that the value is
going to be the same for all threads anyway, and we pretty much have a
single thread only anyway). Use an C11 atomic_int instead, which ensures
the value is either initialized or not initialized, but we don't need to
be concerned of partial initialization.

This makes the cap_last_cap reading go away in the children, as strace
shows (since cap_last_cap() is already called by PID 1 before
fork()ing, anyway).
2024-04-24 17:33:38 +02:00
..
…
…
2023-06-14 16:44:57 +02:00
2024-03-05 12:33:44 +01:00
…
2024-01-16 10:49:26 -07:00
2024-04-03 11:50:25 +01:00
2024-04-03 11:50:25 +01:00
2023-07-02 11:10:12 +01:00
2023-11-22 20:38:38 +00:00
2023-12-13 20:42:05 +08:00
2024-03-18 11:04:42 +00:00
2024-03-18 11:04:42 +00:00
2023-10-04 08:58:10 +09:00
2024-04-18 17:39:34 +02:00
2022-08-02 02:43:38 +09:00
2023-08-01 10:14:49 +02:00
2023-02-24 14:11:31 +01:00
2023-12-05 23:50:25 +09:00
2024-03-22 01:44:45 +08:00
2024-03-22 01:44:45 +08:00
2024-04-10 01:45:12 +08:00
2022-12-23 23:26:26 +01:00
…
2022-09-13 08:13:27 +02:00
…
…
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2023-11-01 14:07:54 +00:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-01-25 13:51:36 +01:00
2024-04-03 10:03:53 +08:00
2024-01-30 11:18:15 -05:00
2024-02-02 09:10:02 +09:00
2023-07-02 11:10:12 +01:00
2024-01-10 03:08:31 +09:00