We lack node hotplug, so the dependence on the number of system nodes in
the equation is static and can easily be defined at compile-time.
I agree that the maximum number of parallel reclaim threads should be a
function of cpus, so you can easily make it that by adding callback
functions for cpu hotplug events.
Perhaps a better alternative than creating a set of heuristics and setting
a user-defined maximum on the number of concurrent reclaim threads is to
configure the number of threads to be used for each online cpu called
CONFIG_NUM_RECLAIM_THREADS_PER_CPU. This solves the lock contention
problem if configured properly that was mentioned earlier.
Adding yet another sysctl for this functionality seems unnecessary, unless
it is attempting to address other VM problems where page reclaim needs to
be throttled when it is being stressed. Those issues need to be addressed
directly, in my opinion, instead of attempting to workaround it by
limiting the number of concurrent reclaim threads.
David
--