[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: spinlocks and preemption
On 11/10/05, Jan Hudec <bulb@xxxxxx> wrote:
> I don't know about runqueue balancing, at least not by that name, but a
> few comments anyway:
By that I actually meant *load balancing*, i.e. the balancing of
processes among available CPUs, which involves balancing of the
runqueues across CPUs (or so it says in linux kernel development). I
see that this may be confusing.
> It did disable BHs, because the BH can run on any CPU. It depends on
> which CPU first reaches point suitable for running the BH. I am not sure
> whether it depends on which CPU the interrupt was handled on, but that
> can still be any of them.
OK, Here I thought because softirq daemons are per processor, the
bottom halves associated would be per processor, too. But I see that
there's no such guarantee. Also interrupts would most likely be
arbitrated among CPUs, and there's no guarantee that they run on a
particular CPU, unless the HW is set up to do otherwise.
> I think I understand now. Process can only ever move from one CPU to
> another when it's sleeping (or more precisly, when it's being taken out
> of the runqueue during a scheduling pass). And a process holding
> spinlock can't be put to sleep. So it can't be moved to another CPU.
> Jan 'Bulb' Hudec <bulb@xxxxxx>
I think this explains why the scenario doesn't deadlock.
Thanks,
Bahadir
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/