raid5: how to bind worker threads to specified cpus

From: èéä(èå)
Date: Thu Sep 13 2018 - 04:19:18 EST


Since commit b721420e8719131896b009b11edbbd27d9b85e98, raid5 has been
enabled to support workqueue offload handling of stripes. However, if I hope
to bind worker threads to specified cpus, for example 0-3, is it possible?
The reason for doing this is that I hope applications will not be disturbed
by raid5's jobs. My naive idea is to add a field named "affinity_hint" to
struct r5conf, and then add a sysfs entry to input cpu list, and then take
stripe_head's sector as the hash key to evenly distribute stripe_head across
the cpus.
Anyone has suggestion about my idea or any alternative solutions to bind
worker threads to specified cpus ? thanks a lot .