+static unsigned int cpu_affinities[NR_CPUS];
+static unsigned int next_aff = 0;
+static int use_affinity = 0;
+
+static void set_affinity(void)
+{
+ cpu_set_t mask;
+ int cpu;
+
+ if (!use_affinity)
+ return;
+
+ cpu = cpu_affinities[next_aff++];
+ CPU_ZERO(&mask);
+ CPU_SET(cpu, &mask);
+ sched_setaffinity(0, sizeof(mask), &mask);
+}
+
+
+