mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
After a successful _remove_thread_scaling_locked, the monitor set expected_count via thread_count(), which returns the pre-shrink count because the removal is deferred (only _remove_count is incremented; the actual _threads erase happens asynchronously when a worker claims the removal). This caused two problems: 1. On the next cycle, the deferred removal makes thread_count() return count-1, which differs from expected_count (count), triggering the external-scaling-interference detector and wasting the cycle. 2. If the worker hasn't exited yet, thread_count() still equals expected_count, so the monitor evaluates throughput with the pre-shrink thread count still in effect, potentially reversing direction before the shrink's effect is measurable. Fix: compute expected_count arithmetically (count-1 for shrink, count+1 for grow) using the authoritative pre-operation count read under _scaling_mutex, reflecting the intended outcome rather than the racy current state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| moodycamel | ||
| base_types.h | ||
| bounded_queue.hpp | ||
| debug.hpp | ||
| extern_c.h | ||
| fatal.hpp | ||
| fs_dirent64.hpp | ||
| fuse.h | ||
| fuse_attr.h | ||
| fuse_cfg.hpp | ||
| fuse_common.h | ||
| fuse_conn_info.hpp | ||
| fuse_dirent.h | ||
| fuse_direntplus.h | ||
| fuse_dirents.hpp | ||
| fuse_entry.h | ||
| fuse_kernel.h | ||
| fuse_lowlevel.h | ||
| fuse_msgbuf.hpp | ||
| fuse_msgbuf_t.h | ||
| fuse_opt.h | ||
| fuse_pollhandle.h | ||
| fuse_req.hpp | ||
| fuse_req_ctx.h | ||
| fuse_timeouts.h | ||
| invocable.h | ||
| kvec.h | ||
| maintenance_thread.hpp | ||
| mutex.hpp | ||
| mutex_debug.hpp | ||
| mutex_ndebug.hpp | ||
| objpool.hpp | ||
| stat_utils.h | ||
| syslog.hpp | ||
| thread_pool.hpp | ||