mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-18 05:30:37 +00:00
Revert "yield to executor every time we move backwards"
This reverts commit 49bf66a467.
This commit is contained in:
@@ -884,21 +884,9 @@ impl PageCache {
|
||||
) -> anyhow::Result<(usize, tokio::sync::RwLockWriteGuard<SlotInner>)> {
|
||||
let iter_limit = self.slots.len() * 10;
|
||||
let mut iters = 0;
|
||||
let mut last_slot_idx = None;
|
||||
loop {
|
||||
iters += 1;
|
||||
let slot_idx = {
|
||||
let next_idx =
|
||||
self.next_evict_slot.fetch_add(1, Ordering::Relaxed) % self.slots.len();
|
||||
match (last_slot_idx, next_idx) {
|
||||
(Some(x), y) if x > y => {
|
||||
tokio::task::yield_now().await;
|
||||
}
|
||||
(None | Some(_), _) => {}
|
||||
}
|
||||
last_slot_idx = Some(next_idx);
|
||||
next_idx
|
||||
};
|
||||
let slot_idx = self.next_evict_slot.fetch_add(1, Ordering::Relaxed) % self.slots.len();
|
||||
|
||||
let slot = &self.slots[slot_idx];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user