From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 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)` 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Based on an explanation from the Linux kernel upstream commit: 07754bfd9aee ("io_uring: enable toggle of iowait usage when waiting on CQEs") 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) -- Ammar Faizi