get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227795,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2227795/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424-force_rcu-v4-1-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260424-force_rcu-v4-1-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp>",
    "date": "2026-04-24T09:27:06",
    "name": "[v4,1/6] futex: Add qemu_futex_timedwait()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5906ab65db6e4b8bc3757184e6a6f671d75a72b9",
    "submitter": {
        "id": 90980,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/90980/?format=api",
        "name": "Akihiko Odaki",
        "email": "odaki@rsg.ci.i.u-tokyo.ac.jp"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424-force_rcu-v4-1-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp/mbox/",
    "series": [
        {
            "id": 501326,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501326/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501326",
            "date": "2026-04-24T09:27:07",
            "name": "virtio-gpu: Force RCU when unmapping blob",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501326/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227795/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227795/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" header.d=rsg.ci.i.u-tokyo.ac.jp\n header.i=@rsg.ci.i.u-tokyo.ac.jp header.a=rsa-sha256 header.s=rs20250326\n header.b=M6rzkSbA;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g271v6Lrbz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 19:28:51 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wGCpg-0008Em-1a; Fri, 24 Apr 2026 05:28:20 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <odaki@rsg.ci.i.u-tokyo.ac.jp>)\n id 1wGCp5-0007QI-1m\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 05:27:43 -0400",
            "from www3579.sakura.ne.jp ([49.212.243.89])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <odaki@rsg.ci.i.u-tokyo.ac.jp>)\n id 1wGCp0-0007aB-1L\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 05:27:42 -0400",
            "from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp\n [133.11.54.205]) (authenticated bits=0)\n by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 63O9RHId004358\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);\n Fri, 24 Apr 2026 18:27:26 +0900 (JST)\n (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp)"
        ],
        "DKIM-Signature": "a=rsa-sha256; bh=2lrFVsOwSY/n/C0RCLf6Y19MCgXdoAnnxYob5thdabU=;\n c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp;\n h=From:Message-Id:To:Subject:Date;\n s=rs20250326; t=1777022846; v=1;\n b=M6rzkSbAKaf0mJ0HK6MsyeudpxJReB/TfL3EMWS4U4j+Nmhn72rjPxMshnG5gh02\n VC8xNrwfAzFdOGE4WoIeXj9bDOYzqxw0iUnTv9cEdFfo+56UmCs+kC5N2GVOL3B/\n Rw/DGwda5xxBkhBkyrZzm3MvikNtXl6Da9uspDKi8Pl31YHtZml/pONaa5Lz1/GF\n /Tf5jYmkUJzE/hypHnjFKzViUYFTznmfx8sGCbXkv46+g9xwo1mdD9c17xeFw77T\n u375xMbHIKB99aIDRFmKJ6u7TmPoTfW6rNFo4kZOxiqA6PiGNKHrBo7dLPX+c64l\n FdqK0Rxv0P5j24bnzJXVXA==",
        "From": "Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>",
        "Date": "Fri, 24 Apr 2026 18:27:06 +0900",
        "Subject": "[PATCH v4 1/6] futex: Add qemu_futex_timedwait()",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260424-force_rcu-v4-1-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp>",
        "References": "<20260424-force_rcu-v4-0-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp>",
        "In-Reply-To": "<20260424-force_rcu-v4-0-feccfaca0568@rsg.ci.i.u-tokyo.ac.jp>",
        "To": "qemu-devel@nongnu.org, Dmitry Osipenko <dmitry.osipenko@collabora.com>",
        "Cc": "Paolo Bonzini <pbonzini@redhat.com>,\n \"Michael S. Tsirkin\" <mst@redhat.com>,\n =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>",
        "X-Mailer": "b4 0.16-dev-16047",
        "Received-SPF": "pass client-ip=49.212.243.89;\n envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp",
        "X-Spam_score_int": "-16",
        "X-Spam_score": "-1.7",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,\n DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=no autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "qemu_futex_timedwait() is equivalent to qemu_futex_wait(), except it has\nan absolute timeout.\n\nSigned-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>\nTested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>\n---\n include/qemu/futex.h | 36 +++++++++++++++++++++++++++++++-----\n 1 file changed, 31 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/include/qemu/futex.h b/include/qemu/futex.h\nindex 607613eec835..3f3b55008f61 100644\n--- a/include/qemu/futex.h\n+++ b/include/qemu/futex.h\n@@ -24,13 +24,19 @@\n #ifndef QEMU_FUTEX_H\n #define QEMU_FUTEX_H\n \n+#include \"qemu/timer.h\"\n #define HAVE_FUTEX\n \n #ifdef CONFIG_LINUX\n #include <sys/syscall.h>\n #include <linux/futex.h>\n+#include <linux/time_types.h>\n \n+#ifdef __NR_futex_time64\n+#define qemu_futex(...)              syscall(__NR_futex_time64, __VA_ARGS__)\n+#else\n #define qemu_futex(...)              syscall(__NR_futex, __VA_ARGS__)\n+#endif\n \n static inline void qemu_futex_wake_all(void *f)\n {\n@@ -42,18 +48,28 @@ static inline void qemu_futex_wake_single(void *f)\n     qemu_futex(f, FUTEX_WAKE, 1, NULL, NULL, 0);\n }\n \n-static inline void qemu_futex_wait(void *f, unsigned val)\n+static inline bool qemu_futex_timedwait(void *f, unsigned val, int64_t ns)\n {\n-    while (qemu_futex(f, FUTEX_WAIT, (int) val, NULL, NULL, 0)) {\n+    struct __kernel_timespec ts;\n+    uint32_t bitset = FUTEX_BITSET_MATCH_ANY;\n+\n+    ts.tv_sec = ns / NANOSECONDS_PER_SECOND;\n+    ts.tv_nsec = ns % NANOSECONDS_PER_SECOND;\n+\n+    while (qemu_futex(f, FUTEX_WAIT_BITSET, (int) val, &ts, NULL, bitset)) {\n         switch (errno) {\n         case EWOULDBLOCK:\n-            return;\n+            return true;\n         case EINTR:\n             break; /* get out of switch and retry */\n+        case ETIMEDOUT:\n+            return false;\n         default:\n             abort();\n         }\n     }\n+\n+    return true;\n }\n #elif defined(CONFIG_WIN32)\n #include <synchapi.h>\n@@ -68,12 +84,22 @@ static inline void qemu_futex_wake_single(void *f)\n     WakeByAddressSingle(f);\n }\n \n-static inline void qemu_futex_wait(void *f, unsigned val)\n+static inline bool qemu_futex_timedwait(void *f, unsigned val, int64_t ns)\n {\n-    WaitOnAddress(f, &val, sizeof(val), INFINITE);\n+    int64_t now = get_clock();\n+    DWORD duration = MIN((ns - now) / SCALE_MS, INFINITE);\n+\n+    return ns > now && WaitOnAddress(f, &val, sizeof(val), duration);\n }\n #else\n #undef HAVE_FUTEX\n #endif\n \n+#ifdef HAVE_FUTEX\n+static inline void qemu_futex_wait(void *f, unsigned val)\n+{\n+    qemu_futex_timedwait(f, val, INT64_MAX);\n+}\n+#endif\n+\n #endif /* QEMU_FUTEX_H */\n",
    "prefixes": [
        "v4",
        "1/6"
    ]
}