From patchwork Thu Sep 1 09:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 12962159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B61DC54EE9 for ; Thu, 1 Sep 2022 09:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbiIAJd2 (ORCPT ); Thu, 1 Sep 2022 05:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbiIAJd0 (ORCPT ); Thu, 1 Sep 2022 05:33:26 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E03F5133F0B for ; Thu, 1 Sep 2022 02:33:25 -0700 (PDT) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 2811Hd9F000343 for ; Thu, 1 Sep 2022 02:33:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=vGyofClJsXWSVgIvO7mgfI8ilfFPtKCRWqY+kse1jg0=; b=AyvGr6DTbbgD6QDuEx/szfnVspdJPL1yVx2nVb5ObYLjj5TvsEobohCdmdxWidWL7N8l Gh/0N3H3R4cfdebIt+Ez0I9f74WAqUt/sw+P9h1a7/8L5bJn5qFq2thFTnn/230Ezr18 YwSrH4ZVzpSljYYulE6EcgzQmC169U+VktQ= Received: from maileast.thefacebook.com ([163.114.130.16]) by m0001303.ppops.net (PPS) with ESMTPS id 3j9nks4yt0-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 01 Sep 2022 02:33:25 -0700 Received: from twshared8442.02.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 1 Sep 2022 02:33:23 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id C90E95769400; Thu, 1 Sep 2022 02:33:06 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov , CC: , Dylan Yudaken Subject: [PATCH liburing v2 08/12] add docs for overflow lost errors Date: Thu, 1 Sep 2022 02:32:59 -0700 Message-ID: <20220901093303.1974274-9-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220901093303.1974274-1-dylany@fb.com> References: <20220901093303.1974274-1-dylany@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: NTz0Wgx_0zbNKYS-mrgog0LTNRAxHNlk X-Proofpoint-ORIG-GUID: NTz0Wgx_0zbNKYS-mrgog0LTNRAxHNlk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_06,2022-08-31_03,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Add man docs for return values indicating a CQE was lost. Signed-off-by: Dylan Yudaken --- man/io_uring_enter.2 | 11 +++++++++++ man/io_uring_setup.2 | 11 +++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index 4d8d488b5c1f..3c4aa04016cf 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -1329,6 +1329,17 @@ is a valid file descriptor, but the io_uring ring is not in the right state .BR io_uring_register (2) for details on how to enable the ring. .TP +.B EBADR +At least one CQE was dropped even with the +.B IORING_FEAT_NODROP +feature, and there are no otherwise available CQEs. This clears the error state +and so with no other changes the next call to +.BR io_uring_setup (2) +will not have this error. This error should be extremely rare and indicates the +machine is running critically low on memory and. It may be reasonable for the +application to terminate running unless it is able to safely handle any CQE +being lost. +.TP .B EBUSY If the .B IORING_FEAT_NODROP diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2 index 01eb70d95292..41c9e5f269c5 100644 --- a/man/io_uring_setup.2 +++ b/man/io_uring_setup.2 @@ -298,7 +298,7 @@ call. The SQEs must still be allocated separately. This brings the necessary calls down from three to two. Available since kernel 5.4. .TP .B IORING_FEAT_NODROP -If this flag is set, io_uring supports never dropping completion events. +If this flag is set, io_uring supports almost never dropping completion events. If a completion event occurs and the CQ ring is full, the kernel stores the event internally until such a time that the CQ ring has room for more entries. If this overflow condition is entered, attempting to submit more @@ -306,7 +306,14 @@ IO will fail with the .B -EBUSY error value, if it can't flush the overflown events to the CQ ring. If this happens, the application must reap events from the CQ ring and attempt the -submit again. Available since kernel 5.5. +submit again. If the kernel has no free memory to store the event internally +it will be visible by an increase in the overflow value on the cqring. +Available since kernel 5.5. Additionally +.BR io_uring_enter (2) +will return +.B -EBADR +the next time it would otherwise sleep waiting for completions (since kernel 5.19). + .TP .B IORING_FEAT_SUBMIT_STABLE If this flag is set, applications can be certain that any data for