Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp638359pxy; Thu, 22 Apr 2021 09:56:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdGj9QTlSb2hPFjTO1pDfvuKMChTNK3VtQeR9kMj4zqonYRD9hnqJjY/l+rdSpgFdpPJdC X-Received: by 2002:a17:906:64f:: with SMTP id t15mr4299772ejb.411.1619110594006; Thu, 22 Apr 2021 09:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619110593; cv=none; d=google.com; s=arc-20160816; b=Icy5TzwZRv2yXeI36IcCaDeuZRULXxHJ4W5patcSYL4AY29+jblyLwTYZ5FHMR8ofk +bAY0GrZT2XzyGfCKA9W/3JiXO5U3EDms8QHQy77gsPeiaObJw1sJjcUu4ld+DG71dx/ yTBzjocEgNK4+LNgXQQICVHw5BHHzO4blQkOJf6Yf2evyLo29zfhFOLEfK4396Xo7cii Fy5784t/6okh9g2fCNXkYDFyMgv9Fuai3j0hwbslmqnYB0nBTiydsn9YNNzT0heWrI4S L5XOIaLpgIbcBv/UCE0ur/G27bXapS00nhPC8BVpSilSm+Ba8/Mwfl0r0GHtbDUtgojD t97A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=XG6qBWLFNz/AqhqAWQfZJ7k4Ks9oo6GMI4DReGuXrwk=; b=J6GxuodcibpVGqol7Ffrgpr0AFD0JILV6vGnDOR7QhWebjGG8sbG8f0iFqPjWO7J+R 0OEQpLEd3MxPUZbHDS1XsSPxo8MGfqoWzutWBOWuVJ/XALCCw3Z7rRi+eKZVIJHiDMFf vEnyQcTc4wNr1xttRqdRo53vwY9j8IXMf7CB4gZDnnSSfB9OfoWGFneVH522y/exrjH9 i3hPJC5Ly5SEf8bM+DsU8n6bssDih+nYsojOiRKLDuZuDbg1dWDijFopVnJ6ZG+W6gUq hcnXE+HFt8miiaJMitSGCIM/wM9RZlmjufgXoI0A+hHcEUQ6odF5zN0V3xFUt6RPZ6LA +anA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si2819510edd.322.2021.04.22.09.56.07; Thu, 22 Apr 2021 09:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238083AbhDVQzn (ORCPT + 99 others); Thu, 22 Apr 2021 12:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236287AbhDVQzm (ORCPT ); Thu, 22 Apr 2021 12:55:42 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B5F36C06174A; Thu, 22 Apr 2021 09:55:07 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 8917892009C; Thu, 22 Apr 2021 18:55:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 82EC392009B; Thu, 22 Apr 2021 18:55:06 +0200 (CEST) Date: Thu, 22 Apr 2021 18:55:06 +0200 (CEST) From: "Maciej W. Rozycki" To: "H. Nikolaus Schaller" cc: Jiaxun Yang , Arnd Bergmann , Thomas Bogendoerfer , Huacai Chen , Huacai Chen , linux-arch@vger.kernel.org, "linux-mips@vger.kernel.org" , Linux Kernel Mailing List , Paul Boddie , Lubomir Rintel Subject: Re: [PATCH 0/4] Reinstate and improve MIPS `do_div' implementation In-Reply-To: <895956F9-4EBC-4C8A-9BF2-7E457E96C1D7@goldelico.com> Message-ID: References: <51BC7C74-68BF-4A8E-8CFB-DB4EBBC89706@goldelico.com> <2d636696-35f0-4731-b1c3-5445a57964fb@www.fastmail.com> <895956F9-4EBC-4C8A-9BF2-7E457E96C1D7@goldelico.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Apr 2021, H. Nikolaus Schaller wrote: > > 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]). Have you used it as a module or at bootstrap? I have noticed that at bootstrap the initialisation of the random number generator sometimes interferes with the benchmark, which happens when there's an intervening message produced, e.g.: test_div64: Starting 64bit/32bit division and modulo test random: fast init done test_div64: Completed 64bit/32bit division and modulo test, 1.069906272s elapsed I think it can be worked around by configuration changes so that more stuff is run between the RNG and the test module, but instead I have simply inserted: mdelay(5000); at the beginning of `test_div64_init' instead, as for historical reasons I haven't got the systems involved set up for modules (beyond Linux 2.4) at this time. NB I have run the benchmark five times with each change and system and with the RNG taken out of the picture results were very stable as any fluctuation only started at the fifth decimal digit. Both the DECstation (the model I used anyway) and the Malta have a high-resolution clock source though, the I/O ASIC free-running counter register at 25MHz (used by David L. Mills, the original author of the NTP suite, for his reference implementation) and the CP0 Count register at 80MHz respectively. I would expect your JZ4730 device to have the CP0 Count register as well, as it has been architectural ever since MIPS III really, or is your system SMP with CP0 Count registers out of sync across CPUs due to sleep modes or whatever? Thanks for sharing your figures. > [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. Good luck with that! Maciej