在 2021/8/17 上午12:58, Jens Axboe 写道:
On 8/16/21 12:04 AM, Hao Xu wrote:
在 2021/8/15 下午11:19, Jens Axboe 写道:
On 8/15/21 9:10 AM, Hao Xu wrote:
Since sqthread is userspace like thread now, it should respect cgroup
setting, thus we should consider current allowed cpuset when doing
cpu binding for sqthread.
This seems a bit convoluted for what it needs to do. Surely we can just
test sqd->sq_cpu directly in the task_cs()?
I didn't know task_cs() before, it seems to be a static function, which
is called by cpuset_cpus_allowed(), and this one is exposed.
But it'd be a much saner to add a helper for this rather than add all
of that boiler plate code to io_uring just to check for whether or not
a CPU is set in a mask.
I looked into cpuset_cpus_allowed(), it seems the code logic
guarantee_online_cpus() is neccessary? It guarantees the cpumask
returned are all online cpus.