powerpc64 head -r344018 stuck sleeping problems: th->th_scale * tc_delta(th) overflows unsigned 64 bits sometimes [patched failed]

Mark Millard marklmi at yahoo.com
Sat Mar 2 20:17:53 UTC 2019



On 2019-Mar-1, at 13:19, Mark Millard <marklmi at yahoo.com> wrote:

> On 2019-Mar-1, at 11:42, Konstantin Belousov <kib at freebsd.org> wrote:
> 
>> . . .
>> +#ifdef _LP64
>> +	scale_bits = ffsl(scale);
>> +#else
>> +	scale_bits = ffsll(scale);
>> +#endif. . .
>> +		if (__predict_false(scale_bits + fls(delta) > 63)) {
> 
> 
> The patch from yesterday uniformly used:
> 
> int
> fls(int mask)
> {
>        int bit;
> 
>        if (mask == 0)
>                return (0);
>        for (bit = 1; mask != 1; bit++)
>                mask = (unsigned int)mask >> 1;
>        return (bit);
> }
> 
> that looks for the most significant 1 bit.
> 
> The new patch uses in some places:
> 
> int
> ffsl(long mask)
> {
>        int bit;
> 
>        if (mask == 0)
>                return (0);
>        for (bit = 1; !(mask & 1); bit++)
>                mask = (unsigned long)mask >> 1;
>        return (bit);
> }
> 
> that looks for the least significant 1 bit. Similarly
> for:
> 
> int
> ffsll(long long mask)
> {
>        int bit;
> 
>        if (mask == 0)
>                return (0);
>        for (bit = 1; !(mask & 1); bit++)
>                mask = (unsigned long long)mask >> 1;
>        return (bit);
> }
> 
> Was that deliberate?

Be that as it may:

I've been watching you and Bruce work on a code update. I'm
intending to wait until you let me know you want me to test
before trying again (on the PowerMac G5). (I've not been
testing on anything else: I did not intended to test
systems I've not seen a problem with until after the G5
seemed to be working.)

In part my waiting is because the first patch that I tried
left things unusable and I have to recover from the
consequences of a forced power off. It took a fair amount
of time.

I'd not be surprised if the G5 type of context has another
problem, separate from what I reported and what you are
working on. If so I may not be able to be an effective
tester: the fix may just repeat what I saw the first
time (based on a messed up context).

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-hackers mailing list