get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2221867/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2221867,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221867/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/20260410120318.794680738@kernel.org/",
    "project": {
        "id": 10,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/10/?format=api",
        "name": "Linux SPARC Development ",
        "link_name": "sparclinux",
        "list_id": "sparclinux.vger.kernel.org",
        "list_email": "sparclinux@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260410120318.794680738@kernel.org>",
    "list_archive_url": null,
    "date": "2026-04-10T12:19:56",
    "name": "[18/38] lib/tests: Replace get_cycles() with ktime_get()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2318e54948a768df93b2779d386c13366ecc367b",
    "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/sparclinux/patch/20260410120318.794680738@kernel.org/mbox/",
    "series": [
        {
            "id": 499450,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499450/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/sparclinux/list/?series=499450",
            "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/499450/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221867/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221867/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=nTJc=CJ=vger.kernel.org=sparclinux+bounces-6666-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "sparclinux@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=dAmn2yz6;\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=ntjc=cj=vger.kernel.org=sparclinux+bounces-6666-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c04:e001:36c::12fc:5321\"\n 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=dAmn2yz6;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=sparclinux+bounces-6666-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=\"dAmn2yz6\"",
            "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 4fsblQ4HzBz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:31:46 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fsblQ3nN2z4wJP\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:31:46 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fsblQ3hMsz4wK5; Fri, 10 Apr 2026 22:31:46 +1000 (AEST)",
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\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 4fsblL1Qt5z4wJP\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 22:31:42 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id A5C25307885A\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 10 Apr 2026 12:23:50 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 82F783D8912;\n\tFri, 10 Apr 2026 12:20:00 +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 4F9123C9EFE;\n\tFri, 10 Apr 2026 12:20:00 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 25608C2BC87;\n\tFri, 10 Apr 2026 12:19:59 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775824306; cv=pass;\n\tb=ves4VefRDoDx/UMwNMOGa8s5UEjSRGxds/o60cVPIGxVt1RsdfJ3QJdXX1UUXflBmQeuYEUvAzCyPSlBgGo8jcgc7FMh637tq93CPEOTuRHS7rIyE34GtGmwbQ7KfDqzrp6g/0gLJtNYsZmRgSDSAQQ7oljeZn8RDR6eOmByy3nN4R/q8SMT0Gzl+Qt3ftXe2CtVWdMRtX/L5OxDDqyUbpEUjrIZCAXr570C/GonPYlrpSsl2STbhPAEQMEGn1lhAj+33OBZNqLFd+JiFiPQApSCjZSm6WzHDQoUiHcOc4DFg2IngpZvX71cv3E3KomtF5yicGDD8ZpPYT66X7nT/A==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775823600; cv=none;\n b=BA04YgR7ol+UFlnyeMGxIX9JJapi5P+DpwD+4z8F5mYUkgC3uR84zQ7PuKPZffWeJrEzxORq5hn6JNhkozHotqQDgtN1O1RKmTM3RJHM2HVfRLJNtf3mBi1U/3QWwgTEvlvipTFs1aI52maDwx2GPlFGLfPYh4KQkj5JSSNZOpc="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775824306; c=relaxed/relaxed;\n\tbh=K4NT27D0mqg0VfaBgETboxq8yA7MxcA9Ab7uPnykYS8=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=Vy/7lUTbenMVZK2fwI3FRSHpzZ6bIugJMpQsq64CKoqTQ1TvH+bHxc+TaaEAJ5GU77a5UcJtqMfHzUjVt9LtUkmSlDt8322f30Bj+Ol8Y8MGbmqK/Hjt7GEB8BoUjn+n5KZuGSFj6ojvy2IKreQi1E1B5z4QogcB/GSCEiWovBAtO31RImSYVMay7f6R5DHxHY4MsPnWt/fTljVmwof1AB2j3SN0n1XLeS7GEsM40WRbI53HWBRNeNmhBnBU0fNJpPbbNLpG5mPC33pkWM7BVWIgwKn9SrDN3ru+bDsF/gBr3lhRC53mFq6Ce2AcRuFGd2wSOXRBoCfAdGrrquswFw==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775823600; c=relaxed/simple;\n\tbh=p4ShM3O0GBFCP2qPjb6zSxh+Ha5oLOtvBK8/RtfAnVs=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=bPz3KR+7Cs1qoa7AMSZYQs3mwFwGiVffmg3WafL7SkDEqsFq+dGsYvb+yx1PAoJ6dwHFVet5WDt8IlMLiGvP64fHX3iYLiZmHKvXzhPh5t7jWb5XB63t/tTLp224p2GKOSybc/2KSAYtgmbVXmWs6v4UCtSMZ+ZjCOYL2aLNnrs="
        ],
        "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=dAmn2yz6; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=sparclinux+bounces-6666-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=dAmn2yz6; 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=1775823599;\n\tbh=p4ShM3O0GBFCP2qPjb6zSxh+Ha5oLOtvBK8/RtfAnVs=;\n\th=Date:From:To:Cc:Subject:References:From;\n\tb=dAmn2yz62WI0i12fcQ9F03BvOYg2+eAhjig+X04BVmpX8c9M01sHZgZEu1rVRhWki\n\t aMBfoGnUl9WpMMqLWFryj6yJQ9lwTCD1i0oDG/S5mN25bXyGqKT30GrztgQQ3rav4T\n\t BmbqmYb8KPxXW6sSQ9CXXe5EvhipWJeX23ghk7uDybakuO9EcTg4cMG5iBSrRe/GPa\n\t tJ33MSKa5EFjbZHZi72K/jby5Pm2bPWRte8ZG3Zb5p2f71WeXeB85PUV24dYQuwkS9\n\t ZuUw9oOAlqL+roK/1FBLE3TIhiCqSUqlbqWXBE/GwV9uTSEnFXIo6OPA+8wwtYtllu\n\t kFOMRP9PboEEQ==",
        "Date": "Fri, 10 Apr 2026 14:19:56 +0200",
        "Message-ID": "<20260410120318.794680738@kernel.org>",
        "User-Agent": "quilt/0.68",
        "From": "Thomas Gleixner <tglx@kernel.org>",
        "To": "LKML <linux-kernel@vger.kernel.org>",
        "Cc": "Andrew Morton <akpm@linux-foundation.org>,\n Uladzislau Rezki <urezki@gmail.com>,\n linux-mm@kvack.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 Herbert Xu <herbert@gondor.apana.org.au>,\n linux-crypto@vger.kernel.org,\n Vlastimil Babka <vbabka@kernel.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 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 18/38] lib/tests: Replace get_cycles() with ktime_get()",
        "References": "<20260410120044.031381086@kernel.org>",
        "Precedence": "bulk",
        "X-Mailing-List": "sparclinux@vger.kernel.org",
        "List-Id": "<sparclinux.vger.kernel.org>",
        "List-Subscribe": "<mailto:sparclinux+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:sparclinux+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: Andrew Morton <akpm@linux-foundation.org>\nCc: Uladzislau Rezki <urezki@gmail.com>\nCc: linux-mm@kvack.org\n---\n lib/interval_tree_test.c |   16 ++++++++--------\n lib/rbtree_test.c        |   46 +++++++++++++++++++++++-----------------------\n lib/test_vmalloc.c       |   10 +++++-----\n 3 files changed, 36 insertions(+), 36 deletions(-)",
    "diff": "--- a/lib/interval_tree_test.c\n+++ b/lib/interval_tree_test.c\n@@ -65,13 +65,13 @@ static void init(void)\n static int basic_check(void)\n {\n \tint i, j;\n-\tcycles_t time1, time2, time;\n+\tktime_t time1, time2, time;\n \n \tprintk(KERN_ALERT \"interval tree insert/remove\");\n \n \tinit();\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (j = 0; j < nnodes; j++)\n@@ -80,11 +80,11 @@ static int basic_check(void)\n \t\t\tinterval_tree_remove(nodes + j, &root);\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> %llu cycles\\n\", (unsigned long long)time);\n+\tprintk(\" -> %llu nsecs\\n\", (unsigned long long)time);\n \n \treturn 0;\n }\n@@ -93,7 +93,7 @@ static int search_check(void)\n {\n \tint i, j;\n \tunsigned long results;\n-\tcycles_t time1, time2, time;\n+\tktime_t time1, time2, time;\n \n \tprintk(KERN_ALERT \"interval tree search\");\n \n@@ -102,7 +102,7 @@ static int search_check(void)\n \tfor (j = 0; j < nnodes; j++)\n \t\tinterval_tree_insert(nodes + j, &root);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tresults = 0;\n \tfor (i = 0; i < search_loops; i++)\n@@ -113,12 +113,12 @@ static int search_check(void)\n \t\t\tresults += search(&root, start, last);\n \t\t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, search_loops);\n \tresults = div_u64(results, search_loops);\n-\tprintk(\" -> %llu cycles (%lu results)\\n\",\n+\tprintk(\" -> %llu nsecs (%lu results)\\n\",\n \t       (unsigned long long)time, results);\n \n \tfor (j = 0; j < nnodes; j++)\n--- a/lib/rbtree_test.c\n+++ b/lib/rbtree_test.c\n@@ -243,14 +243,14 @@ static void check_augmented(int nr_nodes\n static int basic_check(void)\n {\n \tint i, j;\n-\tcycles_t time1, time2, time;\n+\tktime_t time1, time2, time;\n \tstruct rb_node *node;\n \n \tprintk(KERN_ALERT \"rbtree testing\");\n \n \tinit();\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (j = 0; j < nnodes; j++)\n@@ -259,14 +259,14 @@ static int basic_check(void)\n \t\t\terase(nodes + j, &root);\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> test 1 (latency of nnodes insert+delete): %llu cycles\\n\",\n+\tprintk(\" -> test 1 (latency of nnodes insert+delete): %llu nsecs\\n\",\n \t       (unsigned long long)time);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (j = 0; j < nnodes; j++)\n@@ -275,52 +275,52 @@ static int basic_check(void)\n \t\t\terase_cached(nodes + j, &root);\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> test 2 (latency of nnodes cached insert+delete): %llu cycles\\n\",\n+\tprintk(\" -> test 2 (latency of nnodes cached insert+delete): %llu nsecs\\n\",\n \t       (unsigned long long)time);\n \n \tfor (i = 0; i < nnodes; i++)\n \t\tinsert(nodes + i, &root);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (node = rb_first(&root.rb_root); node; node = rb_next(node))\n \t\t\t;\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> test 3 (latency of inorder traversal): %llu cycles\\n\",\n+\tprintk(\" -> test 3 (latency of inorder traversal): %llu nsecs\\n\",\n \t       (unsigned long long)time);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++)\n \t\tnode = rb_first(&root.rb_root);\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n \tprintk(\" -> test 4 (latency to fetch first node)\\n\");\n-\tprintk(\"        non-cached: %llu cycles\\n\", (unsigned long long)time);\n+\tprintk(\"        non-cached: %llu nsecs\\n\", (unsigned long long)time);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++)\n \t\tnode = rb_first_cached(&root);\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\"        cached: %llu cycles\\n\", (unsigned long long)time);\n+\tprintk(\"        cached: %llu nsecs\\n\", (unsigned long long)time);\n \n \tfor (i = 0; i < nnodes; i++)\n \t\terase(nodes + i, &root);\n@@ -345,13 +345,13 @@ static int basic_check(void)\n static int augmented_check(void)\n {\n \tint i, j;\n-\tcycles_t time1, time2, time;\n+\tktime_t time1, time2, time;\n \n \tprintk(KERN_ALERT \"augmented rbtree testing\");\n \n \tinit();\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (j = 0; j < nnodes; j++)\n@@ -360,13 +360,13 @@ static int augmented_check(void)\n \t\t\terase_augmented(nodes + j, &root);\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> test 1 (latency of nnodes insert+delete): %llu cycles\\n\", (unsigned long long)time);\n+\tprintk(\" -> test 1 (latency of nnodes insert+delete): %llu nsecs\\n\", (unsigned long long)time);\n \n-\ttime1 = get_cycles();\n+\ttime1 = ktime_get();\n \n \tfor (i = 0; i < perf_loops; i++) {\n \t\tfor (j = 0; j < nnodes; j++)\n@@ -375,11 +375,11 @@ static int augmented_check(void)\n \t\t\terase_augmented_cached(nodes + j, &root);\n \t}\n \n-\ttime2 = get_cycles();\n+\ttime2 = ktime_get();\n \ttime = time2 - time1;\n \n \ttime = div_u64(time, perf_loops);\n-\tprintk(\" -> test 2 (latency of nnodes cached insert+delete): %llu cycles\\n\", (unsigned long long)time);\n+\tprintk(\" -> test 2 (latency of nnodes cached insert+delete): %llu nsecs\\n\", (unsigned long long)time);\n \n \tfor (i = 0; i < check_loops; i++) {\n \t\tinit();\n--- a/lib/test_vmalloc.c\n+++ b/lib/test_vmalloc.c\n@@ -454,8 +454,8 @@ static struct test_driver {\n \tstruct task_struct *task;\n \tstruct test_case_data data[ARRAY_SIZE(test_case_array)];\n \n-\tunsigned long start;\n-\tunsigned long stop;\n+\tktime_t start;\n+\tktime_t stop;\n } *tdriver;\n \n static void shuffle_array(int *arr, int n)\n@@ -490,7 +490,7 @@ static int test_func(void *private)\n \t */\n \tsynchronize_srcu(&prepare_for_test_srcu);\n \n-\tt->start = get_cycles();\n+\tt->start = ktime_get();\n \tfor (i = 0; i < ARRAY_SIZE(test_case_array); i++) {\n \t\tindex = random_array[i];\n \n@@ -519,7 +519,7 @@ static int test_func(void *private)\n \n \t\tt->data[index].time = delta;\n \t}\n-\tt->stop = get_cycles();\n+\tt->stop = ktime_get();\n \ttest_report_one_done();\n \n \t/*\n@@ -619,7 +619,7 @@ static void do_concurrent_test(void)\n \t\t\t\tt->data[j].time);\n \t\t}\n \n-\t\tpr_info(\"All test took worker%d=%lu cycles\\n\",\n+\t\tpr_info(\"All test took worker%d=%lld nsecs\\n\",\n \t\t\ti, t->stop - t->start);\n \t}\n \n",
    "prefixes": [
        "18/38"
    ]
}