Commit 5031ac8
Improve buffer manager API for backend pin limits.
Previously the support functions assumed that the caller needed one pin
to make progress, and could optionally use some more. Add a couple more
functions for callers that want to know:
* what the maximum possible number could be irrespective of currently
held pins, for space planning purposes, called the "soft pin limit"
* how many additional pins they could acquire right now, without the
special case allowing one pin, for users that already hold pins and
could make progress even if zero extra pins are available
These APIs are better suited to read_stream.c, which will be improved in
a follow-up patch. Also compute MaxProportionalPins up front, to avoid
performing division whenever we check the balance.
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/CA%2BhUKGK_%3D4CVmMHvsHjOVrK6t4F%3DLBpFzsrr3R%2BaJYN8kcTfWg%40mail.gmail.com1 parent 4618045 commit 5031ac8
File tree
3 files changed
+80
-25
lines changed- src
- backend/storage/buffer
- include/storage
3 files changed
+80
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
2097 | 2099 | | |
2098 | 2100 | | |
2099 | 2101 | | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2100 | 2144 | | |
2101 | 2145 | | |
2102 | 2146 | | |
2103 | 2147 | | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
| 2148 | + | |
| 2149 | + | |
2111 | 2150 | | |
2112 | 2151 | | |
2113 | 2152 | | |
2114 | 2153 | | |
2115 | | - | |
2116 | | - | |
| 2154 | + | |
2117 | 2155 | | |
2118 | 2156 | | |
2119 | 2157 | | |
2120 | 2158 | | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
2124 | | - | |
2125 | | - | |
2126 | | - | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | | - | |
2131 | | - | |
2132 | | - | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
2136 | | - | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2137 | 2163 | | |
2138 | 2164 | | |
2139 | 2165 | | |
| |||
3575 | 3601 | | |
3576 | 3602 | | |
3577 | 3603 | | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
3578 | 3613 | | |
3579 | 3614 | | |
3580 | 3615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
289 | 305 | | |
290 | 306 | | |
291 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| |||
0 commit comments