Re: [PATCH] i386 Time: Avoid PIT SMP lockups

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

 



On Wed, 11 Oct 2006 15:48:31 -0700
john stultz <[email protected]> wrote:

> > Wouldn't it be better to fix the livelock?  What's causing it?
> 
> I spent a few days trying to narrow this down, and I haven't been able
> to do so to my satisfaction.
> 
> At this point, my suspicion is that because the PIT io-read is very slow
> (~18us), and done while holding a lock. It would be possible that one
> cpu calling gettimeofday would do the following:
> 
> grab xtime sequence read lock
> grab i8253 spin lock
> do port io (very slow)
> release i8253 spin lock
> realize xtime has been grabed and repeat
> 
> While another cpu does the following after in a timer interrupt:
> Grabs xtime sequence write lock
> spins trying to grab i8253 spin lock
> 
> Assuming the first thread can reacquire the i8253 lock before the
> second, you could have both threads potentially spinning forever.

Is there any actual need to hold xtime_lock while doing the port IO?  I'd
have thought it would suffice to do

	temp = port_io
	write_seqlock(xtime_lock);
	xtime = muck_with(temp);
	write_sequnlock(xtime_lock);

?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux