{"id":2227505,"url":"http://patchwork.ozlabs.org/api/1.1/covers/2227505/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/cover/20260423195918.661299-1-jhkim@linux.ibm.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","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":"<20260423195918.661299-1-jhkim@linux.ibm.com>","date":"2026-04-23T19:59:15","name":"[v5,0/3] improve aio-polling efficiency","submitter":{"id":91012,"url":"http://patchwork.ozlabs.org/api/1.1/people/91012/?format=json","name":"Jaehoon Kim","email":"jhkim@linux.ibm.com"},"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/cover/20260423195918.661299-1-jhkim@linux.ibm.com/mbox/","series":[{"id":501240,"url":"http://patchwork.ozlabs.org/api/1.1/series/501240/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501240","date":"2026-04-23T19:59:15","name":"improve aio-polling efficiency","version":5,"mbox":"http://patchwork.ozlabs.org/series/501240/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2227505/comments/","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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=bsfIcZf2;\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 4g1n4n5Y2Jz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 06:00:08 +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 1wG0Cz-0001Ph-NC; Thu, 23 Apr 2026 15:59:33 -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 <jhkim@linux.ibm.com>)\n id 1wG0Cx-0001OF-7G; Thu, 23 Apr 2026 15:59:31 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <jhkim@linux.ibm.com>)\n id 1wG0Cv-0003GG-GV; Thu, 23 Apr 2026 15:59:30 -0400","from pps.filterd (m0353725.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63NIhErX3944376; Thu, 23 Apr 2026 19:59:25 GMT","from ppma21.wdc07v.mail.ibm.com\n (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dpeu3sx71-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 23 Apr 2026 19:59:24 +0000 (GMT)","from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63NJohWT016868;\n Thu, 23 Apr 2026 19:59:24 GMT","from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72])\n by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dpjkyg4ad-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 23 Apr 2026 19:59:24 +0000 (GMT)","from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com\n [10.241.53.103])\n by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 63NJxMAB22479464\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 23 Apr 2026 19:59:23 GMT","from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id B19245805E;\n Thu, 23 Apr 2026 19:59:22 +0000 (GMT)","from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 74B8658056;\n Thu, 23 Apr 2026 19:59:22 +0000 (GMT)","from IBM-GLTZVH3.ibm.com (unknown [9.61.254.253])\n by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP;\n Thu, 23 Apr 2026 19:59:22 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:date:from:message-id:mime-version\n :subject:to; s=pp1; bh=ahhCUDaFRHbPzr71XPzfQgNefJBpuP6TRTvpbqK1j\n yM=; b=bsfIcZf2Mk+l/JoFTyrsIDde1Q/L/mXsiJpoiIhHsZJuaGk5OY37X+wyr\n DUPwtKBNGwmf7obKc7iy5X4YrUcxXsAAooBUrZZisaY2TslgR+R4acNKvEH+TVOL\n 2ogWaMY8n0veSMT+tGDQHlPxzv8FPhaaETg2lprCED+WsDxQj7VJrXeVpbC+xYce\n ms5DPLAv7Yx9CBcNn67AZBS2ggUjz4NUky2oGr6AD1tX07b5RKCL4mvp/bsDQHni\n ZTrFsRvTR9W92hqSKR3KaNYQ8Ms+RI4yP0slwPUulH0iXQhUA0ytjJt6i41L8MfD\n XKf0rSnXEMzGxt9oL4OZJFTTxaTmg==","From":"Jaehoon Kim <jhkim@linux.ibm.com>","To":"qemu-devel@nongnu.org, qemu-block@nongnu.org","Cc":"pbonzini@redhat.com, stefanha@redhat.com, fam@euphon.net,\n armbru@redhat.com, eblake@redhat.com, berrange@redhat.com,\n eduardo@habkost.net, dave@treblig.org, sw@weilnetz.de,\n mjrosato@linux.ibm.com, farman@linux.ibm.com,\n Jaehoon Kim <jhkim@linux.ibm.com>","Subject":"[PATCH v5 0/3] improve aio-polling efficiency","Date":"Thu, 23 Apr 2026 14:59:15 -0500","Message-ID":"<20260423195918.661299-1-jhkim@linux.ibm.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","X-Proofpoint-GUID":"oQKc6Stj115SwIsGZ-APviHRT3_heYpH","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDIzMDE5MyBTYWx0ZWRfX+oTYUIicrfeE\n OvHul+pML5aipCYweDI2/6imFPnIjtQY7AwuSX1LzJ4bsvjOtoxGne/bDyxHKxnmZpm+2IhgMI2\n OO00uAjppAv0v9+KE8nwjYQ1qoIyls96xO/6QJ7Tqyhz9SiXHIDm08o/zI9jqkCyiSwoXQHzcgQ\n s9/1CN+VC0T84PHWsxct1OQBi6C0IwnMiWFC8Rd0iG05iknTFoLvmJDcaNn/xP4Ri/jV8FtEbC8\n 5QYSuKGXU2SVqDegKRqW2ylt90fPqiqHbmy+BwQEVs21v6sjxUL/6IgG+aB1/8dnGn67lAWZxLC\n LDpNGE/xqSmPErndaPrO7bd5TN952ZDXbX8++F7XQ1gLHR3Drmp3iiN7KgEXmqQWkv0InS2MjN2\n jlO4tsoxjz+V5Af62qpLc4qptQxhFrqOBAd4YQ93fo9HuoEstvBjXc9PA7DoxqzvFmiQAwytEGb\n Fal7KzUeHpYvob5J4Wg==","X-Authority-Analysis":"v=2.4 cv=a6kAM0SF c=1 sm=1 tr=0 ts=69ea7a1c cx=c_pps\n a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=V8glGbnc2Ofi9Qvn3v5h:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8\n a=-wZDFzhax2tZ4RQJR_4A:9","X-Proofpoint-ORIG-GUID":"oQKc6Stj115SwIsGZ-APviHRT3_heYpH","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-23_03,2026-04-21_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0\n lowpriorityscore=0 impostorscore=0 clxscore=1015 phishscore=0\n priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000\n definitions=main-2604230193","Received-SPF":"pass client-ip=148.163.158.5; envelope-from=jhkim@linux.ibm.com;\n helo=mx0b-001b2d01.pphosted.com","X-Spam_score_int":"-26","X-Spam_score":"-2.7","X-Spam_bar":"--","X-Spam_report":"(-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\n RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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":"Dear all,\n\nThis is v5 of the patch series to refine aio_poll adaptive polling\nlogic for better CPU efficiency.\n\nv1: https://lore.kernel.org/qemu-devel/20260113174824.464720-1-jhkim@linux.ibm.com/\nv2: https://lore.kernel.org/qemu-devel/20260323135451.579655-1-jhkim@linux.ibm.com/\nv3: https://lore.kernel.org/qemu-devel/20260405200735.3075407-1-jhkim@linux.ibm.com/\nv4: https://lore.kernel.org/qemu-devel/20260412215011.326196-1-jhkim@linux.ibm.com/\n\nChanges in v5:\n- Patch 3/3: Fixed QAPI documentation based on review feedback:\n  * qapi/misc.json: Removed the sentence about returning poll-weight=0\n    since query-iothreads never returns 0 for this field.\n  * qemu-options.hx: Enhanced poll-weight parameter documentation to\n    match the detail level in qom.json, including information about\n    default value and typical value examples.\n\nChanges in v4:\n- Patch 2/3: Added detailed validation tables showing poll.ns statistics\n  across different poll_weight values (1-5) for SSD randread/randwrite\n  workloads to demonstrate algorithm behavior and justify poll_weight=3\n  as the optimal default.\n\n- Patch 3/3: Fixed commit message to correctly reference\n  adjust_polling_time() instead of the removed grow_polling_time()\n  and shrink_polling_time() functions from v2.\n\nChanges in v3:\n- Patch 1/3: Removed timeout check in aio_poll() as suggested by\n  Stefan Hajnoczi.\n\n- Patch 2/3: Major refactoring based on review feedback:\n  * Removed has_event and renamed poll_idle_timeout to\n    last_dispatch_timestamp from AioHandler structure to identify\n    active handlers.\n  * Merged grow_polling_time() and shrink_polling_time() into single\n    adjust_polling_time() function to simplify code review, with no\n    functional changes.\n  * Renamed adjust_block_ns() to update_handler_poll_times()\n  * Modified remove_idle_poll_handlers() to use last_dispatch_timestamp\n    directly instead of checking poll_idle_timeout\n  * Updated commit message\n\n- Patch 3/3: Enhanced parameter handling:\n  * Moved IOTHREAD_POLL_*_DEFAULT constants to iothread.h header\n  * Added validation for poll-weight range [0, 63] in iothread.c\n  * Added the divide-by-0 protection in aio_context_set_poll_params()\n  * Updated QAPI version from 10.2 to 11.1\n  * Enhanced qom.json documentation for poll-weight values\n\nThis series reduces CPU usage in aio_poll adaptive polling by ~10%\nwith minimal throughput impact (~2%). Tested on s390x with various\nworkloads.\n\nTesting details:\n\nInitial testing (Fedora 42, 16 virtio-blk devices, FCP multipath):\n - Throughput: -3% to -8% (1 iothread), -2% to -5% (2 iothreads)\n - CPU usage: -10% to -25% (1 iothread), -7% to -12% (2 iothreads)\n\nAdditional validation (RHEL 10.1 + QEMU 10.0.0, FCP/FICON, 1-8 iothreads):\n - Throughput: -2.2% (weight=3), -2.4% (weight=2)\n - CPU usage: -9.4% (weight=3), -10.9% (weight=2)\n\nWeight=3 selected for slightly better throughput while maintaining\nsubstantial CPU savings.\n\nBest regards,\nJaehoon Kim\n\nJaehoon Kim (3):\n  aio-poll: avoid unnecessary polling time computation\n  aio-poll: refine iothread polling using weighted handler intervals\n  qapi/iothread: introduce poll-weight parameter for aio-poll\n\n include/qemu/aio.h                |   7 +-\n include/system/iothread.h         |  18 ++++\n iothread.c                        |  47 +++++++---\n monitor/hmp-cmds.c                |   1 +\n qapi/misc.json                    |   6 ++\n qapi/qom.json                     |  10 +-\n qemu-options.hx                   |   8 +-\n tests/unit/test-nested-aio-poll.c |   2 +-\n util/aio-posix.c                  | 148 ++++++++++++++++++------------\n util/aio-posix.h                  |   2 +-\n util/aio-win32.c                  |   3 +-\n util/async.c                      |   2 +\n 12 files changed, 176 insertions(+), 78 deletions(-)"}