Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp587270rdb; Fri, 17 Nov 2023 07:17:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6CziYJby9i7V7aw6yxNa72j7dUbEheg10GS3QVBr+r+gTzGCnwuSMcVFT6Jkbg3Vqt4oa X-Received: by 2002:a17:902:e88e:b0:1cc:5505:fff3 with SMTP id w14-20020a170902e88e00b001cc5505fff3mr15978143plg.30.1700234248121; Fri, 17 Nov 2023 07:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700234248; cv=none; d=google.com; s=arc-20160816; b=X0zBHI8uCGlfOYmYQtNXqVx7O5IBobUUvS9C4VyY0tt8Ceysi7Np3mRmUBD6oG0uNG AMMPlqbzZeIAb6aHyBih2fCLoBoySyml7JMwgnxCGoxztLK3tGeTqmhKyTGIE+U1iY7D ADD41FNnPlBlEYE0J+yBrp7LYRtqqTwDXel6PwlsczGDbSfqo5SsGQb3gTH+1DJNnHjR Vb5zPN6dAz58h7IW/E+1d+JXOB8sdZcWyRA8FyBh+PhXwdvdjRhxQHnQG7X8Kyx3KUHs dy30874ghY25YHYpjW+MTqr+z2HV6/kt39t0tRF0hMHBonHwjKUQAzmwTgV0THWm1mim gcKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hFf/VbtS6D6kC+GxcmqNT3xq8ktotBcayz+vRXoVGI0=; fh=STLLaOugPM+xKhE1qM4+JykQZemZuTeSJMIedf9BTTc=; b=z5YZcRCkmaCnnjDnw5BDOHm8TplyRt6Gl3yKsVfYw+x8X/sXVoglO6WZx4PNXCtU+/ y8u+b958ruJeO6CaeQGWAKyJFxNRTs4uPAgzQNHxGQzR9CJkn7doyIvQpXvXu4PrMVB1 CPyjj51iNBbFDaa4OfkAijm5XiHHqFLJ8KnBJ2B0a/x7fA8oQzTCB1prVZMli9gV+kLr pVeZS3Zk3HWMansNQigRy4kK6NIQdioDswMuK+28oK4dTFEmpHhyct/rufOOCZLoK/Ni b/RX5VwuGG0BFQLyF8QlR0QJ+kzm0xDCFciSA7Vz/Vr9A0MlG+8lHuxKP7Th4Y52RrWs QAgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cNSTmCWk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v1-20020a170903238100b001ce0d52c211si2189592plh.83.2023.11.17.07.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 07:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cNSTmCWk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id EE6AA81BDBB5; Fri, 17 Nov 2023 07:16:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbjKQPQx (ORCPT + 99 others); Fri, 17 Nov 2023 10:16:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjKQPQw (ORCPT ); Fri, 17 Nov 2023 10:16:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B53FD57 for ; Fri, 17 Nov 2023 07:16:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C109C433C9 for ; Fri, 17 Nov 2023 15:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700234209; bh=rzdTtGq8+YDjnbwXqHnHuokXpoEfkz9nXuVvXAUg4tY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cNSTmCWk0fdedpwUcxfG+VYy8fXSewnLkfkqJpu2uJaMiyXPoJS+IVljN6l2ehcBf yUS8MWPFEOzh54V7Y3VjQMPys0I13yRwCWgDylYgI1qV6Yldgklh741Wa3YmNyOAm1 CW+5QTRAk0I2PJ19DlKrm/VzDX3U0F4L6BRGESK9e2UE+olxDml/JxGCK2ZgG62zlv SHl2aGGffpgdS0TRNY2+6CbGFRMGr6pNKVZ0YJqqCVFDQbk0xConejbn+gssO0TYt+ 4bowe2Q7w0tTMt4gt3Twrpyd9GgkD376OahPrGLZY70azEARBmveV3Z9uJ5fl9evCb gpy/IUQc+Rmow== Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-41ea8debcdaso11371071cf.1 for ; Fri, 17 Nov 2023 07:16:49 -0800 (PST) X-Gm-Message-State: AOJu0YzdktF7MxOcxoBcLyCzGqXRjipDmyktxDsgzV0RBEBveT+XPRPj Snh2NLSWUnTVzmQWuKbcZppNZCkwi8s++Ij1DpA= X-Received: by 2002:a05:622a:315:b0:41e:1c35:91d6 with SMTP id q21-20020a05622a031500b0041e1c3591d6mr14856010qtw.39.1700234208368; Fri, 17 Nov 2023 07:16:48 -0800 (PST) MIME-Version: 1.0 References: <21a1f2a6155398965f79ed64f0bd23bf38a50367.1700220277.git.bcodding@redhat.com> <0bdf152bc69f7dcf91c9c70ffcbab92ac03682f0.1700220277.git.bcodding@redhat.com> In-Reply-To: <0bdf152bc69f7dcf91c9c70ffcbab92ac03682f0.1700220277.git.bcodding@redhat.com> From: Anna Schumaker Date: Fri, 17 Nov 2023 10:16:32 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] NFS: drop unused nfs_direct_req bytes_left To: Benjamin Coddington Cc: trond.myklebust@hammerspace.com, linux-nfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 07:16:52 -0800 (PST) Hi Ben, On Fri, Nov 17, 2023 at 6:25=E2=80=AFAM Benjamin Coddington wrote: > > Now that we're calculating how large a remaining IO should be based > on the current request's offset, we no longer need to track bytes_left on > each struct nfs_direct_req. Drop the field, and clean up the direct > request tracepoints. v2 works better for me! Thanks for fixing that up! Anna > > Signed-off-by: Benjamin Coddington > --- > fs/nfs/direct.c | 6 ++---- > fs/nfs/internal.h | 1 - > fs/nfs/nfstrace.h | 6 ++---- > 3 files changed, 4 insertions(+), 9 deletions(-) > > diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c > index 5918c67dae0d..c03926a1cc73 100644 > --- a/fs/nfs/direct.c > +++ b/fs/nfs/direct.c > @@ -369,7 +369,6 @@ static ssize_t nfs_direct_read_schedule_iovec(struct = nfs_direct_req *dreq, > bytes -=3D req_len; > requested_bytes +=3D req_len; > pos +=3D req_len; > - dreq->bytes_left -=3D req_len; > } > nfs_direct_release_pages(pagevec, npages); > kvfree(pagevec); > @@ -441,7 +440,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, stru= ct iov_iter *iter, > goto out; > > dreq->inode =3D inode; > - dreq->bytes_left =3D dreq->max_count =3D count; > + dreq->max_count =3D count; > dreq->io_start =3D iocb->ki_pos; > dreq->ctx =3D get_nfs_open_context(nfs_file_open_context(iocb->ki= _filp)); > l_ctx =3D nfs_get_lock_context(dreq->ctx); > @@ -874,7 +873,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct= nfs_direct_req *dreq, > bytes -=3D req_len; > requested_bytes +=3D req_len; > pos +=3D req_len; > - dreq->bytes_left -=3D req_len; > > if (defer) { > nfs_mark_request_commit(req, NULL, &cinfo= , 0); > @@ -981,7 +979,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, str= uct iov_iter *iter, > goto out; > > dreq->inode =3D inode; > - dreq->bytes_left =3D dreq->max_count =3D count; > + dreq->max_count =3D count; > dreq->io_start =3D pos; > dreq->ctx =3D get_nfs_open_context(nfs_file_open_context(iocb->ki= _filp)); > l_ctx =3D nfs_get_lock_context(dreq->ctx); > diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h > index b1fa81c9dff6..e3722ce6722e 100644 > --- a/fs/nfs/internal.h > +++ b/fs/nfs/internal.h > @@ -936,7 +936,6 @@ struct nfs_direct_req { > loff_t io_start; /* Start offset for I/O *= / > ssize_t count, /* bytes actually process= ed */ > max_count, /* max expected count */ > - bytes_left, /* bytes left to be sent = */ > error; /* any reported error */ > struct completion completion; /* wait for i/o completio= n */ > > diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h > index 4e90ca531176..03cbc3893cef 100644 > --- a/fs/nfs/nfstrace.h > +++ b/fs/nfs/nfstrace.h > @@ -1539,7 +1539,6 @@ DECLARE_EVENT_CLASS(nfs_direct_req_class, > __field(u32, fhandle) > __field(loff_t, offset) > __field(ssize_t, count) > - __field(ssize_t, bytes_left) > __field(ssize_t, error) > __field(int, flags) > ), > @@ -1554,19 +1553,18 @@ DECLARE_EVENT_CLASS(nfs_direct_req_class, > __entry->fhandle =3D nfs_fhandle_hash(fh); > __entry->offset =3D dreq->io_start; > __entry->count =3D dreq->count; > - __entry->bytes_left =3D dreq->bytes_left; > __entry->error =3D dreq->error; > __entry->flags =3D dreq->flags; > ), > > TP_printk( > "error=3D%zd fileid=3D%02x:%02x:%llu fhandle=3D0x= %08x " > - "offset=3D%lld count=3D%zd bytes_left=3D%zd flags= =3D%s", > + "offset=3D%lld count=3D%zd flags=3D%s", > __entry->error, MAJOR(__entry->dev), > MINOR(__entry->dev), > (unsigned long long)__entry->fileid, > __entry->fhandle, __entry->offset, > - __entry->count, __entry->bytes_left, > + __entry->count, > nfs_show_direct_req_flags(__entry->flags) > ) > ); > -- > 2.41.0 >