Re: [patch] sched_[set|get]_affinity() syscall, 2.4.15-pre9

Robert Love
2001-11-22T23:47:40Z

On Thu, 2001-11-22 at 03:59, Ingo Molnar wrote:

> the attached set-affinity-A1 patch is relative to the scheduler
> fixes/cleanups in 2.4.15-pre9. It implements the following two
> new system calls: [...]

Ingo, I like your implementation, particularly the use of the
cpu_online_map, although I am not sure all arch's implement it yet. I
am curious, however, what you would think of using a /proc interface
instead of a set of syscalls ?

Ie, we would have a /proc/<pid>/cpu_affinity which is the same as your
`unsigned long * user_mask_ptr'. Reading and writing of the proc
interface would correspond to your get and set syscalls. Besides the
sort of relevancy and useful abstraction of putting the affinity in the
procfs, it eliminates any sizeof(cpus_allowed) problem since the read
string is the size in characters of cpus_allowed.

I would use your syscall code, though -- just reimplement it as a procfs
file. This would mean adding a proc_write function, since the _actual_
procfs (the proc part) only has a read method, but that is simple.

Thoughts?

Robert Love