Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221872/?format=api
{ "id": 2221872, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221872/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260410120318.454577282@kernel.org/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/1.2/projects/8/?format=api", "name": "Linux ext4 filesystem development", "link_name": "linux-ext4", "list_id": "linux-ext4.vger.kernel.org", "list_email": "linux-ext4@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260410120318.454577282@kernel.org>", "list_archive_url": null, "date": "2026-04-10T12:19:31", "name": "[13/38] crypto: tcrypt: Replace get_cycles() with ktime_get()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e1f016302ca1535f26c392b1326392638699326f", "submitter": { "id": 92397, "url": "http://patchwork.ozlabs.org/api/1.2/people/92397/?format=api", "name": "Thomas Gleixner", "email": "tglx@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260410120318.454577282@kernel.org/mbox/", "series": [ { "id": 499451, "url": "http://patchwork.ozlabs.org/api/1.2/series/499451/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=499451", "date": "2026-04-10T12:18:27", "name": "treewide: Cleanup LATCH, CLOCK_TICK_RATE and get_cycles() [ab]use", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499451/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221872/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221872/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=bZdn=CJ=vger.kernel.org=linux-ext4+bounces-15748-patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-ext4@vger.kernel.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "patchwork-incoming@ozlabs.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=kdLSbwwL;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=bzdn=cj=vger.kernel.org=linux-ext4+bounces-15748-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=104.64.211.4 arc.chain=subspace.kernel.org", "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org", "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=kdLSbwwL;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15748-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"kdLSbwwL\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsbmB0nL4z1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:32:26 +1000 (AEST)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fsbmB0HMYz4wJV\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:32:26 +1000 (AEST)", "by gandalf.ozlabs.org (Postfix)\n\tid 4fsbmB0Bqxz4wT4; Fri, 10 Apr 2026 22:32:26 +1000 (AEST)", "from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fsbm65hwhz4wJV\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 22:32:22 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 1FA8A309D370\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 12:22:05 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C7C7D3C7E1E;\n\tFri, 10 Apr 2026 12:19:35 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 810AB3BADB4;\n\tFri, 10 Apr 2026 12:19:35 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 2D535C19421;\n\tFri, 10 Apr 2026 12:19:34 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775824346; cv=pass;\n\tb=TVMxytZH/TyaRHxMoF89wNQSXla0nL92ImTmG7C1TD5IMj8knguGQSG4psnd3g/PyDXgLA1el+CJWl3CEekWOr3KO4X3gK2WNJPezH4hb3bFWakUQUF+9VU/BggLI59Umv9qDdthEKKDpsv3qNpEvduY+YgniILC3esNuSJgCtWLcfVI8jUsdIYNUsYOH0GakfM0D5prGQLfip2YgDegxCU+wrkq+02rM5Bb9VtAkEuEfvL14v3BXC+yvDE6A1RyaWlYyr0+5t9hoppSQejbp3Emny9WcR5TGmpLGWg3orQd2sewWcG3ht1tnjRfjcUOG0NV9yi8kkDOwvEHeNdkEw==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775823575; cv=none;\n b=ofgh+PvuO0lxABxnJ5gkDdfHST6+naXUl7euh22VIARdnNwmpQwHdJnlCVI2dRd9IJVf8inMUMRrqS5VXeyuYBCryzTOYvWClXAptY/V0/Up8vKsN8IoyJWXHEw9OfEIjvGJ0902L8qRYtyE39f1qcwsjO/Pwcgi6R5GZ58w0as=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775824346; c=relaxed/relaxed;\n\tbh=nAtajafR3BGugPFTQaw0hsS1PwnKW5jZr3s/Jt7L67s=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=K1HF5VVctA/Z6DslkgFkK/zRB0FT7mMzPn3pYXkDEJ6vHOhvJuxC+mNTrDr2/hvzUYb70QADsFfzLbzb+q8Muz6M9PprAkmtgViu3+ZKy3M3+YXOkqmG1K9qqThCtTjE6jK0PpVhQ4Y7K+/lGkBW3Gh3lenW+eT9ug5hSiIPy9Ycg0RocgCFDKKAXPOGGco0/S1VHOpbmEyoiW6UuHfhtooB23JotTYp1JCxh9Y4BLKMnVyyxzGI9B0oHyxDtSkzhUAL2tZSsyjXTAozdfl4GuW4fZN+32C7QeCQXyiMuTYA3bcGqfXjuV4jPDT1bqtc0PsZSDGNhlkPqvwVLnw4qQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775823575; c=relaxed/simple;\n\tbh=GB9a/XQKSHIwV9FYvefMOZoOdepkVaVbWcUyHQeAJMw=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=raGfblO+FxRYKmmu0rrIwE83eUii33gUA+Qd3o14/8XlIYmb2m5jpdm83UN+OYtHvMn1M29xxLaOPLBR39zIlm+FxFsVZV0ITd1zyVcI1sckJCHKNB1fi264dD3zs1i/5t/iw+XAITqJa7Q9uRj+zeWkKqvx/FqB16DbyWIvBpE=" ], "ARC-Authentication-Results": [ "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=kdLSbwwL; dkim-atps=neutral;\n spf=pass (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15748-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org", "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=kdLSbwwL; arc=none smtp.client-ip=10.30.226.201" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775823575;\n\tbh=GB9a/XQKSHIwV9FYvefMOZoOdepkVaVbWcUyHQeAJMw=;\n\th=Date:From:To:Cc:Subject:References:From;\n\tb=kdLSbwwLxIuQWDxnaQ43x3JS9cXZHSMpULEhhU8ID9ECY5jS+n7m20CMk0YroM4U5\n\t D4FjOptptOJeolxHIofJ3rTeQ/ALPjLpvnJ7Qi7NqzIwHDqURUXi9DJGGx8dZS+lLk\n\t JCAzGIYvaKballV64My3qHcmSE8ptIN1eu7xnjzlOO9PgVdkDRLJV0RvV58tiiKr4i\n\t bv+wJwmXD1eqFR2U5N9wMLLyoNfqxlEArSV4W94QZ6qgCudbzRKlUn/CHtSVarPoCX\n\t xb06JWRkDGSiFGx6qUkcv+KUlCb5xHLy85m3KWHYpSlfnAmYw64l8Tsoi4lMULg/pB\n\t WwpH4H0qB6HQQ==", "Date": "Fri, 10 Apr 2026 14:19:31 +0200", "Message-ID": "<20260410120318.454577282@kernel.org>", "User-Agent": "quilt/0.68", "From": "Thomas Gleixner <tglx@kernel.org>", "To": "LKML <linux-kernel@vger.kernel.org>", "Cc": "Herbert Xu <herbert@gondor.apana.org.au>,\n linux-crypto@vger.kernel.org,\n Arnd Bergmann <arnd@arndb.de>,\n x86@kernel.org,\n Lu Baolu <baolu.lu@linux.intel.com>,\n iommu@lists.linux.dev,\n Michael Grzeschik <m.grzeschik@pengutronix.de>,\n netdev@vger.kernel.org,\n linux-wireless@vger.kernel.org,\n Vlastimil Babka <vbabka@kernel.org>,\n linux-mm@kvack.org,\n David Woodhouse <dwmw2@infradead.org>,\n Bernie Thompson <bernie@plugable.com>,\n linux-fbdev@vger.kernel.org,\n \"Theodore Tso\" <tytso@mit.edu>,\n linux-ext4@vger.kernel.org,\n Andrew Morton <akpm@linux-foundation.org>,\n Uladzislau Rezki <urezki@gmail.com>,\n Marco Elver <elver@google.com>,\n Dmitry Vyukov <dvyukov@google.com>,\n kasan-dev@googlegroups.com,\n Andrey Ryabinin <ryabinin.a.a@gmail.com>,\n Thomas Sailer <t.sailer@alumni.ethz.ch>,\n linux-hams@vger.kernel.org,\n \"Jason A. Donenfeld\" <Jason@zx2c4.com>,\n Richard Henderson <richard.henderson@linaro.org>,\n linux-alpha@vger.kernel.org,\n Russell King <linux@armlinux.org.uk>,\n linux-arm-kernel@lists.infradead.org,\n Catalin Marinas <catalin.marinas@arm.com>,\n Huacai Chen <chenhuacai@kernel.org>,\n loongarch@lists.linux.dev,\n Geert Uytterhoeven <geert@linux-m68k.org>,\n linux-m68k@lists.linux-m68k.org,\n Dinh Nguyen <dinguyen@kernel.org>,\n Jonas Bonn <jonas@southpole.se>,\n linux-openrisc@vger.kernel.org,\n Helge Deller <deller@gmx.de>,\n linux-parisc@vger.kernel.org,\n Michael Ellerman <mpe@ellerman.id.au>,\n linuxppc-dev@lists.ozlabs.org,\n Paul Walmsley <pjw@kernel.org>,\n linux-riscv@lists.infradead.org,\n Heiko Carstens <hca@linux.ibm.com>,\n linux-s390@vger.kernel.org,\n \"David S. Miller\" <davem@davemloft.net>,\n sparclinux@vger.kernel.org", "Subject": "[patch 13/38] crypto: tcrypt: Replace get_cycles() with ktime_get()", "References": "<20260410120044.031381086@kernel.org>", "Precedence": "bulk", "X-Mailing-List": "linux-ext4@vger.kernel.org", "List-Id": "<linux-ext4.vger.kernel.org>", "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org" }, "content": "get_cycles() is the historical access to a fine grained time source, but it\nis a suboptimal choice for two reasons:\n\n - get_cycles() is not guaranteed to be supported and functional on all\n systems/platforms. If not supported or not functional it returns 0,\n which makes benchmarking moot.\n\n - get_cycles() returns the raw counter value of whatever the\n architecture platform provides. The original x86 Time Stamp Counter\n (TSC) was despite its name tied to the actual CPU core frequency.\n That's not longer the case. So the counter value is only meaningful\n when the CPU operates at the same frequency as the TSC or the value is\n adjusted to the actual CPU frequency. Other architectures and\n platforms provide similar disjunct counters via get_cycles(), so the\n result is operations per BOGO-cycles, which is not really meaningful.\n\nUse ktime_get() instead which provides nanosecond timestamps with the\ngranularity of the underlying hardware counter, which is not different to\nthe variety of get_cycles() implementations.\n\nThis provides at least understandable metrics, i.e. operations/nanoseconds,\nand is available on all platforms. As with get_cycles() the result might\nhave to be put into relation with the CPU operating frequency, but that's\nnot any different.\n\nThis is part of a larger effort to remove get_cycles() usage from\nnon-architecture code.\n\nSigned-off-by: Thomas Gleixner <tglx@kernel.org>\nCc: Herbert Xu <herbert@gondor.apana.org.au>\nCc: linux-crypto@vger.kernel.org\n---\n crypto/tcrypt.c | 84 ++++++++++++++++++++++++++++----------------------------\n 1 file changed, 42 insertions(+), 42 deletions(-)", "diff": "--- a/crypto/tcrypt.c\n+++ b/crypto/tcrypt.c\n@@ -202,7 +202,7 @@ static int test_mb_aead_jiffies(struct t\n static int test_mb_aead_cycles(struct test_mb_aead_data *data, int enc,\n \t\t\t int blen, u32 num_mb)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint ret = 0;\n \tint i;\n \tint *rc;\n@@ -220,20 +220,20 @@ static int test_mb_aead_cycles(struct te\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n \n-\t\tstart = get_cycles();\n+\t\tstart = ktime_get();\n \t\tret = do_mult_aead_op(data, enc, num_mb, rc);\n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n-\tpr_cont(\"1 operation in %lu cycles (%d bytes)\\n\",\n-\t\t(cycles + 4) / (8 * num_mb), blen);\n+\tpr_cont(\"1 operation in %lu nsecs (%d bytes)\\n\",\n+\t\tnsecs / (8 * num_mb), blen);\n \n out:\n \tkfree(rc);\n@@ -475,7 +475,7 @@ static int test_aead_jiffies(struct aead\n \n static int test_aead_cycles(struct aead_request *req, int enc, int blen)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint ret = 0;\n \tint i;\n \n@@ -492,25 +492,24 @@ static int test_aead_cycles(struct aead_\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n \n-\t\tstart = get_cycles();\n+\t\tstart = ktime_get();\n \t\tif (enc)\n \t\t\tret = do_one_aead_op(req, crypto_aead_encrypt(req));\n \t\telse\n \t\t\tret = do_one_aead_op(req, crypto_aead_decrypt(req));\n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n out:\n \tif (ret == 0)\n-\t\tpr_cont(\"1 operation in %lu cycles (%d bytes)\\n\",\n-\t\t\t(cycles + 4) / 8, blen);\n+\t\tpr_cont(\"1 operation in %lu nsecs (%d bytes)\\n\", nsecs / 8, blen);\n \n \treturn ret;\n }\n@@ -771,7 +770,7 @@ static int test_ahash_jiffies(struct aha\n static int test_ahash_cycles_digest(struct ahash_request *req, int blen,\n \t\t\t\t char *out)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint ret, i;\n \n \t/* Warm-up run. */\n@@ -783,25 +782,25 @@ static int test_ahash_cycles_digest(stru\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n \n-\t\tstart = get_cycles();\n+\t\tstart = ktime_get();\n \n \t\tret = do_one_ahash_op(req, crypto_ahash_digest(req));\n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n out:\n \tif (ret)\n \t\treturn ret;\n \n-\tpr_cont(\"%6lu cycles/operation, %4lu cycles/byte\\n\",\n-\t\tcycles / 8, cycles / (8 * blen));\n+\tpr_cont(\"%6lu nsecs/operation, %4lu nsecs/byte\\n\",\n+\t\tnsecs / 8, nsecs / (8 * blen));\n \n \treturn 0;\n }\n@@ -809,7 +808,7 @@ static int test_ahash_cycles_digest(stru\n static int test_ahash_cycles(struct ahash_request *req, int blen,\n \t\t\t int plen, char *out)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint i, pcount, ret;\n \n \tif (plen == blen)\n@@ -832,9 +831,9 @@ static int test_ahash_cycles(struct ahas\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n \n-\t\tstart = get_cycles();\n+\t\tstart = ktime_get();\n \n \t\tret = do_one_ahash_op(req, crypto_ahash_init(req));\n \t\tif (ret)\n@@ -848,17 +847,17 @@ static int test_ahash_cycles(struct ahas\n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n out:\n \tif (ret)\n \t\treturn ret;\n \n-\tpr_cont(\"%6lu cycles/operation, %4lu cycles/byte\\n\",\n-\t\tcycles / 8, cycles / (8 * blen));\n+\tpr_cont(\"%6lu nsecs/operation, %4lu nsecs/byte\\n\",\n+\t\tnsecs / 8, nsecs / (8 * blen));\n \n \treturn 0;\n }\n@@ -1019,7 +1018,7 @@ static int test_mb_acipher_jiffies(struc\n static int test_mb_acipher_cycles(struct test_mb_skcipher_data *data, int enc,\n \t\t\t int blen, u32 num_mb)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint ret = 0;\n \tint i;\n \tint *rc;\n@@ -1037,20 +1036,20 @@ static int test_mb_acipher_cycles(struct\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n \n-\t\tstart = get_cycles();\n+\t\tstart = ktime_get();\n \t\tret = do_mult_acipher_op(data, enc, num_mb, rc);\n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n-\tpr_cont(\"1 operation in %lu cycles (%d bytes)\\n\",\n-\t\t(cycles + 4) / (8 * num_mb), blen);\n+\tpr_cont(\"1 operation in %lu nsecs (%d bytes)\\n\",\n+\t\tnsecs / (8 * num_mb), blen);\n \n out:\n \tkfree(rc);\n@@ -1246,7 +1245,7 @@ static int test_acipher_jiffies(struct s\n static int test_acipher_cycles(struct skcipher_request *req, int enc,\n \t\t\t int blen)\n {\n-\tunsigned long cycles = 0;\n+\tunsigned long nsecs = 0;\n \tint ret = 0;\n \tint i;\n \n@@ -1265,27 +1264,28 @@ static int test_acipher_cycles(struct sk\n \n \t/* The real thing. */\n \tfor (i = 0; i < 8; i++) {\n-\t\tcycles_t start, end;\n+\t\tktime_t start, end;\n+\n+\t\tstart = ktime_get();\n \n-\t\tstart = get_cycles();\n \t\tif (enc)\n \t\t\tret = do_one_acipher_op(req,\n \t\t\t\t\t\tcrypto_skcipher_encrypt(req));\n \t\telse\n \t\t\tret = do_one_acipher_op(req,\n \t\t\t\t\t\tcrypto_skcipher_decrypt(req));\n-\t\tend = get_cycles();\n+\t\tend = ktime_get();\n \n \t\tif (ret)\n \t\t\tgoto out;\n \n-\t\tcycles += end - start;\n+\t\tnsecs += (unsigned long)(end - start);\n \t}\n \n out:\n \tif (ret == 0)\n-\t\tpr_cont(\"1 operation in %lu cycles (%d bytes)\\n\",\n-\t\t\t(cycles + 4) / 8, blen);\n+\t\tpr_cont(\"1 operation in %lu nsecs (%d bytes)\\n\",\n+\t\t\tnsecs / 8, blen);\n \n \treturn ret;\n }\n", "prefixes": [ "13/38" ] }