Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp402024iog; Thu, 30 Jun 2022 03:05:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+ASasKhMCZoCQMUNwMnmlBr0pRnOv+16FYCPtuOGjw52R1RKFIRiUo0ne9MejfnnD3bQK X-Received: by 2002:a63:6886:0:b0:40d:c2f9:2dfa with SMTP id d128-20020a636886000000b0040dc2f92dfamr7152514pgc.352.1656583517275; Thu, 30 Jun 2022 03:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656583517; cv=none; d=google.com; s=arc-20160816; b=k0ChWVoL/2YkMT2qp7/36+ROhfLOAzul8btBep3PncE3SI64E4g+gWLTGIvup7PqGU uafIcMMhVF9ZR9xQKRdGOQRTVsESjRrk7MDcyqhEl9sfAHx8JB1YGnJ3SbnIdy5e6MP+ PdIIbkAphSFzgqrFw8BNRJ+2Y1J7auptEkjDylzFuFgijBDyQbuaYDRLZK8D5C3FQaeM HvEXOtw9BRk3KfrJ27Mp+r/LoIqVZCfeiOBD1VsUnWKhuTLCWOr5oBrlERmQNvc+7QZQ CYHUjqZwp6fALRarpLLf8KMIYb5GSFK8PAlKdBGAz/FGPBIqaMWAw0J0JI8RZsGv3Dqb HxXQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/4GLmyjWNgSDAU2q7NAl1jE/TW8cFmkpQXoCGI8PVNA=; b=BGXYvwLM22/Wa2wa4BQyl+JN+wC5wwOoeh3lVCD3FPKZb2ykpP0JcUyERYTZ2+7kLB JpvF2hoSBvRoNq+/vvD8JCQKve0OszH8ryu4Cc5wjxNrk/5AKo0KoexUpVxmArHOasLP 4Zdz5i7uoUc/JJ9KnDnrBA5i6Kej/tVLFLs1Y9wNH+dA6mIUOQvT0mjch2pYmAqaAfWA +JQTvl2XUg16i4r3vFjUPXD9aacMfcLXiiup0YJyljDMHlvvPxhUCxQWU+kUoKHzpyRr PL3KHY4QSQWHCLMZkwcqMyvEivq1OQgiR3knz2Z8IHCm+Zs6hcUcjksMQy7AJ5+Cqp4U 6Q8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=U4GWugo1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a636908000000b0040da1209ed4si4220165pgc.775.2022.06.30.03.05.05; Thu, 30 Jun 2022 03:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=U4GWugo1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234188AbiF3JVW (ORCPT + 99 others); Thu, 30 Jun 2022 05:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234178AbiF3JVP (ORCPT ); Thu, 30 Jun 2022 05:21:15 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E138535857 for ; Thu, 30 Jun 2022 02:21:10 -0700 (PDT) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25U4dOAM001285 for ; Thu, 30 Jun 2022 02:21:08 -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=/4GLmyjWNgSDAU2q7NAl1jE/TW8cFmkpQXoCGI8PVNA=; b=U4GWugo1lGYTf8n1ZJEyHAPbzQwSlqUZgXExyidlKzaDiyt5DyJM+m4F2MqTwIY6S1cP 2RSP4h3HsVYQi5mb7WFuoNf1yF3fPZDLnv3LQ7Z6AvpymurjSrQFarcYRVaNAT4LUYvc v9TVmP2iPFeOLFUZecoeDOPCPNzwMTUGVzM= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3h150e9545-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 30 Jun 2022 02:21:07 -0700 Received: from twshared25478.08.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 30 Jun 2022 02:21:04 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id DEFC52599FE6; Thu, 30 Jun 2022 02:14:08 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov , CC: , , Dylan Yudaken Subject: [PATCH v2 for-next 12/12] io_uring: only trace one of complete or overflow Date: Thu, 30 Jun 2022 02:12:31 -0700 Message-ID: <20220630091231.1456789-13-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220630091231.1456789-1-dylany@fb.com> References: <20220630091231.1456789-1-dylany@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: qiIq81OsTxcL2WAxz7qZqkit8docdNlD X-Proofpoint-ORIG-GUID: qiIq81OsTxcL2WAxz7qZqkit8docdNlD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-30_05,2022-06-28_01,2022-06-22_01 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 In overflow we see a duplcate line in the trace, and in some cases 3 lines (if initial io_post_aux_cqe fails). Instead just trace once for each CQE Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 3 ++- io_uring/io_uring.h | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 523b6ebad15a..caf979cd4327 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -742,7 +742,6 @@ static bool io_fill_cqe_aux(struct io_ring_ctx *ctx, struct io_uring_cqe *cqe; =20 ctx->cq_extra++; - trace_io_uring_complete(ctx, NULL, user_data, res, cflags, 0, 0); =20 /* * If we can't get a cq entry, userspace overflowed the @@ -751,6 +750,8 @@ static bool io_fill_cqe_aux(struct io_ring_ctx *ctx, */ cqe =3D io_get_cqe(ctx); if (likely(cqe)) { + trace_io_uring_complete(ctx, NULL, user_data, res, cflags, 0, 0); + WRITE_ONCE(cqe->user_data, user_data); WRITE_ONCE(cqe->res, res); WRITE_ONCE(cqe->flags, cflags); diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index e022d71c177a..868f45d55543 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -101,10 +101,6 @@ static inline bool __io_fill_cqe_req(struct io_ring_= ctx *ctx, { struct io_uring_cqe *cqe; =20 - trace_io_uring_complete(req->ctx, req, req->cqe.user_data, - req->cqe.res, req->cqe.flags, - (req->flags & REQ_F_CQE32_INIT) ? req->extra1 : 0, - (req->flags & REQ_F_CQE32_INIT) ? req->extra2 : 0); /* * If we can't get a cq entry, userspace overflowed the * submission (by quite a lot). Increment the overflow count in @@ -113,6 +109,12 @@ static inline bool __io_fill_cqe_req(struct io_ring_= ctx *ctx, cqe =3D io_get_cqe(ctx); if (unlikely(!cqe)) return io_req_cqe_overflow(req); + + trace_io_uring_complete(req->ctx, req, req->cqe.user_data, + req->cqe.res, req->cqe.flags, + (req->flags & REQ_F_CQE32_INIT) ? req->extra1 : 0, + (req->flags & REQ_F_CQE32_INIT) ? req->extra2 : 0); + memcpy(cqe, &req->cqe, sizeof(*cqe)); =20 if (ctx->flags & IORING_SETUP_CQE32) { --=20 2.30.2