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.
This commit is contained in:
Antonio SJ Musumeci 2026-11-21 17:48:28 -05:00
parent 0f9d52d9d8
commit 0a82dfe2e0
6 changed files with 69 additions and 17 deletions

View file

@ -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_,