Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 2019 12:07:33 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        Bruce Evans <brde@optusnet.com.au>, freebsd-hackers Hackers <freebsd-hackers@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: powerpc64 head -r344018 stuck sleeping problems: th->th_scale * tc_delta(th) overflows unsigned 64 bits sometimes [patched failed]
Message-ID:  <EA4374C2-07F8-4D48-8D56-31B36295C389@yahoo.com>
In-Reply-To: <87D6CBD5-AE55-4EC8-8797-D8A9DC3D5A5A@yahoo.com>
References:  <D3D7E9F4-9A5E-4320-B3C8-EC5CEF4A2764@yahoo.com> <20190228145542.GT2420@kib.kiev.ua> <20190228150811.GU2420@kib.kiev.ua> <962D78C3-65BE-40C1-BB50-A0088223C17B@yahoo.com> <28C2BB0A-3DAA-4D18-A317-49A8DD52778F@yahoo.com> <20190301112717.GW2420@kib.kiev.ua> <20190302043936.A4444@besplex.bde.org> <20190301194217.GB68879@kib.kiev.ua> <87D6CBD5-AE55-4EC8-8797-D8A9DC3D5A5A@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EA4374C2-07F8-4D48-8D56-31B36295C389>