get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124567,
    "url": "https://patches.dpdk.org/api/patches/124567/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230228093916.87206-1-mattias.ronnblom@ericsson.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230228093916.87206-1-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230228093916.87206-1-mattias.ronnblom@ericsson.com",
    "date": "2023-02-28T09:39:14",
    "name": "[RFC,0/2] Add high-performance timer facility",
    "commit_ref": null,
    "pull_url": null,
    "state": null,
    "archived": false,
    "hash": null,
    "submitter": {
        "id": 1077,
        "url": "https://patches.dpdk.org/api/people/1077/?format=api",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230228093916.87206-1-mattias.ronnblom@ericsson.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/124567/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/124567/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C9A3D41D9B;\n\tTue, 28 Feb 2023 10:45:04 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 63B4040EE4;\n\tTue, 28 Feb 2023 10:45:04 +0100 (CET)",
            "from EUR05-AM6-obe.outbound.protection.outlook.com\n (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59])\n by mails.dpdk.org (Postfix) with ESMTP id 2134C4021F\n for <dev@dpdk.org>; Tue, 28 Feb 2023 10:45:02 +0100 (CET)",
            "from AS8PR04CA0175.eurprd04.prod.outlook.com (2603:10a6:20b:331::30)\n by GV1PR07MB8367.eurprd07.prod.outlook.com (2603:10a6:150:22::9) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb\n 2023 09:44:59 +0000",
            "from AM0EUR02FT005.eop-EUR02.prod.protection.outlook.com\n (2603:10a6:20b:331:cafe::e6) by AS8PR04CA0175.outlook.office365.com\n (2603:10a6:20b:331::30) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend\n Transport; Tue, 28 Feb 2023 09:44:59 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n AM0EUR02FT005.mail.protection.outlook.com (10.13.54.71) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id\n 15.20.6156.12 via Frontend Transport; Tue, 28 Feb 2023 09:44:59 +0000",
            "from ESESBMB501.ericsson.se (153.88.183.168) by\n ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2507.17; Tue, 28 Feb 2023 10:44:59 +0100",
            "from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by\n smtp.internal.ericsson.com (153.88.183.184) with Microsoft SMTP Server id\n 15.1.2507.17 via Frontend Transport; Tue, 28 Feb 2023 10:44:58 +0100",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id\n F002F1C006A; Tue, 28 Feb 2023 10:44:58 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=AfOnlIeD5D9zWxjibUYJLghmA8LcVxUm98A7O1SSSm5v7VOVrAKLZnvZpJCc3eijWmcDxTQeERRyr+5iCI8Va0u4zUDcch1m0W37wgjArxTKZh+HuhbPtqCRXslJbYdKYdqn5nu0rgL/qeEvh+saL3aS02ERb6afKnKyvesoCgRRHO4OzZBtyfYpmLhzH2VMF5viEqaguwuRvpKIccWL3IDuC0JuUxYRIGtnEi4Vx63p39XqoNla/yicGLuNRpNdkeK9GsrwKBDne8RqFQhcsa/iVz9Gx6wPhPDGeUfII9dmXjS/8fJ50dsMA28o5+5wgNinOXh50p7+UF96fUvG/g==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=pO1v0jtpNOkieU/aKPT+aHC5KfIKpr08CAiEXwkJaWA=;\n b=cPWH7G+9MJAfoVvE/r/xOHZUSOoUfCYDcacGaajF8dJY33BI2jNNO4TLJPiakfHnE8W+Jj+CEhiFSxE4XBf9GguG9HbpGjgJRfa4IgXtXlLOnPW3cvrRgwOJwSUT9Us1eWgO9DhBF8reauveF/32cjMhggnS7Z2wuS6txBDDZM4dDYYzfvkzEwhENY3a2KLefHRzDQHGPWk4OfOOI0dRjGPPPolU534LP6KMJBq17I/4c3IYYHYjyRbyuuqo/JyKF2P76+UTz/tLTXGknoupZ7+CncWiY4DjbDaZBErR8b1CL/TNQI3CcPb7/8DcMnR9vyPmJXxsdpMn+vcH1p03gg==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com;\n dkim=none (message not signed); arc=none",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 192.176.1.74)\n smtp.mailfrom=ericsson.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=ericsson.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of ericsson.com designates\n 192.176.1.74 as permitted sender)\n receiver=protection.outlook.com;\n client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C",
        "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Erik Gabriel Carrillo <erik.g.carrillo@intel.com>,\n David Marchand <david.marchand@redhat.com>, <maria.lingemark@ericsson.com>,\n Stefan Sundkvist <stefan.sundkvist@ericsson.com>, =?utf-8?q?Mattias_R=C3=B6?=\n\t=?utf-8?q?nnblom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[RFC 0/2] Add high-performance timer facility",
        "Date": "Tue, 28 Feb 2023 10:39:14 +0100",
        "Message-ID": "<20230228093916.87206-1-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Content-Transfer-Encoding": "8bit",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "AM0EUR02FT005:EE_|GV1PR07MB8367:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "7d402c54-b966-4053-b3b4-08db1970751f",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n q1rHsNcrh7+N6H10VuUo9ZNhRVXOqfjvxo5YDZD89vSUc6c6gQjTe3U7Aw+4loe93cK+bODrjPN0D0/dRjwBFEGcY5OCG/EjdK4dek6fMB1ZWkFeWofX3KNc9opf5ZnjMS1xFqEAe+0VLJfQyRdADL3GAmli+4U4kG0D2Vw2/Eo4mtAWCY/3GA2KZIOgjIQD+JaJdtpyIyX+3tnUa4WkfjI9s5gCiKfeIVScPmraH6V0lmJJvMqpyEq37CTrydk32kYse/ar6WX264jOmyOhhL91BsRa52RujfLY0eT8P66BxXEQ7NRN1t4jrg6fEljT/Ac/bWVZ7B4rn3UrmNpiPahjQI+aA+PEaXMMx/oPzdL5Ega0Tgkb9lYy7PyPYXKWAaMmR+tg1jmSZgDFAkmpHNLEPkoizaYhYGEzncUJVk37Y8EqUszv6qLDDSvl2aGhSuU8DyWlmAZ0cW2kntePph3wi+i4W8toAynTqcUOE8cmAzID9MPRMAC1149uLbQi9W6dxdMEzBZhr1ihoRz1CywvpWGjSd0dmP8avMSW924ZSLoFylSKc1sbqK40J1HuMFfSLPjZH/fNt3OBMVfhakU/R5FJXjCfydIYh+9IRHxZBf3aLhEyFvNr5IBZNwAzNCi7b1ClTKpQmIRL7okGL9B3wtG5+Kmalyv++E3rD10msIWTvyvCUeO14hTb7fDdJjDiDM4k18YHg0qtCHdmyA==",
        "X-Forefront-Antispam-Report": "CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net;\n CAT:NONE;\n SFS:(13230025)(4636009)(346002)(39860400002)(136003)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(66574015)(83380400001)(47076005)(54906003)(316002)(336012)(36756003)(4326008)(82960400001)(82740400003)(6916009)(7636003)(36860700001)(40480700001)(8676002)(82310400005)(2616005)(478600001)(40460700003)(186003)(26005)(6266002)(6666004)(107886003)(1076003)(5660300002)(70586007)(2906002)(70206006)(8936002)(86362001)(356005)(41300700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "28 Feb 2023 09:44:59.4475 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 7d402c54-b966-4053-b3b4-08db1970751f",
        "X-MS-Exchange-CrossTenant-Id": "92e84ceb-fbfd-47ab-be52-080c6b87953f",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74];\n Helo=[oa.msg.ericsson.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n AM0EUR02FT005.eop-EUR02.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "GV1PR07MB8367",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "This patchset is an attempt to introduce a high-performance, highly\nscalable timer facility into DPDK.\n\nMore specifically, the goals for the htimer library are:\n\n* Efficient handling of a handful up to hundreds of thousands of\n  concurrent timers.\n* Reduced overhead of adding and canceling timers.\n* Provide a service functionally equivalent to that of\n  <rte_timer.h>. API/ABI backward compatibility is secondary.\n\nIn the author's opinion, there are two main shortcomings with the\ncurrent DPDK timer library (i.e., rte_timer.[ch]).\n\nOne is the synchronization overhead, where heavy-weight full-barrier\ntype synchronization is used. rte_timer.c uses per-EAL/lcore skip\nlists, but any thread may add or cancel (or otherwise access) timers\nmanaged by another lcore (and thus resides in its timer skip list).\n\nThe other is an algorithmic shortcoming, with rte_timer.c's reliance\non a skip list, which, seemingly, is less efficient than certain\nalternatives.\n\nThis patchset implements a hierarchical timer wheel (HWT, in\nrte_htw.c), as per the Varghese and Lauck paper \"Hashed and\nHierarchical Timing Wheels: Data Structures for the Efficient\nImplementation of a Timer Facility\". A HWT is a data structure\npurposely design for this task, and used by many operating system\nkernel timer facilities.\n\nTo further improve the solution described by Varghese and Lauck, a\nbitset is placed in front of each of the timer wheel in the HWT,\nreducing overhead of rte_htimer_mgr_manage() (i.e., progressing time\nand expiry processing).\n\nCycle-efficient scanning and manipulation of these bitsets are crucial\nfor the HWT's performance.\n\nThe htimer module keeps a per-lcore (or per-registered EAL thread) HWT\ninstance, much like rte_timer.c keeps a per-lcore skip list.\n\nTo avoid expensive synchronization overhead for thread-local timer\nmanagement, the HWTs are accessed only from the \"owning\" thread.  Any\ninteraction any other thread has with a particular lcore's timer\nwheel goes over a set of DPDK rings. A side-effect of this design is\nthat all operations working toward a \"remote\" HWT must be\nasynchronous.\n\nThe <rte_htimer.h> API is available only to EAL threads and registered\nnon-EAL threads.\n\nThe htimer API allows the application to supply the current time,\nuseful in case it already has retrieved this for other purposes,\nsaving the cost of a rdtsc instruction (or its equivalent).\n\nRelative htimer does not retrieve a new time, but reuse the current\ntime (as known via/at-the-time of the manage-call), again to shave off\nsome cycles of overhead.\n\nA semantic improvement compared to the <rte_timer.h> API is that the\nhtimer library can give a definite answer on the question if the timer\nexpiry callback was called, after a timer has been canceled.\n\nBelow is a performance data from DPDK's 'app/test' micro benchmarks,\nusing 10k concurrent timers. The benchmarks (test_timer_perf.c and\ntest_htimer_mgr_perf.c) aren't identical in their structure, but the\nnumbers give some indication of the difference.\n\nUse case               htimer  timer\n------------------------------------\nAdd timer                 28    253\nCancel timer              10    412\nAsync add (source lcore)  64\nAsync add (target lcore)  13\n\n(AMD 5900X CPU. Time in TSC.)\n\nPrototype integration of the htimer library into real, timer-heavy,\napplications indicates that htimer may result in significant\napplication-level performance gains.\n\nThe bitset implementation which the HWT implementation depends upon\nseemed generic-enough and potentially useful outside the world of\nHWTs, to justify being located in the EAL.\n\nThis patchset is very much an RFC, and the author is yet to form an\nopinion on many important issues.\n\n* If deemed a suitable replacement, should the htimer replace the\n  current DPDK timer library in some particular (ABI-breaking)\n  release, or should it live side-by-side with the then-legacy\n  <rte_timer.h> API? A lot of things in and outside DPDK depend on\n  <rte_timer.h>, so coexistence may be required to facilitate a smooth\n  transition.\n\n* Should the htimer and htw-related files be colocated with rte_timer.c\n  in the timer library?\n\n* Would it be useful for applications using asynchronous cancel to\n  have the option of having the timer callback run not only in case of\n  timer expiration, but also cancellation (on the target lcore)? The\n  timer cb signature would need to include an additional parameter in\n  that case.\n\n* Should the rte_htimer be a nested struct, so the htw parts be separated\n  from the htimer parts?\n\n* <rte_htimer.h> is kept separate from <rte_htimer_mgr.h>, so that\n  <rte_htw.h> may avoid a depedency to <rte_htimer_mgr.h>. Should it\n  be so?\n\n* rte_htimer struct is only supposed to be used by the application to\n  give an indication of how much memory it needs to allocate, and is\n  its member are not supposed to be directly accessed (w/ the possible\n  exception of the owner_lcore_id field). Should there be a dummy\n  struct, or a #define RTE_HTIMER_MEMSIZE or a rte_htimer_get_memsize()\n  function instead, serving the same purpose? Better encapsulation,\n  but more inconvenient for applications. Run-time dynamic sizing\n  would force application-level dynamic allocations.\n\n* Asynchronous cancellation is a little tricky to use for the\n  application (primarily due to timer memory reclamation/race\n  issues). Should this functionality be removed?\n  \n* Should rte_htimer_mgr_init() also retrieve the current time? If so,\n  there should to be a variant which allows the user to specify the\n  time (to match rte_htimer_mgr_manage_time()). One pitfall with the\n  current proposed API is an application calling rte_htimer_mgr_init()\n  and then immediately adding a timer with a relative timeout, in\n  which case the current absolute time used is 0, which might be a\n  surprise.\n\n* Should libdivide (optionally) be used to avoid the div in the TSC ->\n  tick conversion? (Doesn't improve performance on Zen 3, but may\n  do on other CPUs.) Consider <rte_reciprocal.h> as well.\n\n* Should the TSC-per-tick be rounded up to a power of 2, so shifts can be\n  used for conversion? Very minor performance gains to be found there,\n  at least on Zen 3 cores.\n\n* Should it be possible to supply the time in rte_htimer_mgr_add()\n  and/or rte_htimer_mgr_manage_time() functions as ticks, rather than\n  as TSC? Should it be possible to also use nanoseconds?\n  rte_htimer_mgr_manage_time() would need a flags parameter in that\n  case.\n\n* Would the event timer adapter be best off using <rte_htw.h>\n  directly, or <rte_htimer.h>? In the latter case, there needs to be a\n  way to instantiate more HWTs (similar to the \"alt\" functions of\n  <rte_timer.h>)?\n\n* Should the PERIODICAL flag (and the complexity it brings) be\n  removed? And leave the application with only single-shot timers, and\n  the option to re-add them in the timer callback.\n\n* Should the async result codes and the sync cancel error codes be merged\n  into one set of result codes?\n\n* Should the rte_htimer_mgr_async_add() have a flag which allow\n  buffering add request messages until rte_htimer_mgr_process() is\n  called? Or any manage function. Would reduce ring signaling overhead\n  (i.e., burst enqueue operations instead of single-element\n  enqueue). Could also be a rte_htimer_mgr_async_add_burst() function,\n  solving the same \"problem\" a different way. (The signature of such\n  a function would not be pretty.)\n\n* Does the functionality provided by the rte_htimer_mgr_process()\n  function match its the use cases? Should there me a more clear\n  separation between expiry processing and asynchronous operation\n  processing?\n\n* Should the patchset be split into more commits? If so, how?\n\nThanks to Erik Carrillo for his assistance.\n\nMattias Rönnblom (2):\n  eal: add bitset type\n  eal: add high-performance timer facility\n\n app/test/meson.build             |  10 +-\n app/test/test_bitset.c           | 646 +++++++++++++++++++++++\n app/test/test_htimer_mgr.c       | 674 ++++++++++++++++++++++++\n app/test/test_htimer_mgr_perf.c  | 324 ++++++++++++\n app/test/test_htw.c              | 478 +++++++++++++++++\n app/test/test_htw_perf.c         | 181 +++++++\n doc/api/doxy-api-index.md        |   5 +-\n doc/api/doxy-api.conf.in         |   1 +\n lib/eal/common/meson.build       |   1 +\n lib/eal/common/rte_bitset.c      |  29 +\n lib/eal/include/meson.build      |   1 +\n lib/eal/include/rte_bitset.h     | 878 +++++++++++++++++++++++++++++++\n lib/eal/version.map              |   3 +\n lib/htimer/meson.build           |   7 +\n lib/htimer/rte_htimer.h          |  65 +++\n lib/htimer/rte_htimer_mgr.c      | 488 +++++++++++++++++\n lib/htimer/rte_htimer_mgr.h      | 497 +++++++++++++++++\n lib/htimer/rte_htimer_msg.h      |  44 ++\n lib/htimer/rte_htimer_msg_ring.c |  18 +\n lib/htimer/rte_htimer_msg_ring.h |  49 ++\n lib/htimer/rte_htw.c             | 437 +++++++++++++++\n lib/htimer/rte_htw.h             |  49 ++\n lib/htimer/version.map           |  17 +\n lib/meson.build                  |   1 +\n 24 files changed, 4901 insertions(+), 2 deletions(-)\n create mode 100644 app/test/test_bitset.c\n create mode 100644 app/test/test_htimer_mgr.c\n create mode 100644 app/test/test_htimer_mgr_perf.c\n create mode 100644 app/test/test_htw.c\n create mode 100644 app/test/test_htw_perf.c\n create mode 100644 lib/eal/common/rte_bitset.c\n create mode 100644 lib/eal/include/rte_bitset.h\n create mode 100644 lib/htimer/meson.build\n create mode 100644 lib/htimer/rte_htimer.h\n create mode 100644 lib/htimer/rte_htimer_mgr.c\n create mode 100644 lib/htimer/rte_htimer_mgr.h\n create mode 100644 lib/htimer/rte_htimer_msg.h\n create mode 100644 lib/htimer/rte_htimer_msg_ring.c\n create mode 100644 lib/htimer/rte_htimer_msg_ring.h\n create mode 100644 lib/htimer/rte_htw.c\n create mode 100644 lib/htimer/rte_htw.h\n create mode 100644 lib/htimer/version.map",
    "diff": null,
    "prefixes": [
        "RFC",
        "0/2"
    ]
}