@@ -176,8 +176,8 @@ small limit value) whenever the buffer is pinned. (This requires only the
176
176
buffer header spinlock, which would have to be taken anyway to increment the
177
177
buffer reference count, so it's nearly free.)
178
178
179
- The "clock hand" is a buffer index, NextVictimBuffer , that moves circularly
180
- through all the available buffers. NextVictimBuffer is protected by the
179
+ The "clock hand" is a buffer index, nextVictimBuffer , that moves circularly
180
+ through all the available buffers. nextVictimBuffer is protected by the
181
181
BufFreelistLock.
182
182
183
183
The algorithm for a process that needs to obtain a victim buffer is:
@@ -189,8 +189,8 @@ is pinned or has a nonzero usage count, it cannot be used; ignore it and
189
189
return to the start of step 2. Otherwise, pin the buffer, release
190
190
BufFreelistLock, and return the buffer.
191
191
192
- 3. Otherwise, select the buffer pointed to by NextVictimBuffer , and
193
- circularly advance NextVictimBuffer for next time.
192
+ 3. Otherwise, select the buffer pointed to by nextVictimBuffer , and
193
+ circularly advance nextVictimBuffer for next time.
194
194
195
195
4. If the selected buffer is pinned or has a nonzero usage count, it cannot
196
196
be used. Decrement its usage count (if nonzero) and return to step 3 to
@@ -254,11 +254,11 @@ Background Writer's Processing
254
254
The background writer is designed to write out pages that are likely to be
255
255
recycled soon, thereby offloading the writing work from active backends.
256
256
To do this, it scans forward circularly from the current position of
257
- NextVictimBuffer (which it does not change!), looking for buffers that are
257
+ nextVictimBuffer (which it does not change!), looking for buffers that are
258
258
dirty and not pinned nor marked with a positive usage count. It pins,
259
259
writes, and releases any such buffer.
260
260
261
- If we can assume that reading NextVictimBuffer is an atomic action, then
261
+ If we can assume that reading nextVictimBuffer is an atomic action, then
262
262
the writer doesn't even need to take the BufFreelistLock in order to look
263
263
for buffers to write; it needs only to spinlock each buffer header for long
264
264
enough to check the dirtybit. Even without that assumption, the writer
@@ -268,7 +268,7 @@ the contention cost of the writer compared to PG 8.0.)
268
268
269
269
During a checkpoint, the writer's strategy must be to write every dirty
270
270
buffer (pinned or not!). We may as well make it start this scan from
271
- NextVictimBuffer , however, so that the first-to-be-written pages are the
271
+ nextVictimBuffer , however, so that the first-to-be-written pages are the
272
272
ones that backends might otherwise have to write for themselves soon.
273
273
274
274
The background writer takes shared content lock on a buffer while writing it
0 commit comments