Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp897338pxb; Fri, 22 Apr 2022 13:44:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5xIp2BgKaB+324eqZyR5ePtAcW7/h7/bo5HVoLDKxDgM0lIDtcNKCdCujXDM3f3KNws0Y X-Received: by 2002:a17:902:f787:b0:152:157:eb7 with SMTP id q7-20020a170902f78700b0015201570eb7mr6210818pln.109.1650660250918; Fri, 22 Apr 2022 13:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650660250; cv=none; d=google.com; s=arc-20160816; b=bwripN6576IgPy72pUtpgG0NvLckm8tGkr7IC6C5ExfW/l+2kSJMQWI3AajQ52IKa5 kJ4vNNFQTpKaAif0m/tcBgeHVf5w9Ro3QLrhMNW824uSUsilDjUPJnMNJ5DqLDaTiS/W I8Y4KLAIJsg+j8a4aB/kQkVKra3lppMpGFzYCO8tHEVhqeazIcX+5EQ6F4k84HY2rhWt EGYPHUf5kmkBf3XilEsIN/Lru/2hoqE+tS1CzWXNVcXygdEvns0itMIepUfaRaiEhdWZ 5cMC1kz13KiBHUfaccYahgCMdBSLJVrfGBO2wRKE1wVw8GE1fx2nXX2Au54Grc1aSiuH qKAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gbTkmP4OC3+yQ08kGFbROr+SigHxueVMyVvJ18BOaGc=; b=aFlFSjtCFhD+Lpa1KanK+Rt+yQSJHD2njSZrO6WKYwswy0cpORs7R9E13ohvIXMucx qcinAmdgDCYqsuCO0ahXVy9CPQK4oyXGJu9O6Jvqjm1RQ0j0EcWKs73zN4PrMwkvDqr/ NJYDZ9x3VSbkRLqj/orJFzeYiChk7X5j0y0RQKOFHQHaLW+QS9cJjAcUfebZjTXTSDul 1MWTT3N8uQfozp/fO9c/DmoUPwLdGFs1zZeAaMSjqHRsYhlqIXFFbJaj2w5JDivojp+N vsNZ46ZhyRGMYohrjNZLgHfQwXV3KBxqGFyjb/oh/v3NUrO+0uQBdd9AFlGCi2eVSN6k U5NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=AqFjd4Bc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e5-20020a170902ed8500b00153b2d16507si8429518plj.271.2022.04.22.13.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:44:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=AqFjd4Bc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D3B22C5C77; Fri, 22 Apr 2022 12:31:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387489AbiDUJUH (ORCPT + 99 others); Thu, 21 Apr 2022 05:20:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387437AbiDUJTt (ORCPT ); Thu, 21 Apr 2022 05:19:49 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08FBA2316F for ; Thu, 21 Apr 2022 02:17:00 -0700 (PDT) Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23L7Wr5r001897 for ; Thu, 21 Apr 2022 02:17:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=gbTkmP4OC3+yQ08kGFbROr+SigHxueVMyVvJ18BOaGc=; b=AqFjd4BcS7L37OpSYyEDJpQrEoQO61lMqAPq3hXub5ihjhDx/GWOWoEgWl44crzz7LIe Sr3U8UJ/UygSBtU7AVoBnCJoXw7Y1/HKdGrlbP/QOXZ30vqoVQjZ+N3tBruNdaj7iBzb 2/ov/q4FvP3SGdBjg5Kyn5VzgpTe7CxsosM= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fhub7eq38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 21 Apr 2022 02:17:00 -0700 Received: from twshared14141.02.ash7.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 21 Apr 2022 02:16:59 -0700 Received: by devbig039.lla1.facebook.com (Postfix, from userid 572232) id DD73F7CA75F8; Thu, 21 Apr 2022 02:14:01 -0700 (PDT) From: Dylan Yudaken To: CC: , , , , Dylan Yudaken Subject: [PATCH 0/6] return an error when cqe is dropped Date: Thu, 21 Apr 2022 02:13:39 -0700 Message-ID: <20220421091345.2115755-1-dylany@fb.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: ZQRMd3ptUJ2W7OXfNb5Y6SxJgAnjOIF2 X-Proofpoint-ORIG-GUID: ZQRMd3ptUJ2W7OXfNb5Y6SxJgAnjOIF2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-20_06,2022-04-20_01,2022-02-23_01 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series addresses a rare but real error condition when a CQE is dropped. Many applications rely on 1 SQE resulting in 1 CQE and may even block waiting for the CQE. In overflow conditions if the GFP_ATOMIC allocation fails, the CQE is dropped and a counter is incremented. Howeve= r the application is not actively signalled that something bad has happened. We would like to indicate this error condition to the application but in a way that does not rely on the application doing invasive changes such as checking a flag before each wait. This series returns an error code to the application when the error hits, and then resets the error condition. If the application is ok with this error it can continue as is, or more likely it can clean up sanely. Patches 1&2 add tracing for overflows Patches 3&4 prep for adding this error Patch 5 is the main one returning an error Patch 6 allows liburing to test these conditions more easily with IOPOLL Dylan Yudaken (6): io_uring: add trace support for CQE overflow io_uring: trace cqe overflows io_uring: rework io_uring_enter to simplify return value io_uring: use constants for cq_overflow bitfield io_uring: return an error when cqe is dropped io_uring: allow NOP opcode in IOPOLL mode fs/io_uring.c | 89 ++++++++++++++++++++++----------- include/trace/events/io_uring.h | 42 +++++++++++++++- 2 files changed, 102 insertions(+), 29 deletions(-) base-commit: 7c648b7d6186c59ed3a0e0ae4b774aaf4b415ef2 --=20 2.30.2