From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f99.google.com (mail-ed1-f99.google.com [209.85.208.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B4DE2E1746 for ; Wed, 29 Jul 2026 01:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785288624; cv=none; b=duCpInIIgqss75FLi8h7f/D10VqZnG80CH1U39HG8pQUksAHrocKWFyrPeaeij8CslwTZFPzaZSsi5lJzxJNKEqPDCmfqxSHSiuXTIDp8n2ahqZVHEqUHNzdU/kv1J/SEQQze+MwYpQ/7G5+qNkObu6IQ7MdhbeNnBDUqj68yBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785288624; c=relaxed/simple; bh=o0zO2Q03U7Pcfdqtx5+AD0mu1VvbkhrqFuD+Vxrzvc0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jB8EHJlGZWA6nWmB/Gbg7kWAS6Lnz9TURv83JDMw5feQQBgtUc25+nUEcjsOzQSyP1YHqM+Do4EDZDGeRtBAnRFCe/OuLW5ycZzmRJGkgMoaOQVZbzARRWq3WQBKJbp42O6heVqi9cACfETYc4k63io9xg6DkF/Tbsq/HRBEkEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com; spf=pass smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=HDDc9Kpm; arc=none smtp.client-ip=209.85.208.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="HDDc9Kpm" Received: by mail-ed1-f99.google.com with SMTP id 4fb4d7f45d1cf-69a33fb0031so70164a12.1 for ; Tue, 28 Jul 2026 18:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1785288606; x=1785893406; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=GBrubRZRlUiQu9aT/4sx8tjb66mgzpR1rjCplw/e+uA=; b=HDDc9Kpm0HFK9pZlGlR+9t8jXRJbMtFVb0U1isORc3Vebmp3jyNCx8BNL5jxEf645b rRAf754EWM/fjW0ihXo0LwpjdIWwN2uumjncc5y9T4ypYz/XDnazJjCSeJVAN0z2GtXp drVOTI+l4tgo8f/nK0E04RZnz4LVAtUK46SrO/tib8YC3A6gOKqjT14kY7cVAqMyKxda Gf6bjOk3feS7DdO8t2biGs3LOopmiqnLzhHa/D0LUWnjsjGJM73PgV3pU5cLPEqq3niy NP0FNgzrkZ6oO29+66RFI/Tid16TgMaQ23Ml1kJ0WKWx0c1SbM5w79IqeIsGI6C1wMsK 9TbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785288606; x=1785893406; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GBrubRZRlUiQu9aT/4sx8tjb66mgzpR1rjCplw/e+uA=; b=LpE1RslpnNdvq0InV1b1xuTOjlgOJ3fa0/ucE4gQCGHCyjBfeeCyqSSHAMHu9m4gPQ hltzbDsBap9WQ0qsMYW554GcMoCVErtaiT5CaLKJiZ0iK+wuNsbRZFvstg/zDCc/atmv OORTChYMo848RXEmBoHpdYa8j558w5BWUttWFJQPM+croy0xGv/e+0dydLkJo0VtoyMh mUu2gGTj7zA583hVu8QMSx9uDzxBZVKIHm19XI4UmE0utHKTB54z//PEnx+CqJ31MZC8 rxNwh6s64Ea4CNKa76O/WkZxBVOeOjTZLLR9jVc50fWMABR1dfwFrE01ZHnOyKz+c/IF mUtw== X-Forwarded-Encrypted: i=1; AHgh+RqX2gx1to/eUz85JHZlttQgA0l2Gv10/vBhSTjvBZLzwnsJHF3uuC2LBL8m5J3WG7UBDgVDuCjvadavLuY=@vger.kernel.org X-Gm-Message-State: AOJu0Yzjga2sJv3kgZfOqBqVgRHUAHmzpZp0msQQ+pGBa0hZd5UPQGxx ttulO2Pg5fwA5tpLhgEBst+Pvo9DwOeH2FTI3Wxx+r2idaUsB4+bXXkyJUxqjOTf6y2ruQGxpkO 2v15pRfIWIXbbtvuZ9WXGUIwLwCLuVflH1eM0 X-Gm-Gg: AR+sD13dIJ0KEeLCqmgnW1m8LVp0ax9QozjhJI8EkhkzDjKDt4Ruce961NrCB8V1Kkp 96qCqrRsEsH6V0dvclwWX8dRemNb+rWnYiw9tnEbsYcpPjS3Vd1VXYhpGqDu3uNBCqaRHKKbSvh Ia7bUMPQvFMgFjygAj6w/rcqcvsliRDUXTdfGi6KoRvA9JT7f1RgcFwchUOFlsh8NQtYDQh/plk 4pov9jJAPsaf0tMJgaFCfNFOLthNy4q0ElEeFOxIvdQzEStxWCBGHmKVe5YkNV+UPNIaIUd+q2q 1EyVxrDHwTzs5pfBiU/5cEsm95Ai3M3NtwlroNRWoA+lETMzJBF/NeKnI0or+lZe4/sYv0XleXj eqVnD0SP2NLKc+XPleR4IgwM2r8w1aEx1 X-Received: by 2002:a17:907:d113:b0:c12:732a:fe52 with SMTP id a640c23a62f3a-c1f7223e3b6mr149100166b.4.1785288606281; Tue, 28 Jul 2026 18:30:06 -0700 (PDT) Received: from c7-smtp-2026.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id a640c23a62f3a-c1f83fc22c1sm9003766b.55.2026.07.28.18.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 18:30:06 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.12.104]) by c7-smtp-2026.dev.purestorage.com (Postfix) with ESMTP id 0440E4014B; Tue, 28 Jul 2026 19:30:04 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id F25C3E4095D; Tue, 28 Jul 2026 19:30:03 -0600 (MDT) From: Caleb Sander Mateos To: Ming Lei , Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH 0/6] ublk: io_desc optimizations Date: Tue, 28 Jul 2026 19:29:45 -0600 Message-ID: <20260729012951.3744582-1-csander@purestorage.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ublk passes the parameters of incoming I/O in memory shared between the kernel ublk driver and userspace ublk server in struct ublksrv_io_desc. The thread submitting the ublk I/O writes to the io_desc, while the ublk server thread handling the I/O reads the io_desc. This basically guarantees a cache miss on both threads for each ublk I/O. Avoid the cache misses by writing the io_desc on the server thread in the kernel before dispatching the I/O to userspace. The size of each io_desc is currently fixed to 24 bytes, which has been an obstacle to extending it with additional fields [1]. Additionally, with multiple ublk server threads handling I/Os from the same ublk queue (possible with UBLK_F_PER_IO_DAEMON or UBLK_F_BATCH_IO), false sharing results from adjacent io_descs sharing the same cache line. Add a UBLK_F_IO_DESC_SIZE feature allowing the ublk server to increase the size of the io_descs for its ublk devices. [1]: https://lore.kernel.org/linux-block/aV8QfvaNO5P6vOs6@fedora/ Caleb Sander Mateos (6): ublk: consistently use u16 for queue and tag numbers ublk: remove struct ublk_zoned_report_desc's operation field ublk: split request validation from io_desc init ublk: initialize io_desc on daemon task ublk: add UBLK_F_IO_DESC_SIZE ublk: lift need_map check out of ublk_{,un}map_io() drivers/block/ublk_drv.c | 213 +++++++++++++++++++--------------- include/uapi/linux/ublk_cmd.h | 5 +- 2 files changed, 124 insertions(+), 94 deletions(-) -- 2.54.0