Re: [BUG] long freezes on thinkpad t60

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

 



* Linus Torvalds <[email protected]> wrote:

> On Thu, 21 Jun 2007, Ingo Molnar wrote:
> > 
> > damn, i first wrote up an explanation about why that ugly __delay(1) is 
> > there (it almost hurts my eyes when i look at it!) but then deleted it 
> > as superfluous :-/
> 
> I'm fine with a delay, but the __delay(1) is simply not "correct". It 
> doesn't do anything.

it's a bit trickier than that. Yes, it's a simple 1-entry loop and thus 
makes little sense to call. But it's a loop that got boot-time 
calibrated, so we can do this in the spinlock-debug code:

        u64 loops = loops_per_jiffy * HZ;

this guarantees that we will loop for _at least_ 1 second before 
printing a message. (in practice it's much longer, especially with the 
current naive trylock approach)

Why? Because as part of the activities that the spin-loop does, we also 
do everything that an mdelay(1000) would do. We do it 'piecemail-wise', 
and we do it very inefficiently, but the lower time-bound should be 
guaranteed. This is done because most of the problems were caused by too 
short looping and bogus debug printouts. So this is basically an 
open-coded udelay implementation.

Furthermore, with the spin_is_locked() fix i just sent, the __loop(1) 
solution should actually be quite close to a real udelay() thing, 
without the delay effect. It would probably more accurate to increase it 
to loops_per_jiffy*10*HZ/16 and to call a __loop(16) thing, to get 
closer timings. (but then some people would argue 'why dont you take the 
lock as soon as it's released'.)

	Ingo
-
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