Does Linux have CPU affinity?
The answer below is mostly outdated. In kernel version 2.6 user mode processes can use the sched_setaffinity and sched_getaffinity system calls. There is a patch which backports them to 2.4. All recent Linux versions will try to keep processes as long time as possible on the same CPU. But processes will be moved if the CPUs are not equally loaded. True CPU affinity was introduced in 2.4.0, but is only available in kernel mode. It can be used from kernel modules, but was not used by the kernel itself. Starting in 2.4.7-pre5 it is used by ksoftirqd to start one instance for each CPU. In 2.5.8-pre3 a systemcall to set CPU affinity was introduced. I have written a module implementing a userspace interface for the CPU affinity in 2.4.x kernels. WARNING: this is untested code cpus_allowed.tgz • How do I use files larger than 2GB? To use files of 2GB or more on a 32bit architecture, you need to pass the O_LARGEFILE flag to the open system call. If anybody knows which header file to include to