From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752500AbdLLOuF (ORCPT ); Tue, 12 Dec 2017 09:50:05 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:41688 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbdLLOt7 (ORCPT ); Tue, 12 Dec 2017 09:49:59 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171212144955euoutp0247be711808076f819b6dc8bf7f06b0af~-k4Qj7xHY1529115291euoutp02o X-AuditID: cbfec7f5-f79d06d0000031c7-df-5a2fec921fdf From: =?utf-8?Q?=C5=81ukasz_Stelmach?= To: Krzysztof Kozlowski Cc: robh+dt@kernel.org, Stephan Mueller , Herbert Xu , "David S . Miller" , Kukjin Kim , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Szyprowski , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v2 2/4] crypto: exynos - Improve performance of PRNG Date: Tue, 12 Dec 2017 15:49:47 +0100 In-reply-to: Message-id: <877ets6lx0.fsf%l.stelmach@samsung.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-version: 1.0 Content-type: multipart/signed; boundary="=-=-="; micalg="pgp-sha256"; protocol="application/pgp-signature" X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG/c7Ozo7m8jRvL15CVkPM0syE08UyCFpQEASZo7CRB7XclB0d KgVq3nKlpkUi5q2p5W0qU2uh1DRFBGcqSZIT649Eo8T7UqvNo+B/v+97nuf9Hl4+kifS8z3I WGUio1LK48SEA97RZxk6UvQzUHa0f8Sdbi3R8ekyUyZOa2a96ILvczzaZGoR0FNmC0aPGsoI usTUjdFNvZMCOqurV0A/G2zCw/ZIF8bGMKn+9RdM2vFeIm2rf0hI8/X1SLrYtv8KI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hIrF4RA1IjJBAgsXPtc7B6FgFViYef17CC 2JwCwRIP/3SBbeYVMJa4P/8LG4gtKmApca/vLhtEXFDix+R7YL3MAtkSFy6+YZnAyD8LSWoW ktQsoM3MQCet36UPEdaWWLbwNTOEbSuxbt17lgWMrKsYRVJLi3PTc4uN9IoTc4tL89L1kvNz NzEC42TbsZ9bdjB2vQs+xCjAwajEw/vggX6UEGtiWXFl7iFGFaAxjzasvsAoxZKXn5eqJMLb 3QSU5k1JrKxKLcqPLyrNSS0+xCjNwaIkztu7Z3WkkEB6YklqdmpqQWoRTJaJg1OqgXF2+Ybn 8vUevwNNyk5lF35/vc+mZcrORVMqI9jW1++qYeBev2RS9Nlfp1MD3myUN5/za0ecSWO0g9hi ppcXbzL7O895aGCW2z/z+G/XlK/vnDLcxa94f5ZfyWjzJc4iPWeK8Psoo+3bOG8qN7rukDhz qnURn+gb3YWNJjvMkwTLzzxnXJZ+Zo4SS3FGoqEWc1FxIgDXfI1amwIAAA== X-CMS-MailID: 20171212144953eucas1p2079156cb46dc72e2a73868ca2d88ba05 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171212144953eucas1p2079156cb46dc72e2a73868ca2d88ba05 X-RootMTR: 20171212144953eucas1p2079156cb46dc72e2a73868ca2d88ba05 References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable It was <2017-12-11 pon 15:54>, when Krzysztof Kozlowski wrote: > On Mon, Dec 11, 2017 at 3:06 PM, =C5=81ukasz Stelmach wrote: >> Cc: Marek Szyprowski , Bartlomiej >> Zolnierkiewicz > > This should not appear here. A glitch in a scripted invocation of git-format-patch, fixed. >> Use memcpy_fromio() instead of custom exynos_rng_copy_random() function >> to retrieve generated numbers from the registers of PRNG. >> >> Rearrange the loop around cpu_relax(). In a loop with while() at the >> beginning and the cpu_relax() removed the retry variable is decremented >> twice (down to 98). > > I had troubles with understanding this sentence... and then I figured > out that you are referring to some case without cpu_relax(). I do not > see how it is relevant to this case. Compare the new code with old, > not with some imaginary case without barriers (thus maybe reordered?). > > Your solution is strictly performance oriented so it would be nice to > see here the exact difference in numbers justifying the change. But > only the change for while() -> do-while(), not mixed with > memcpy_fromio. Apparently, after trhough tests, I must admit, the way the status register is being polled is insignificant for the performance. I will remove from the patch any changes in the loop. It is the way, the random bytes are copied from the regiesteres, that makes the difference (5.9 MB/s vs 7.1 MB/s) Thank you very much for your assistance in reaching this conclusion. =2D-=20 =C5=81ukasz Stelmach Samsung R&D Institute Poland Samsung Electronics --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCAAGBQJaL+yMAAoJELCuHpyYpYAQDDEIAJEkaEUo7tLg/+kYYdmhBa2a PgYBu4rSJ/xF4MDLpFOZJCW4iuspSBc2nLjnqScQ0h5C9IDlcQS5cRy400pY9x6U X5o6NOPJ8R3QrbUYeMZoUIPuMOzQOMKwPAHdXq6HAx0nPHd4gDLfUIUiInLHHZ9o +O9nlOvH/AZ/i4KizNJK4CDpbTV/0tRJWLBs3ajmNxh6kkc/a+RvF3OAojutPre8 lPY11Q+MyEugnuhVGdU4rrHuJvZ3fUydWtiiCXnZ4vpWgOemNdQjC5yrWXCBkoUu fbW8OOGhZphKoNd1iQWuQ4rvCjt3tqetWUcHMNM6aUFuu0XgW1myAq7RJvYE8Ds= =L6rH -----END PGP SIGNATURE----- --=-=-=--