From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88833C12002 for ; Wed, 21 Jul 2021 19:00:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0096561222 for ; Wed, 21 Jul 2021 19:00:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0096561222 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 383646B005D; Wed, 21 Jul 2021 15:00:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 332C26B006C; Wed, 21 Jul 2021 15:00:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FB6F6B0070; Wed, 21 Jul 2021 15:00:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id 07A426B005D for ; Wed, 21 Jul 2021 15:00:50 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AC06B2040D for ; Wed, 21 Jul 2021 19:00:49 +0000 (UTC) X-FDA: 78387511818.06.40CAB8C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 677AD80246CC for ; Wed, 21 Jul 2021 19:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626894046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1gH3Ux0CT6hU+v/YeUAIBalSzkDA3DKDpAjmYag8B8E=; b=M8aEFMzzUDrMdh2bryhNr/ZVGVkmsukeRdYu4TGetK9Xowy+h7fTelS1DC62EQbZfwXzI1 UJ6y+atL0U1v/N3gf0h57gCBY7bL6s9xukoY6gDfC5P797PWUw1dI/IRJLmLbC803LhjZU pB6utSrcy78X0PbGnuWTwbSrmfKxDoE= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-2kC6NO6rMb-lxYlGOw035A-1; Wed, 21 Jul 2021 15:00:45 -0400 X-MC-Unique: 2kC6NO6rMb-lxYlGOw035A-1 Received: by mail-qk1-f200.google.com with SMTP id 81-20020a370b540000b02903b854c43335so2309995qkl.21 for ; Wed, 21 Jul 2021 12:00:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=1gH3Ux0CT6hU+v/YeUAIBalSzkDA3DKDpAjmYag8B8E=; b=q3NdhMPPT/E4LZ17/dcd/IRRSdmh9dS3WCDwDjH3DQZAWixJ3p2ILoPE/ej4hLFcPu 6y46aRp1pQJyMja1y87fu9ywEqSbYPW7DraghBzyETMRb9Sv3UevQEaQVbauXd+1wbmV jmnhYFdOhdY8ccN0+GREWwXqOuiMaCnmTDN8Oz+GrVM2x6sPQwdDcV9t0rw9kiWp/qmE 2kfXyZuqvUPgzFCrQfduToP40X/d9XjfM5f2c/3Nh/uET3KbnKOY40GSyLIqETV9sHhW hsxFqVnt3aSrBW6qRIUeiCc32m39c0VMR1NIUygjcsrLFqyHl5nwQQ4aAjsf8KV5a5jC ugmg== X-Gm-Message-State: AOAM531PcBs6g6zlofYcreoBE+SbCe2ZJ1aQAf/qzNZTb/s4X+QgTE9W fj+wZkzeFZTJ8C9B8PFL43L4kpc7y2Z115zYJb6MN68qar3e7BbdYd8OJHFQ+rNvGJWNQ+5YpPu I68GznR+ptC8= X-Received: by 2002:a0c:e70f:: with SMTP id d15mr4739155qvn.47.1626894045412; Wed, 21 Jul 2021 12:00:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLJs8XXnPDqD0EYRCTwpJGY8jpuBbe7MH5DxMPfLcBBLk08k/UTRTJHL2M7llSs52l9VDF/g== X-Received: by 2002:a0c:e70f:: with SMTP id d15mr4739113qvn.47.1626894045207; Wed, 21 Jul 2021 12:00:45 -0700 (PDT) Received: from [192.168.1.3] (68-20-15-154.lightspeed.rlghnc.sbcglobal.net. [68.20.15.154]) by smtp.gmail.com with ESMTPSA id x7sm9290487qtw.24.2021.07.21.12.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 12:00:44 -0700 (PDT) Message-ID: <56b3c140a388b98f74f2e71c656e77655da3129f.camel@redhat.com> Subject: Re: [RFC PATCH 03/12] netfs: Remove netfs_read_subrequest::transferred From: Jeff Layton To: David Howells Cc: linux-fsdevel@vger.kernel.org, "Matthew Wilcox (Oracle)" , Anna Schumaker , Steve French , Dominique Martinet , Mike Marshall , David Wysochanski , Shyam Prasad N , Miklos Szeredi , Linus Torvalds , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Wed, 21 Jul 2021 15:00:43 -0400 In-Reply-To: <298117.1626893692@warthog.procyon.org.uk> References: <162687506932.276387.14456718890524355509.stgit@warthog.procyon.org.uk> <162687511125.276387.15493860267582539643.stgit@warthog.procyon.org.uk> <298117.1626893692@warthog.procyon.org.uk> User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M8aEFMzz; spf=none (imf06.hostedemail.com: domain of jlayton@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=jlayton@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Stat-Signature: pw1kgi4g1qopw1o4fwwfzocum4brby4x X-Rspamd-Queue-Id: 677AD80246CC X-HE-Tag: 1626894047-756736 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 2021-07-21 at 19:54 +0100, David Howells wrote: > Jeff Layton wrote: > > > The above two deltas seem like they should have been in patch #2. > > Yeah. Looks like at least partially so. > > > > @@ -635,15 +625,8 @@ void netfs_subreq_terminated(struct netfs_read_subrequest *subreq, > > > goto failed; > > > } > > > > > > - if (WARN(transferred_or_error > subreq->len - subreq->transferred, > > > - "Subreq overread: R%x[%x] %zd > %zu - %zu", > > > - rreq->debug_id, subreq->debug_index, > > > - transferred_or_error, subreq->len, subreq->transferred)) > > > - transferred_or_error = subreq->len - subreq->transferred; > > > - > > > subreq->error = 0; > > > - subreq->transferred += transferred_or_error; > > > - if (subreq->transferred < subreq->len) > > > + if (iov_iter_count(&subreq->iter)) > > > goto incomplete; > > > > > > > I must be missing it, but where does subreq->iter get advanced to the > > end of the current read? If you're getting rid of subreq->transferred > > then I think that has to happen above, no? > > For afs, afs_req_issue_op() points fsreq->iter at the subrequest iterator and > calls afs_fetch_data(). Thereafter, we wend our way to > afs_deliver_fs_fetch_data() or yfs_deliver_fs_fetch_data() which set > call->iter to point to that iterator and then call afs_extract_data() which > passes it to rxrpc_kernel_recv_data(), which eventually passes it to > skb_copy_datagram_iter(), which advances the iterator. > > For the cache, the subrequest iterator is passed to the cache backend by > netfs_read_from_cache(). This would be cachefiles_read() which calls > vfs_iocb_iter_read() which I thought advances the iterator (leastways, > filemap_read() keeps going until iov_iter_count() reaches 0 or some other stop > condition occurs and doesn't thereafter call iov_iter_revert()). > Ok, this will probably regress ceph then. We don't really have anything to do with the subreq->iter at this point and this patch doesn't change that. If you're going to make this change, it'd be cleaner to also fix up ceph_netfs_issue_op to advance the iter at the same time. -- Jeff Layton