Re: panic with tg_shares_up again?

From: Yinghai Lu
Date: Tue Dec 23 2008 - 20:32:14 EST


Ken Chen wrote:
> On Tue, Dec 23, 2008 at 3:46 PM, Ken Chen <kenchen@xxxxxxxxxx> wrote:
>> And from my local build of linux-tip with the patch, I have the
>> following assembly:
>> 1 ffffffff8023b74f: 48 8b 88 a8 00 00 00 mov 0xa8(%rax),%rcx
>> 2 ffffffff8023b756: 48 c7 45 d0 00 00 00 movq $0x0,-0x30(%rbp)
>> 3 ffffffff8023b75d: 00
>> 4 ffffffff8023b75e: 48 85 c9 test %rcx,%rcx
>> 5 ffffffff8023b761: 0f 95 c0 setne %al
>> 6 ffffffff8023b764: 84 45 af test %al,-0x51(%rbp)
>> 7 ffffffff8023b767: 74 15 je ffffffff8023b77e
>> 8 ffffffff8023b769: 48 8b 45 b8 mov -0x48(%rbp),%rax
>> 9 ffffffff8023b76d: 31 d2 xor %edx,%edx
>> 10 ffffffff8023b76f: 48 0f af c1 imul %rcx,%rax
>> 11 ffffffff8023b773: 48 f7 75 b0 divq -0x50(%rbp)
>>
>> line 6 is the compare against sd_rq_weight, but it was only to one
>> byte instead of the entire unsigned long.
>>
>> /me scratching my head ....
>
> After a couple of hours joggling with type cast and different order in
> which these two variables are checked, the compiler I'm using seems to
> insist only check one byte out of sd_rq_weight. I give up for the day
> and removed the 'static' function declaration of
> update_group_shares_cpu(). Without the 'static', the assembly looks
> alright to me.
>
> I will ask compiler expert to see what's wrong with this code. For
> now, the following add on patch seems generate correct x86 assembly
> code.

maybe my compiler has some problem too? just upgrade to opensuse 11.1 last week.

yhlu@linux-mstp:~/xx/xx/kernel/tip/linux-2.6> gcc --version
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/