tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Atomic migration chains, balancing fixes.



On Tue, May 20, 2008 at 02:41:40PM +0100, Mindaugas Rasiukevicius wrote:

> http://www.netbsd.org/~rmind/midle_1.diff

@@ -264,6 +264,9 @@ sched_dequeue(struct lwp *l)

+       if (spc->spc_migrating == 0)
+               spc->spc_migrating = NULL;
+

Should that '0' be 'l'?   

@@ -268,40 +268,26 @@ cpu_xc_offline(struct cpu_info *ci)

        LIST_FOREACH(l, &alllwp, l_list) {
-               if (l->l_cpu != ci || (l->l_pflag & LP_BOUND))
+               /* Checks could be performed without lock */
+               if (l->l_cpu != ci || (l->l_pflag & LP_BOUND) != 0)
                        continue;
+               lwp_lock(l);

Since cpu offline is not performed often, maybe it's better to take the lock
to be safe?

Thanks,
Andrew


Home | Main Index | Thread Index | Old Index