Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp628850rwe; Fri, 14 Apr 2023 07:45:42 -0700 (PDT) X-Google-Smtp-Source: AKy350af9QwqQpi2wAp7f0mDOrrZ8orZs10gANJ89wF/1uDj9HsxpR/+Z1ekoXBJhkzikcmNdMnQ X-Received: by 2002:a17:902:e391:b0:1a4:f295:32fa with SMTP id g17-20020a170902e39100b001a4f29532famr2945511ple.15.1681483542357; Fri, 14 Apr 2023 07:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681483542; cv=none; d=google.com; s=arc-20160816; b=d+0aSOi/88ha2vf2uxPQYQl7NIOYmEex0oVXKQgf9tTO5xSBut+9KkkJSdWDgkLR8e mjBwaVbVGsXBD3EMMECq29B1hAnVcD0aiFAhznlwGglrIqbUF2L9zYZySocucDFmF43w 7JmBHmjCgm//rcFazzmxBX8LT7eFsjeVcmCsJPbdRbE9S+zBQ7+mnyYtk9RCX7nvYOjR cFBfdclw2Hi11J81uNCxK5O++z1K7k3O8gsft4r19TiBw/1oQqQjzKHBCFdv991Zmnap ExspltVu1xZb4EcCmJ3ZY2zkjhVljxKxiTs60qutjdpuCBVBpNPDregQej/33uvRj7MA 1n2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:subject:cc:to:from:message-id:date :dkim-signature; bh=B5UHHY4qkZgde2P72x31MsOhkreduRK3Nn0KXMSn7h8=; b=JlKg6huOuZIZafDO9LGqfNvwrlNt2+jBtcLwFE4n2aGd8XxAQd/G3NXAW8VcnHnvW2 22M18kXr6xnhNIJ6A/AZacS/N2ToAknf1ENjHBbSNR6j9wB1M3AUpYkFtzsBVSfKy5X3 6qxH+4omShojIawNarVz5A5ljHecirwBmee5RB7jDTNu87Lbbfxjv4wLWPiaYiK+beZA gLQdtvruLh8BtAczM1HzCXMdUQmMajz3zjWaorCLwNyC76YNJ2VLrXuvKIouig/IBWdk xLY8u0yn1hsPLGFP3ROBNL6GC+u7WVQ3Qa/tkN7uIt/5fvc4FPCkcjDNiBWaGD/d8zg/ n/XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=M72KdtTk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a170902e74100b00189891763f3si5274078plf.600.2023.04.14.07.45.26; Fri, 14 Apr 2023 07:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@gmail.com header.s=20221208 header.b=M72KdtTk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbjDNOjI (ORCPT + 99 others); Fri, 14 Apr 2023 10:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbjDNOjF (ORCPT ); Fri, 14 Apr 2023 10:39:05 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F0CC145; Fri, 14 Apr 2023 07:39:02 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1a677dffb37so5220605ad.2; Fri, 14 Apr 2023 07:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681483142; x=1684075142; h=in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=B5UHHY4qkZgde2P72x31MsOhkreduRK3Nn0KXMSn7h8=; b=M72KdtTk7G8UWBqwpXiBXxsb8CvQPXOjaG4NAqqKEjuhX1831H/nRJUmpcoCrDOg8g DeFSpT5y+dJeOe6kmPY1c5CI/f6qdEGUjoR1HfdEXcAFa/NGQHfyyTZOrHF0uXbzxAxA 3PlJHVzgUpT98prjEhxZELf90zLiZQvdqNbkmUwbb+hgZgHPBaJgmtsGQoHVigjzZISf OZLn+yYPD9jWt/Bj0DmBxElYNA8MvOcUj7V680GKEYod7JTI2Z/nKtVy+EPYPyCjJzSx BbixNnHKqfpgRPC+iOdwcACg1emNRUhU3lHEK0Ow3JU12cBAfBT4SFKyUdiOmLuenS7b u6Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681483142; x=1684075142; h=in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=B5UHHY4qkZgde2P72x31MsOhkreduRK3Nn0KXMSn7h8=; b=UGy0FFbQUXmQbrJfMiBJFN0p7xQZxs23XWp2KiAnogQ0A5hv38oEnXqkncA4r4ap8Q wWNQGklDPON2yIUPskQw4vFe1YRoSpGjWqB/YSxpjdgDMYWaFR5PyI0RfAwft4MIkxjB seKjB2B0qSO6SA0k/00l0Xkfi/iBWKt4uOvuuh8xhLMm9dnlaysuVFiZxq5kQJi9agnB xw4vuek1NJWJ9CmjmQO/kenk4klU1YYbJUF93yPj/nwk0KXocfDj1VIm6Cq3cVNkOKxu boFZ4rRJV7Es0m/JoqJZnO447SCAdRqJMflsHUb3s1OwuosDlY859DrGaqfdOus8A0Df 4wzw== X-Gm-Message-State: AAQBX9edkL8A9CznWAU1xXKxV84HhwHaJOBbLGaZtsXMbtGQhDJInPBv VR3kRbeiX7GIyEfde/HtuthtyI+EF8E= X-Received: by 2002:a05:6a00:21d4:b0:639:ae5e:ac57 with SMTP id t20-20020a056a0021d400b00639ae5eac57mr8290511pfj.1.1681483142127; Fri, 14 Apr 2023 07:39:02 -0700 (PDT) Received: from rh-tp ([2406:7400:63:7035:9095:349e:5f0b:ded0]) by smtp.gmail.com with ESMTPSA id 23-20020aa79257000000b0062df30c7e7esm3119617pfp.136.2023.04.14.07.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 07:39:01 -0700 (PDT) Date: Fri, 14 Apr 2023 20:08:55 +0530 Message-Id: <87y1muy1ds.fsf@doe.com> From: Ritesh Harjani (IBM) To: Christoph Hellwig Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara , "Darrick J . Wong" , Ojaswin Mujoo , Disha Goel Subject: Re: [RFCv3 10/10] iomap: Add trace points for DIO path In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-ext4@vger.kernel.org Christoph Hellwig writes: > On Fri, Apr 14, 2023 at 01:26:38PM +0530, Ritesh Harjani wrote: >> How about this below change? Does this look good to you? >> It should cover all error types and both entry and exit. > > I don't think it is very useful. The complete tracepoint is the > end of the I/O. Having a separate end one doesn't make sense. > That's why I suggested a queued one for the asynchronous case. Ok, does this look good then? diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 36ab1152dbea..859efb5de1bf 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -130,6 +130,7 @@ ssize_t iomap_dio_complete(struct iomap_dio *dio) if (ret > 0) ret += dio->done_before; + trace_iomap_dio_complete(iocb, dio->error, ret); kfree(dio); return ret; @@ -650,8 +651,12 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, */ dio->wait_for_completion = wait_for_completion; if (!atomic_dec_and_test(&dio->ref)) { - if (!wait_for_completion) - return ERR_PTR(-EIOCBQUEUED); + if (!wait_for_completion) { + ret = -EIOCBQUEUED; + trace_iomap_dio_rw_queued(iocb, iter, dio_flags, + done_before, ret); + return ERR_PTR(ret); + } for (;;) { set_current_state(TASK_UNINTERRUPTIBLE); -ritesh