mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-04 22:00:15 -05:00
fix: cap thread pools at 64 and warn when clamped
- Limit read-thread-count, process-thread-count and the cor/cosr pool size in func.readdir to 64 threads per pool. Apply the cap after resolving automatic and CPU-divided counts; keep disabled process pools disabled and preserve the configured strings. - Log a syslog warning identifying the setting and limit when clamped. For readdir, warn only when applying a valid concurrent policy, not during validation. - Document the fixed cap and warning behavior. Queue depths retain their separate limits and use the clamped thread count. - Resolve negative FUSE counts without overflowing on INT_MIN. Document that both readdir inputs must fit in int and that a queue depth whose product with the resolved thread count exceeds INT_MAX is rejected, not clamped.
This commit is contained in:
parent
8d93e29ad8
commit
127c2e6238
6 changed files with 80 additions and 21 deletions
|
|
@ -110,6 +110,9 @@ public:
|
|||
std::future<std::invoke_result_t<FuncType>>
|
||||
enqueue_task(FuncType&& func_);
|
||||
|
||||
public:
|
||||
static constexpr int max_thread_count();
|
||||
|
||||
public:
|
||||
std::vector<pthread_t> threads() const;
|
||||
ThreadPool::PToken ptoken();
|
||||
|
|
@ -125,6 +128,15 @@ private:
|
|||
|
||||
|
||||
|
||||
// Cap configured pools to bound their memory and thread creation costs.
|
||||
inline
|
||||
constexpr int
|
||||
ThreadPool::max_thread_count()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
ThreadPool::ThreadPool(const unsigned thread_count_,
|
||||
const unsigned max_queue_depth_,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue