Breno Leitao
f7f4665dc5
fs/pipe: unify the page pools into a single per-pipe pool
...
Pipes keep two separate page caches:
a) The per-pipe, lock-protected tmp_page[2]
b) An on-stack anon_pipe_prealloc burst pool of up to eight pages
filled before the lock
Converge them into a single per-pipe pool (struct anon_pipe_prealloc
embedded in pipe_inode_info) with the same budget as before: up to
PIPE_PREALLOC_MAX (8) pages, trimmed back to PIPE_PREALLOC_KEEP (2)
after each operation. tmp_page[2] is removed.
Pages are still allocated and freed outside pipe->mutex; only the
assignment into the pool is done under it. The pool count is also read
locklessly in the prefill path, so it is annotated __data_racy.
anon_pipe_prefill_and_lock() tops the pool up to the write's page count
-- and returns with pipe->mutex held, so a write acquires the lock only
once.
anon_pipe_trim_and_unlock() trims the pool under that same lock before
dropping it, then frees the excess.
Signed-off-by: Breno Leitao <leitao@debian.org >
Link: https://patch.msgid.link/20260720-b4-pipe-unification-v5-1-9002a3fe5e6d@debian.org
Reviewed-by: Mateusz Guzik <mjguzik@gmail.com >
Reviewed-by: Oleg Nesterov <oleg@redhat.com >
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org >
2026-07-31 10:09:11 +02:00
..
2026-07-01 12:47:23 +02:00
2026-04-25 07:44:26 -07:00
2026-07-31 10:09:07 +02:00
2026-07-01 12:48:41 +02:00
2026-07-01 12:48:44 +02:00
2026-05-21 13:39:35 +02:00
2026-05-28 13:58:14 +02:00
2026-07-01 12:48:48 +02:00
2026-05-15 15:32:43 +02:00
2026-07-01 12:48:51 +02:00
2026-07-01 12:47:13 +02:00
2026-06-15 04:28:20 +05:30
2026-05-03 09:12:23 -06:00
2026-06-22 12:12:11 -07:00
2026-04-02 16:15:23 +02:00
2026-02-21 17:09:51 -08:00
2026-05-08 08:38:03 -05:00
2026-06-26 08:24:06 -07:00
2026-04-28 12:30:59 +02:00
2026-06-11 11:42:21 -07:00
2026-06-22 18:50:36 +08:00
2026-06-15 20:01:04 +09:00
2026-06-05 00:34:55 -04:00
2026-07-01 12:49:36 +02:00
2026-07-01 12:49:40 +02:00
2026-07-01 12:50:09 +02:00
2026-06-21 13:20:19 -07:00
2026-03-06 14:31:28 +01:00
2026-07-01 12:47:13 +02:00
2026-07-01 12:50:13 +02:00
2026-07-31 10:09:07 +02:00
2026-07-31 10:09:07 +02:00
2026-02-21 17:09:51 -08:00
2026-07-01 12:50:22 +02:00
2026-07-01 12:50:25 +02:00
2026-06-29 10:27:27 +02:00
2026-06-16 11:58:52 +05:30
2026-06-18 09:42:02 -07:00
2026-07-31 10:09:07 +02:00
2026-07-01 12:50:32 +02:00
2026-06-15 12:41:17 +05:30
2026-06-09 16:32:59 -04:00
2026-07-01 12:50:36 +02:00
2026-05-12 14:42:32 +02:00
2026-07-01 12:51:13 +02:00
2026-01-02 13:43:41 -05:00
2026-06-18 09:14:15 -07:00
2026-07-01 12:50:39 +02:00
2025-12-01 11:58:06 +02:00
2026-06-16 11:56:43 +05:30
2026-07-01 12:51:23 +02:00
2026-07-01 12:50:42 +02:00
2026-07-01 12:50:49 +02:00
2026-07-01 12:50:52 +02:00
2025-10-20 20:22:26 +02:00
2026-07-01 12:50:55 +02:00
2026-05-18 14:56:15 +02:00
2026-06-21 13:20:19 -07:00
2026-04-15 12:59:16 -07:00
2026-05-21 13:39:35 +02:00
2026-05-28 14:16:33 +02:00
2026-05-27 15:12:22 +02:00
2026-07-01 12:51:01 +02:00
2026-05-08 12:07:43 +02:00
2026-07-31 10:09:06 +02:00
2026-07-01 12:47:13 +02:00
2026-02-24 11:13:27 -08:00
2026-06-15 12:41:17 +05:30
2026-03-18 11:41:53 -07:00
2026-06-05 01:12:15 -04:00
2026-07-01 12:51:16 +02:00
2026-07-01 12:51:04 +02:00
2026-07-31 10:09:06 +02:00
2026-02-21 17:09:51 -08:00
2026-05-11 16:50:29 +02:00
2026-06-17 09:18:14 +01:00
2026-07-01 12:51:20 +02:00
2026-05-12 07:53:20 +09:00
2026-06-04 10:10:49 +02:00
2026-06-04 10:10:49 +02:00
2026-05-15 19:24:32 +02:00
2026-06-10 09:49:25 +02:00
2026-01-12 14:01:32 +01:00
2026-04-13 12:19:01 -07:00
2026-04-05 13:53:39 -07:00
2026-05-28 13:58:14 +02:00
2026-06-17 09:18:14 +01:00
2026-06-15 03:59:45 +05:30
2026-02-21 17:09:51 -08:00
2026-06-15 03:59:45 +05:30
2026-04-07 12:32:22 +02:00
2026-04-21 14:12:01 -07:00
2026-06-15 04:15:31 +05:30
2026-05-26 11:01:55 -06:00
2025-10-20 20:22:26 +02:00
2026-02-21 17:09:51 -08:00
2026-07-31 10:09:11 +02:00
2026-06-15 03:59:45 +05:30
2026-06-15 03:59:45 +05:30
2026-06-04 09:39:50 +02:00
2026-05-11 16:50:27 +02:00
2026-06-15 04:15:31 +05:30
2026-05-28 14:27:00 +02:00
2026-06-12 14:26:27 +02:00
2026-04-13 14:20:11 -07:00
2025-11-05 09:51:30 +01:00
2026-02-19 14:34:26 +01:00
2026-01-14 16:50:37 +01:00
2026-06-04 10:16:51 +02:00
2026-03-06 14:31:28 +01:00
2026-02-21 17:09:51 -08:00
2026-02-09 16:58:28 -08:00
2026-07-31 10:09:11 +02:00
2026-06-15 14:06:20 +02:00
2026-05-28 21:24:42 -07:00
2026-06-15 04:21:00 +05:30
2026-05-15 19:24:32 +02:00
2026-06-04 14:45:03 -07:00
2026-04-13 14:20:11 -07:00
2026-05-11 14:19:01 +02:00
2026-06-15 04:07:58 +05:30
2026-04-15 12:59:16 -07:00
2026-07-01 12:47:13 +02:00
2026-07-31 10:09:09 +02:00
2026-06-15 03:59:45 +05:30
2026-06-29 10:27:27 +02:00
2026-06-23 12:03:44 -07:00
2026-06-16 11:56:43 +05:30
2026-07-31 10:09:11 +02:00
2026-06-30 12:48:38 +02:00
2026-06-05 14:46:20 +02:00
2026-03-24 14:44:02 +01:00
2026-06-15 03:59:45 +05:30
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-07-31 10:09:11 +02:00
2026-01-16 12:52:04 -05:00
2026-06-29 10:27:29 +02:00
2026-05-21 13:39:36 +02:00
2026-05-01 21:36:13 +02:00
2026-01-16 12:52:03 -05:00
2026-06-17 12:34:16 +01:00