Messages in this thread | | | Date | Wed, 22 Oct 2003 16:34:21 +0200 (DFT) | From | Simon Derr <> | Subject | Re: (1/4) [PATCH] cpuset -- 2.6.0-test8 |
| |
Thanks a lot Stephen for your work and for sharing your wisdom with us.
Thank you also William for your remarks.
On Tue, 21 Oct 2003, William Lee Irwin III wrote: > > +static const int N = (8*sizeof(cpumask_t)); > > +/* this is a cyclic version of next_cpu */ > > +static inline void _next_cpu(const cpumask_t mask, int * index) > > +{ > > + for(;;) { > > + if (++*index >= N) *index = 0; > > + if (cpu_isset(*index, mask)) return; > > + } > > +} > Best not to insist NR_CPUS % BITS_PER_LONG == 0. Actually we don't, but you're right, NR_CPUS should definately be used here.
> > +static void migrate_cpuset_processes(struct cpuset * cs) > > + /* This should be a RARE use of the cpusets. > > + * therefore we'll prefer an inefficient operation here > > + * (searching the whole process list) > > + * than adding another list_head in task_t > > + * and locks and list_add for each fork() > Unfair rwlocks can take boxen out when abused by quadratic algorithms.
I don't see exactly which lock you are talking about here ? Anyway, the current state of the cpusets is OK for a 'gentle' use. I'm sure some improvements are needed to protect it from 'evil' users ;-)
Simon.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |