get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196351,
    "url": "http://patchwork.ozlabs.org/api/patches/2196351/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213143225.161043-2-axboe@kernel.dk/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260213143225.161043-2-axboe@kernel.dk>",
    "list_archive_url": null,
    "date": "2026-02-13T14:26:36",
    "name": "[1/2] fdmon-io_uring: notify main loop when SQEs are queued",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7bd62dc829f8c0985cf25e77b0f2dea6596a5a1d",
    "submitter": {
        "id": 4515,
        "url": "http://patchwork.ozlabs.org/api/people/4515/?format=api",
        "name": "Jens Axboe",
        "email": "axboe@kernel.dk"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213143225.161043-2-axboe@kernel.dk/mbox/",
    "series": [
        {
            "id": 492105,
            "url": "http://patchwork.ozlabs.org/api/series/492105/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492105",
            "date": "2026-02-13T14:26:37",
            "name": "io_uring fixes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492105/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196351/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196351/checks/",
    "tags": {},
    "related": [],
    "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=pass (2048-bit key;\n unprotected) header.d=kernel-dk.20230601.gappssmtp.com\n header.i=@kernel-dk.20230601.gappssmtp.com header.a=rsa-sha256\n header.s=20230601 header.b=rb/06dDg;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.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 4fCF5H2Gr7z1xvQ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 01:33:07 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vquDv-0003iq-Lz; Fri, 13 Feb 2026 09:32:47 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <axboe@kernel.dk>) id 1vquDj-0003gW-H9\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 09:32:35 -0500",
            "from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <axboe@kernel.dk>) id 1vquDg-0006bX-2x\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 09:32:35 -0500",
            "by mail-ot1-x335.google.com with SMTP id\n 46e09a7af769-7d18c654458so392564a34.3\n for <qemu-devel@nongnu.org>; Fri, 13 Feb 2026 06:32:31 -0800 (PST)",
            "from m2max ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7d4a733f033sm6564377a34.0.2026.02.13.06.32.29\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 13 Feb 2026 06:32:29 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1770993151; x=1771597951;\n darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=hqBOMzl28DKqqn/5ITt53IZh3OcJ6ZgKOh+W57xkrRk=;\n b=rb/06dDg0/hiXFvkdOelzBvz49TIY9xnimWOU2EtOwkML7YbqYyvrUWuVn/TAXnvuh\n WdiQep9Mpggf00OqULtW7G9rXGcpgb9U5PU4TDpZiTEKjiFXCn5VRq3vkYA/2temCkQ+\n PtGoDB+AplNsgbrtCF49sC8nXNeMDUDUbLjRjlMVnaHYI3PulOaRD/fjHH5sAj8BkZ5f\n 4+HQ5Nb4e2ohNr17l9qBEPEu2DWCuqym24EGXF6/w6i7JOd1/Fd8nYfW4a88l06dKtsA\n RpxyqG1FRmfpadnJQmruJhCmpxlGwYHopZQhLWhKpe5QETydxJ786OPxlVZpAhFzhns6\n zo2A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770993151; x=1771597951;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=hqBOMzl28DKqqn/5ITt53IZh3OcJ6ZgKOh+W57xkrRk=;\n b=BKRzbQ+aBvAPZGlTaEvzFqJdkLVBbj6H8peTuB4cKma/eZ0gaDtBN6ipUb6oE+d4Up\n Zz39n+CInM3uNb4AYk2dM7M7PmhFcbALZKIG96fj3bhtLHd/pah5yM0TPp0zaRviAtS2\n oyDmduHfbxY5vCSuP1Wn1PoTlrWsI3Jr/C2qa5lNwupppxoefzqa6R3stj2b0nM+wtoA\n Azk8QgWccQe5aSgYauHDKdkSiqnrnKEqdANEkG1DrVkMTVO1YGu5bV6D4NYdmtl4soQo\n IgHLEE34VwoApQ2J63WJMqrktLaodjfGbSt3P3mXwAyAQxY8/+KLVIynQYxEA2fFq6js\n DzeQ==",
        "X-Gm-Message-State": "AOJu0YzGL016uq6FFc1djJqnWy4LS03R7fsuroj73qf+ws/Jp6SUpMox\n gN88qLAn+nTOi9i+xMnoYrbWuHUBdY7FLWuKMXZWhpdehGQFCqrOAPlyBJD+aOo5vtk=",
        "X-Gm-Gg": "AZuq6aKzsNYvrSGM6eraHxBwCzMKDedT4jFr8Comr7+ZAK1gQgOLCiGiQ9aFfPJPHkp\n ocGcgUfc7ZFAEeUfnt9q98KPNkPwswaLVOP97UQYKrUD/jGBSAtC0MfkRO0vyBBROSK1QXOzeSL\n QHax5wg2so9YFHxIwfLrleTXG7FYYPNthtE+1Egbj+Le4Vc1uSr6ECVstxbpYuDx9ItfG9l1q7u\n lU+PImqImUMqTRsIdDaK3gk5hOEseIt2jlPfGowd5d6pXq30Ls2wyOkeH6S+5ICtNG7bKNc9O6z\n PUuw7qaSxxkIdQPtpU2knN4Fc1F0+EXaQTUV8PBrPgPxAkjNdbOa93OEiRITUjS2O4IgAla7KN0\n C6tTibM6NeYdgUQr5q6JNi1wMrTu5hN5NF6CM6Ei8JJEnVIkMpMtrrVd/bsLA6hNwHTNh4eU5WS\n PMb+fjxnOWNq00rQnpSI0xR79wf/WGlngTVUyvwN/aX8VI5AbrGVD7yPCtkIg5LMc+Hh7s",
        "X-Received": "by 2002:a05:6830:648a:b0:7c7:6d15:6ac2 with SMTP id\n 46e09a7af769-7d4c4a0b773mr1094809a34.3.1770993150635;\n Fri, 13 Feb 2026 06:32:30 -0800 (PST)",
        "From": "Jens Axboe <axboe@kernel.dk>",
        "To": "qemu-block@nongnu.org",
        "Cc": "qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com,\n Jens Axboe <axboe@kernel.dk>",
        "Subject": "[PATCH 1/2] fdmon-io_uring: notify main loop when SQEs are queued",
        "Date": "Fri, 13 Feb 2026 07:26:36 -0700",
        "Message-ID": "<20260213143225.161043-2-axboe@kernel.dk>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<20260213143225.161043-1-axboe@kernel.dk>",
        "References": "<20260213143225.161043-1-axboe@kernel.dk>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::335;\n envelope-from=axboe@kernel.dk; helo=mail-ot1-x335.google.com",
        "X-Spam_score_int": "-18",
        "X-Spam_score": "-1.9",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham 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": "When a vCPU thread handles MMIO (holding BQL), aio_co_enter() runs the\nblock I/O coroutine inline on the vCPU thread because\nqemu_get_current_aio_context() returns the main AioContext when BQL is\nheld. The coroutine calls luring_co_submit() which queues an SQE via\nfdmon_io_uring_add_sqe(), but the actual io_uring_submit() only happens\nin gsource_prepare() on the main loop thread.\n\nSince the coroutine ran inline (not via aio_co_schedule()), no BH is\nscheduled and aio_notify() is never called. The main loop remains asleep\nin ppoll() with up to a 499ms timeout, leaving the SQE unsubmitted until\nthe next timer fires.\n\nFix this by calling aio_notify() after queuing the SQE. This wakes the\nmain loop via the eventfd so it can run gsource_prepare() and submit the\npending SQE promptly.\n\nThis is a generic fix that benefits all devices using aio=io_uring.\nWithout it, AHCI/SATA devices see MUCH worse I/O latency since they use\nMMIO (not ioeventfd like virtio) and have no other mechanism to wake the\nmain loop after queuing block I/O.\n\nThis is usually a bit hard to detect, as it also relies on the ppoll\nloop not waking up for other activity, and micro benchmarks tend not to\nsee it because they don't have any real processing time. With a\nsynthetic test case that has a few usleep() to simulate processing of\nread data, it's very noticeable. The below example reads 128MB with\nO_DIRECT in 128KB chunks in batches of 16, and has a 1ms delay before\neach batch submit, and a 1ms delay after processing each completion.\nRunning it on /dev/sda yields:\n\ntime sudo ./iotest /dev/sda",
    "diff": "diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c\nindex d0b56127c670..96392876b490 100644\n--- a/util/fdmon-io_uring.c\n+++ b/util/fdmon-io_uring.c\n@@ -181,6 +181,14 @@ static void fdmon_io_uring_add_sqe(AioContext *ctx,\n \n     trace_fdmon_io_uring_add_sqe(ctx, opaque, sqe->opcode, sqe->fd, sqe->off,\n                                  cqe_handler);\n+\n+    /*\n+     * Wake the main loop if it is sleeping in ppoll().  When a vCPU thread\n+     * runs a coroutine inline (holding BQL), it queues SQEs here but the\n+     * actual io_uring_submit() only happens in gsource_prepare().  Without\n+     * this notify, ppoll() can sleep up to 499ms before submitting.\n+     */\n+    aio_notify(ctx);\n }\n \n static void fdmon_special_cqe_handler(CqeHandler *cqe_handler)\n",
    "prefixes": [
        "1/2"
    ]
}