Re: [PATCH 0/4] Reinstate and improve MIPS `do_div' implementation

From: H. Nikolaus Schaller
Date: Thu Apr 22 2021 - 12:01:20 EST


Hi,

> Am 22.04.2021 um 15:39 schrieb Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>:
>
>
>
> On Thu, Apr 22, 2021, at 1:53 PM, H. Nikolaus Schaller wrote:
>> Hi,
>>
>>> Am 21.04.2021 um 21:04 schrieb Maciej W. Rozycki <macro@xxxxxxxxxxx>:
>>>
>>> On Wed, 21 Apr 2021, H. Nikolaus Schaller wrote:
>>>
>>>>> In the end I have included four patches on this occasion: 1/4 is the test
>>>>> module, 2/4 is an inline documentation fix/clarification for the `do_div'
>>>>> wrapper, 3/4 enables the MIPS `__div64_32' backend and 4/4 adds a small
>>>>> performance improvement to it.
>>>>
>>>> How can I apply them to the kernel? There is something wrong which makes
>>>> git am fail.
>>>
>>> I don't know. The changes were made against vanilla 5.12-rc7, but then
>>> the pieces affected have not changed for ages. FWIW I can `git am' the
>>> series as received back just fine.
>>
>> Please can you point me to some download/pull/gitweb? It seems as if the series
>> also did not appear at https://patchwork.kernel.org/project/linux-mips/list/
>>
>
> You may try download raw from:
>
> https://lore.kernel.org/linux-mips/E6326E8A-50DA-4F81-9865-F29EE0E298A9@xxxxxxxxxxxxx/T/#t

I simply tried again and it seems that I had tried to git am it on top of the
patches from Huacai which of course fails.

Now I could run the tests:

from [PATCH 4/4]:

> This has passed correctness verification with test_div64 and reduced the
> module's average execution time down to 1.0445s and 0.2619s from 1.0668s
> and 0.2629s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.

test only [PATCH 1/4 and 2/4]:

[ 256.301140] test_div64: Completed 64bit/32bit division and modulo test, 0.291154944s elapsed

+ [PATCH 3/4]

[ 1698.698920] test_div64: Completed 64bit/32bit division and modulo test, 0.132142865s elapsed

+ [PATCH 4/4]

[ 466.818349] test_div64: Completed 64bit/32bit division and modulo test, 0.134429075s elapsed

So the new code is indeed faster than the default implementation.
[PATCH 4/4] has no significant influence (wouldn't say it is slower because timer resolution
isn't very high on this machine and the kernel has some scheduling issue [1]).

Anyways the JZ4730 can boot and works with these patches included.

BR and thanks,
Nikolaus Schaller


[1] we are preparing full support for the JZ4730 based Skytone Alpha machine. Most features
are working except sound/I2S. I2C is a little unreliable and Ethernet has hickups. And scheduling
which indicates some fundamental IRQ or timer issue we could not yet identify.

So if anyone happens to have such a machine and can help debugging, please contact me.