From nobody Mon Oct 6 01:29:04 2025 Received: from server-vie001.gnuweeb.org (server-vie001.gnuweeb.org [89.58.62.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DC4078F2E; Sun, 27 Jul 2025 01:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.58.62.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578181; cv=none; b=lsgN+yCWj9QioEddMEtp46YuF4UpOf6yHKveQB5eiFeeXvHqFJr0ygJU2Lua2mb07oUz340UOhVMawxacs6tq0zRJerHTS0IaJZHi8Pbu4xWmdggFz4rU1c6ZwosqmAA1qXZo+wrEVIoO3zIrFNWSlLRlfFTjoM+1+0rdepbBEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578181; c=relaxed/simple; bh=u+LMdMlZmXbZ2orkb0poCs5sPB8DiAEbn1KiRhovcm4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QJR7V48T7zisiMIpgbinRs2/PTVXeCJYMuQ3Z0ji8Yj2xkQ3FQT78qfq13au81JUE6h5yVqunsVaRzva8l2NR6fn1p2S4Z+foa36HUhtlns84F1zXmXzTCNmKMaHKL9kXJnRz+bwX83iyv6oMcCqb1ZN5OQjHF9BTW3vg+J/xsI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org; spf=pass smtp.mailfrom=gnuweeb.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b=stDnWIal; arc=none smtp.client-ip=89.58.62.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b="stDnWIal" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1753578177; bh=u+LMdMlZmXbZ2orkb0poCs5sPB8DiAEbn1KiRhovcm4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=stDnWIal4LDjFpx7+O5Xo2LccWFoPrI3ce5i2yLfRmWXKMpTjPakHRIRD1Rno/uoX UeouLAxc9F/Wn26u6y+pMsoszvmIuRckOS/EiF1RDdzBeqZJZrbzvAzKjplfS/pccd b/7pXZYyFPENSLi9AikQkMrCeLTVuRBDq23eCTeKNRY5/9gsCmoQS2znsUM5n6Jjv5 gUyqb12Ewz/GFBTySCx/5GpxRAp+8ulTzBgXhowR0TgMRPx9txxrEH2T8IdUQHG0SG mU/L1fC7bo/FRV6UcGZQlVW4fQNcDK09nlAU31/11eIgbKryomNbQ8Q5+FvHbCZvm2 om3Rvjhd/nNwg== Received: from integral2.. (unknown [182.253.126.144]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 3D1363126E05; Sun, 27 Jul 2025 01:02:56 +0000 (UTC) From: Ammar Faizi To: Cc: Ammar Faizi , Alviro Iskandar Setiawan , GNU/Weeb Mailing List , Christian Mazakas , io-uring Mailing List , Linux Kernel Mailing List Subject: [PATCH liburing v2 1/3] man: Add `io_uring_set_iowait(3)` X-Gw-Bpl: wU/cy49Bu1yAPm0bW2qiliFUIEVf+EkEatAboK6pk2H2LSy2bfWlPAiP3YIeQ5aElNkQEhTV9Q== Date: Sun, 27 Jul 2025 08:02:49 +0700 Message-Id: <20250727010251.3363627-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> References: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Based on an explanation from the Linux kernel upstream commit: 07754bfd9aee ("io_uring: enable toggle of iowait usage when waiting on CQ= Es") Signed-off-by: Ammar Faizi --- man/io_uring_set_iowait.3 | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 man/io_uring_set_iowait.3 diff --git a/man/io_uring_set_iowait.3 b/man/io_uring_set_iowait.3 new file mode 100644 index 000000000000..5caf0a3a4cc6 --- /dev/null +++ b/man/io_uring_set_iowait.3 @@ -0,0 +1,57 @@ +.\" Copyright (C) 2025 Jens Axboe +.\" Copyright (C) 2025 Ammar Faizi +.\" +.\" SPDX-License-Identifier: LGPL-2.0-or-later +.\" +.TH io_uring_set_iowait 3 "July 27, 2025" "liburing-2.12" "liburing Manual" +.SH NAME +io_uring_set_iowait \- toggle of iowait usage when waiting on CQEs +.SH SYNOPSIS +.nf +.B #include +.PP +.BI "int io_uring_set_iowait(struct io_uring *" ring ", +.BI " bool " enable_iowait ");" +.fi +.SH DESCRIPTION +.PP +By default, io_uring marks a waiting task as being in iowait if it's +sleeping waiting on events and there are pending requests. This isn't +necessarily always useful, and may be confusing on non-storage setups +where iowait isn't expected. It can also cause extra power usage by +preventing the CPU from entering lower sleep states. + +The +.BR io_uring_set_iowait (3) +function allows the user to toggle this behavior. If +.BI enable_iowait +is set to true, the iowait behavior is enabled. If it is set to false, +the iowait behavior is disabled. The iowait behavior is enabled by +default when a ring is created. + +If the iowait is disabled, the submit functions will set +.B IORING_ENTER_NO_IOWAIT +in the +.BI flags +argument to +.BR io_uring_enter (2). + +If the kernel supports this feature, it will be marked by having +the +.B IORING_FEAT_NO_IOWAIT +feature flag set. + +Available since kernel 6.15. + + +.SH RETURN VALUE +On success, +.BR io_uring_set_iowait (3) +returns 0. On failure, it returns +.BR -EOPNOTSUPP . + + +.SH SEE ALSO +.BR io_uring_enter (2), +.BR io_uring_submit (3), +.BR io_uring_submit_and_wait (3) --=20 Ammar Faizi From nobody Mon Oct 6 01:29:04 2025 Received: from server-vie001.gnuweeb.org (server-vie001.gnuweeb.org [89.58.62.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8895613DDAE; Sun, 27 Jul 2025 01:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.58.62.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578183; cv=none; b=lYci0n3H1LzBWpb/ixJyqde6mYKaxtE+5dJv2nxU314Zp9/rEHa3B6qd8WZ5QSAHCIENJbkwgsaoS1N3BUuqNPL8aTJ4IO1txYbanaYGxlLcViDfTHujPgEKjtJ4PNgYJtiEaJdwoaXuHcHULnw8BrveaO12fTKfRoB+TAPH6a4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578183; c=relaxed/simple; bh=etqAV++elJSj94Vs+g/cqagRXHDxS/kbllsDICy83Hc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T4lXAhZC4YmLbp34LX886Cl4QBfLZ7OZ1PL3HR0Gv2fignktAp11ZBFB3UifQGW8OkllNN7oaBnIuEOqx0r3GxHtj8KsvI0sBEs4lx9QYQK4W5FdX4ArUcJZnXIzuoG6c+NfnVL72ZYymhWANY13oq7DRbZuWS7B6w0PNvjlcCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org; spf=pass smtp.mailfrom=gnuweeb.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b=H3NjG/hY; arc=none smtp.client-ip=89.58.62.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b="H3NjG/hY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1753578179; bh=etqAV++elJSj94Vs+g/cqagRXHDxS/kbllsDICy83Hc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=H3NjG/hY2ssGl2jt9lvkNVhTSFk0wbNYRFB90elGMyCTrmyUW5D9CjzKe9u7HZb4Z zSyMvJl6HgCbQCyz7C+yQgAT2tZQS9vWV1IAxWeHezGZHRiLOUZT8xy1kU2w0TBhgT cUszwHv8/lM8I8BOLl2SvtD0hkcU9cNAnSFpRgqN39F+L6Ik3y5qnaQCd6rFv3DvN6 vtKUF2qWsPqsxK68H8AyNe2TEjEGsojNKnkdJVaJvZaFvn4RcQ6ryLvRvrS64b6BoK ZYEHrOEBPOpjuj7k/a0hMrwR1cLSClgnTMcV/VDTVt/tZEabwrjc6TWs8v7iRV27Va rXiDNB/vAxXKw== Received: from integral2.. (unknown [182.253.126.144]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 2BC673126E06; Sun, 27 Jul 2025 01:02:57 +0000 (UTC) From: Ammar Faizi To: Cc: Ammar Faizi , Alviro Iskandar Setiawan , GNU/Weeb Mailing List , Christian Mazakas , io-uring Mailing List , Linux Kernel Mailing List Subject: [PATCH liburing v2 2/3] man: Add `IORING_ENTER_NO_IOWAIT` flag X-Gw-Bpl: wU/cy49Bu1yAPm0bW2qiliFUIEVf+EkEatAboK6pk2H2LSy2bfWlPAiP3YIeQ5aElNkQEhTV9Q== Date: Sun, 27 Jul 2025 08:02:50 +0700 Message-Id: <20250727010251.3363627-3-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> References: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Based on an explanation from the Linux kernel upstream commit: 07754bfd9aee ("io_uring: enable toggle of iowait usage when waiting on CQ= Es") Signed-off-by: Ammar Faizi --- man/io_uring_enter.2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index 99c0ab222675..a054a7cdfbd4 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -134,7 +134,21 @@ but merely an offset into an area of wait regions prev= iously registered with .BR io_uring_register (2) using the .B IORING_REGISTER_MEM_REGION -operation. Available since 6.13 +operation. + +Available since 6.13 + +.TP +.B IORING_ENTER_NO_IOWAIT +When this flag is set, the system call will not mark the waiting task as b= eing +in iowait if it is sleeping waiting on events and there are pending reques= ts. +This is useful if iowait isn't expected when waiting for events. It can al= so +prevent extra power usage by allowing the CPU to enter lower sleep states. +This flag is only available if the kernel supports the +.B IORING_FEAT_NO_IOWAIT +feature. + +Available since 6.15. =20 .PP .PP --=20 Ammar Faizi From nobody Mon Oct 6 01:29:04 2025 Received: from server-vie001.gnuweeb.org (server-vie001.gnuweeb.org [89.58.62.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 768E815ECCC; Sun, 27 Jul 2025 01:03:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.58.62.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578184; cv=none; b=U2Bu98MYCEuSFDvK6+fjykESjhleTCqgJITjtXvs+wZL4m5xYdd/H34NxuIajb19S0rnGcrAmDiFeyPUbC9KcO+pwa2BjDVLGFCIl6oLuhg2N0lbhYJT+q6OUagjT150FSeoaX9jJZ8u1yzc9vHgAHFleB4EOnvlWOJM7+NzR5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753578184; c=relaxed/simple; bh=Sja6bm5jphgdqcm6dDbnQou5peLTye/IGOEKghR68xI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T5ym6GkmsbvBUArbDC9sFtltQufjKGe1HFelhMpona6Tr3666DDvPk7JgkfZZEgcSnMtVhAfwRUxpQEHzFCJK9/6JC8aDnmFWwipm3VjCZQtrTKj7Kof6vQCs3kAfe7DC71Et3b7UdKIVXFYNjn8aEaqpvdDEZbsdMQbdnDbMXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org; spf=pass smtp.mailfrom=gnuweeb.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b=GjW/qhjl; arc=none smtp.client-ip=89.58.62.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnuweeb.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gnuweeb.org header.i=@gnuweeb.org header.b="GjW/qhjl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1753578181; bh=Sja6bm5jphgdqcm6dDbnQou5peLTye/IGOEKghR68xI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=GjW/qhjl20ELgS/FjllHRq7j6VeMex8nNTKte5vlzet2WDWpjq+4rTq+w/j2Vnvoj iv/lepNtIUmyBXPisK9v1RN2oryhzCPkWmeDBVfQZNPlQ5PiPQHQanIJFNNnrBgqJo lw9TZyAAzqjbI3azadK59xUcfZJhXDkUUl/702Xst0cCtyrfO9UDUYPvZDQ5kLu55M NNZQaiu0snEjc1kKPR1Lz9beMgxZUFdmELjoblx6JH8O/I8ANPe3iFJQiKbMjmEVj/ D1mxIHyak6QQfrknqDE8mFAClHZCu2WLBh/afPSTmDB9YEWyeGEdNsJBqrtO3cNMVe E9bGzxpUx45mA== Received: from integral2.. (unknown [182.253.126.144]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 1B66C3126E04; Sun, 27 Jul 2025 01:02:59 +0000 (UTC) From: Ammar Faizi To: Cc: Ammar Faizi , Alviro Iskandar Setiawan , GNU/Weeb Mailing List , Christian Mazakas , io-uring Mailing List , Linux Kernel Mailing List Subject: [PATCH liburing v2 3/3] liburing: Don't use `IOURINGINLINE` on private helpers X-Gw-Bpl: wU/cy49Bu1yAPm0bW2qiliFUIEVf+EkEatAboK6pk2H2LSy2bfWlPAiP3YIeQ5aElNkQEhTV9Q== Date: Sun, 27 Jul 2025 08:02:51 +0700 Message-Id: <20250727010251.3363627-4-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> References: <20250727010251.3363627-1-ammarfaizi2@gnuweeb.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" These functions: __io_uring_set_target_fixed_file __io_uring_peek_cqe are not exported for FFI. Don't use `IOURINGINLINE` on them. Cc: Christian Mazakas Signed-off-by: Ammar Faizi --- src/include/liburing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/liburing.h b/src/include/liburing.h index 83434f6eca65..e3f394eab860 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -522,7 +522,7 @@ IOURINGINLINE void io_uring_sqe_set_buf_group(struct io= _uring_sqe *sqe, sqe->buf_group =3D (__u16) bgid; } =20 -IOURINGINLINE void __io_uring_set_target_fixed_file(struct io_uring_sqe *s= qe, +static inline void __io_uring_set_target_fixed_file(struct io_uring_sqe *s= qe, unsigned int file_index) LIBURING_NOEXCEPT { @@ -1742,7 +1742,7 @@ IOURINGINLINE int io_uring_wait_cqe_nr(struct io_urin= g *ring, * "official" versions of this, io_uring_peek_cqe(), io_uring_wait_cqe(), * or io_uring_wait_cqes*(). */ -IOURINGINLINE int __io_uring_peek_cqe(struct io_uring *ring, +static inline int __io_uring_peek_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_ptr, unsigned *nr_available) LIBURING_NOEXCEPT --=20 Ammar Faizi