Messages in this thread | | | Date | Sun, 21 Dec 2003 13:56:02 +1100 | From | Nick Piggin <> | Subject | Re: [CFT][RFC] HT scheduler |
| |
Rusty Russell wrote:
>In message <3FE28529.1010003@cyberone.com.au> you write: > >>+ * See comment for set_cpus_allowed. calling rules are different: >>+ * the task's runqueue lock must be held, and __set_cpus_allowed >>+ * will return with the runqueue unlocked. >> > >Please, never *ever* do this. > >Locking is probably the hardest thing to get right, and code like this >makes it harder. >
Although in this case it is only one lock, and its only used in one place, with comments. But yeah its far more complex than a blocking semaphore would be.
> >Fortunately, there is a simple solution coming with the hotplug CPU >code: we need to hold the cpucontrol semaphore here anyway, against >cpus vanishing. > >Perhaps we should just use that in both places. >
We could just use a private semaphore until the hotplug code is in place.
- 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/
| |