简体   繁体   中英

error from sched_setaffinity () call when tid is a kernel thread

I make a call to kernel function sched_setaffinity() to try to lock a kernel thread with a CPU, but it always fails with errno 22 that says "Invalid argument". The machine runs Fedora 15, with kernel version 2.6.38.

This call is successful if a non-kernel tid is passed in. Is this a restriction by the kernel, or is there some tweaking that can make it working?

Any kernel thread that is bound to a specific CPU with kthread_bind() cannot have its affinity changed. It should be possible for other kernel threads, though.

在设置地图并将其传递给sched_setaffinity之前,请确保将地图清零。

CPU_ZERO(&mask);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM