Commit 46af8e2
pipe: cache 2 pages instead of 1
User data is kept in a circular buffer backed by pages allocated as
needed. Only having space for one spare is still prone to having to
resort to allocation / freeing.
In my testing this decreases page allocs by 60% during a kernel build.
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20250303230409.452687-3-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent a40cd58 commit 46af8e2
2 files changed
Lines changed: 41 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
115 | 143 | | |
116 | 144 | | |
117 | 145 | | |
118 | 146 | | |
119 | 147 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 148 | + | |
129 | 149 | | |
130 | 150 | | |
131 | 151 | | |
| |||
493 | 513 | | |
494 | 514 | | |
495 | 515 | | |
496 | | - | |
| 516 | + | |
497 | 517 | | |
498 | 518 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
506 | 524 | | |
507 | 525 | | |
508 | 526 | | |
509 | 527 | | |
| 528 | + | |
510 | 529 | | |
511 | 530 | | |
512 | 531 | | |
513 | 532 | | |
514 | 533 | | |
515 | 534 | | |
516 | | - | |
517 | 535 | | |
518 | 536 | | |
519 | 537 | | |
| |||
846 | 864 | | |
847 | 865 | | |
848 | 866 | | |
849 | | - | |
850 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
851 | 871 | | |
852 | 872 | | |
853 | 873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments