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=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 B7553C433FE for ; Fri, 3 Sep 2021 18:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A18B96054E for ; Fri, 3 Sep 2021 18:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350785AbhICStA (ORCPT ); Fri, 3 Sep 2021 14:49:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:41332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350567AbhICSs4 (ORCPT ); Fri, 3 Sep 2021 14:48:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 779DE610A1; Fri, 3 Sep 2021 18:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630694876; bh=hT4RRpDObCrnqrIR/+8EtNZkR2fPesdsprcdlGFcdQg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7eoWV5Oc+mxNeU6xDgBsGQXlSQp4DrBk03yqy+9FA7qDJ7qtKDz6KS/G9mrZwmv5 3mlCxWPFaj+ELLcLcfZnPYK5VPpr0Y8+n3w8EcuZgo6E5M/ge+iuTSGdKYeK8dUUt4 aIs15/N269kT5ZvU6wgJtijOORJX/rqXc6BPOTLHWkYf2fUtD0Eb1Pj9y+NjM3sl5j 4+36lDXfsFf58nMQ3TBuMJWqXhEOREZPYbz98il2a/Fa4eOLui3gH8amHRcEb5mLnh O8rofMu+3Mw3WI/bsNbuJ5fsZYIvt/efcLvhqR955Ay85aXvZOrIZ+l9Uw6HTMF30O sP2xlMHsEr88A== Date: Fri, 3 Sep 2021 11:47:55 -0700 From: "Darrick J. Wong" To: Linus Torvalds Cc: Andreas Gruenbacher , Alexander Viro , Christoph Hellwig , Jan Kara , Matthew Wilcox , cluster-devel , linux-fsdevel , LKML , ocfs2-devel@oss.oracle.com Subject: Re: [PATCH v7 16/19] iomap: Add done_before argument to iomap_dio_rw Message-ID: <20210903184755.GC9892@magnolia> References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-17-agruenba@redhat.com> <20210827183018.GJ12664@magnolia> <20210827213239.GH12597@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 03:35:06PM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 2:32 PM Darrick J. Wong wrote: > > > > No, because you totally ignored the second question: > > > > If the directio operation succeeds even partially and the PARTIAL flag > > is set, won't that push the iov iter ahead by however many bytes > > completed? > > > > We already finished the IO for the first page, so the second attempt > > should pick up where it left off, i.e. the second page. > > Darrick, I think you're missing the point. > > It's the *return*value* that is the issue, not the iovec. > > The iovec is updated as you say. But the return value from the async > part is - without Andreas' patch - only the async part of it. > > With Andreas' patch, the async part will now return the full return > value, including the part that was done synchronously. > > And the return value is returned from that async part, which somehow > thus needs to know what predated it. Aha, that was the missing piece, thank you. I'd forgotten that iomap_dio_complete_work calls iocb->ki_complete with the return value of iomap_dio_complete, which means that the iomap_dio has to know if there was a previous transfer that stopped short so that the caller could do more work and resubmit. > Could that pre-existing part perhaps be saved somewhere else? Very > possibly. That 'struct iomap_dio' addition is kind of ugly. So maybe > what Andreas did could be done differently. There's probably a more elegant way for the ->ki_complete functions to figure out how much got transferred, but that's sufficiently ugly and invasive so as not to be suitable for a bug fix. > But I think you guys are arguing past each other. Yes, definitely. --D > > Linus 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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 C6E4FC433F5 for ; Fri, 3 Sep 2021 18:51:13 +0000 (UTC) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F23060C51 for ; Fri, 3 Sep 2021 18:51:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7F23060C51 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=oss.oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 183ITdT8020887; Fri, 3 Sep 2021 18:51:13 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3audq7j1dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 03 Sep 2021 18:51:12 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 183IU0Yb043530; Fri, 3 Sep 2021 18:51:11 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3020.oracle.com with ESMTP id 3ate01xc52-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Fri, 03 Sep 2021 18:51:11 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mMEEL-0006Jd-Fw; Fri, 03 Sep 2021 11:48:01 -0700 Received: from userp3020.oracle.com ([156.151.31.79]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mMEEJ-0006JN-E3 for ocfs2-devel@oss.oracle.com; Fri, 03 Sep 2021 11:47:59 -0700 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 183IU2VN043671 for ; Fri, 3 Sep 2021 18:47:59 GMT Received: from mx0a-00069f01.pphosted.com (mx0a-00069f01.pphosted.com [205.220.165.26]) by userp3020.oracle.com with ESMTP id 3ate01x8mf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 03 Sep 2021 18:47:59 +0000 Received: from pps.filterd (m0246573.ppops.net [127.0.0.1]) by mx0b-00069f01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 183GWUV5027714 for ; Fri, 3 Sep 2021 18:47:57 GMT Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx0b-00069f01.pphosted.com with ESMTP id 3au37rf580-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 03 Sep 2021 18:47:57 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 779DE610A1; Fri, 3 Sep 2021 18:47:56 +0000 (UTC) Date: Fri, 3 Sep 2021 11:47:55 -0700 From: "Darrick J. Wong" To: Linus Torvalds Message-ID: <20210903184755.GC9892@magnolia> References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-17-agruenba@redhat.com> <20210827183018.GJ12664@magnolia> <20210827213239.GH12597@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Source-IP: 198.145.29.99 X-ServerName: mail.kernel.org X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 mx include:_spf.kernel.org ~all X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10096 signatures=668682 X-Proofpoint-Spam-Reason: safe X-Spam: OrgSafeList X-SpamRule: orgsafelist Cc: cluster-devel , Jan Kara , Andreas Gruenbacher , LKML , Christoph Hellwig , Alexander Viro , linux-fsdevel , ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [PATCH v7 16/19] iomap: Add done_before argument to iomap_dio_rw X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10096 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2108310000 definitions=main-2109030110 X-Proofpoint-ORIG-GUID: NtZID_iOBLHl98PUMkVe4MuUWidN11ly X-Proofpoint-GUID: NtZID_iOBLHl98PUMkVe4MuUWidN11ly On Fri, Aug 27, 2021 at 03:35:06PM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 2:32 PM Darrick J. Wong wrote: > > > > No, because you totally ignored the second question: > > > > If the directio operation succeeds even partially and the PARTIAL flag > > is set, won't that push the iov iter ahead by however many bytes > > completed? > > > > We already finished the IO for the first page, so the second attempt > > should pick up where it left off, i.e. the second page. > > Darrick, I think you're missing the point. > > It's the *return*value* that is the issue, not the iovec. > > The iovec is updated as you say. But the return value from the async > part is - without Andreas' patch - only the async part of it. > > With Andreas' patch, the async part will now return the full return > value, including the part that was done synchronously. > > And the return value is returned from that async part, which somehow > thus needs to know what predated it. Aha, that was the missing piece, thank you. I'd forgotten that iomap_dio_complete_work calls iocb->ki_complete with the return value of iomap_dio_complete, which means that the iomap_dio has to know if there was a previous transfer that stopped short so that the caller could do more work and resubmit. > Could that pre-existing part perhaps be saved somewhere else? Very > possibly. That 'struct iomap_dio' addition is kind of ugly. So maybe > what Andreas did could be done differently. There's probably a more elegant way for the ->ki_complete functions to figure out how much got transferred, but that's sufficiently ugly and invasive so as not to be suitable for a bug fix. > But I think you guys are arguing past each other. Yes, definitely. --D > > Linus _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darrick J. Wong Date: Fri, 3 Sep 2021 11:47:55 -0700 Subject: [Cluster-devel] [PATCH v7 16/19] iomap: Add done_before argument to iomap_dio_rw In-Reply-To: References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-17-agruenba@redhat.com> <20210827183018.GJ12664@magnolia> <20210827213239.GH12597@magnolia> Message-ID: <20210903184755.GC9892@magnolia> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Aug 27, 2021 at 03:35:06PM -0700, Linus Torvalds wrote: > On Fri, Aug 27, 2021 at 2:32 PM Darrick J. Wong wrote: > > > > No, because you totally ignored the second question: > > > > If the directio operation succeeds even partially and the PARTIAL flag > > is set, won't that push the iov iter ahead by however many bytes > > completed? > > > > We already finished the IO for the first page, so the second attempt > > should pick up where it left off, i.e. the second page. > > Darrick, I think you're missing the point. > > It's the *return*value* that is the issue, not the iovec. > > The iovec is updated as you say. But the return value from the async > part is - without Andreas' patch - only the async part of it. > > With Andreas' patch, the async part will now return the full return > value, including the part that was done synchronously. > > And the return value is returned from that async part, which somehow > thus needs to know what predated it. Aha, that was the missing piece, thank you. I'd forgotten that iomap_dio_complete_work calls iocb->ki_complete with the return value of iomap_dio_complete, which means that the iomap_dio has to know if there was a previous transfer that stopped short so that the caller could do more work and resubmit. > Could that pre-existing part perhaps be saved somewhere else? Very > possibly. That 'struct iomap_dio' addition is kind of ugly. So maybe > what Andreas did could be done differently. There's probably a more elegant way for the ->ki_complete functions to figure out how much got transferred, but that's sufficiently ugly and invasive so as not to be suitable for a bug fix. > But I think you guys are arguing past each other. Yes, definitely. --D > > Linus