Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10584043ybl; Thu, 26 Dec 2019 21:33:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwDJ9l+VZ+hl/2L55Sze9DK/4WdLYSGOhXLRVIRZSZ8agk4wjj8zxNDuU/2xy4s4osBlhHF X-Received: by 2002:a9d:5888:: with SMTP id x8mr52454202otg.361.1577424780358; Thu, 26 Dec 2019 21:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577424780; cv=none; d=google.com; s=arc-20160816; b=PHeodGiBhFqqlV1BaAZWvqgrwYdpoLkc3GJFelvKigB02JMAJOn++r9FL8mCleszVf 8PvUVtIfiTjYnOAb+UBPBaU/asX97Wym7UJhQ3j+2bDFWqsHWni8iRbWV1eisM+g9wD5 C0crJNqHZEiwS5yubuG/ymjzYdR5nb6woZuzK0w5banOeq5BvRAbsaFsEzGUNC4vU9RR FXpsfDKURx1ApOHBd5aDm0ATXxRsAqBcYs+aOQ6SgFQwSdh95/vTAdl8yPu/6mBFX4o+ 1pUUbrqZsoicMDuexWH06wXFhHMaJG8xJaznhvZRzybGQ9dUXUHBksDYfpJapmPh9IeN S/mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=SYRbtcwzZWs6YnIaG9BfFQxSgjjw2bBAs/j3hxHv8is=; b=bTgG/bdvYwyd2BUXR9jbOKNWiBqnHz08CXyUFL12iU8W8r3Jf/K5PLjjnFqrPNh+Xc t6PSPZfcO0hqVh7TyqU0bnoIpr2i8MxGUkdz3zBPK9PmN+8ilxs7E8GlQhpBrrrutUkJ oDyYkJtIbPU31jxcKuDPLyCDg40xBbmmJTRLT0bL7tf9v25Rv+zhv9CyuisoTKEXaoLE pxuNCLNU4tAQj25/I+l3NcroWv2FZ76nakE6xkXffyiDwtVPBsAx6mOYzfG3tnT6z1wX ug1d4bRDns7FNLDpk6pq5unyMqFwibj/4D5xy9CW8g9kD2HE8yeD3OjkDbAvZlqbNlGZ 3msg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si15294116otl.213.2019.12.26.21.32.40; Thu, 26 Dec 2019 21:33:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbfL0Fcj (ORCPT + 99 others); Fri, 27 Dec 2019 00:32:39 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37654 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfL0Fcj (ORCPT ); Fri, 27 Dec 2019 00:32:39 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBR5WB0I140687 for ; Fri, 27 Dec 2019 00:32:37 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2x1f3f8p89-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Dec 2019 00:32:37 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Dec 2019 05:32:35 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 27 Dec 2019 05:32:33 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBR5WXVj58917116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Dec 2019 05:32:33 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F9BF11C054; Fri, 27 Dec 2019 05:32:33 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A103111C058; Fri, 27 Dec 2019 05:32:31 +0000 (GMT) Received: from [9.199.159.72] (unknown [9.199.159.72]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 27 Dec 2019 05:32:31 +0000 (GMT) Subject: Re: [PATCH] ext4: Optimize ext4 DIO overwrites To: "Theodore Y. Ts'o" , Jan Kara Cc: linux-ext4@vger.kernel.org, Dan Williams , "Berrocal, Eduardo" References: <20191218174433.19380-1-jack@suse.cz> <20191219135329.529E3A404D@d06av23.portsmouth.uk.ibm.com> <20191219192823.GA5389@quack2.suse.cz> <20191226171731.GE3158@mit.edu> From: Ritesh Harjani Date: Fri, 27 Dec 2019 11:02:30 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191226171731.GE3158@mit.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19122705-0012-0000-0000-00000378656B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19122705-0013-0000-0000-000021B46A0D Message-Id: <20191227053231.A103111C058@d06av25.portsmouth.uk.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-26_07:2019-12-24,2019-12-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxlogscore=822 mlxscore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912270043 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 12/26/19 10:47 PM, Theodore Y. Ts'o wrote: > On Thu, Dec 19, 2019 at 08:28:23PM +0100, Jan Kara wrote: >>> However depending on which patch lands first one may need a >>> re-basing. Will conflict with this- >>> https://marc.info/?l=linux-ext4&m=157613016931238&w=2 >> >> Yes, but the conflict is minor and trivial to resolve. >> > > Is this the correct resolution? > > --- a/fs/ext4/file.c > +++ b/fs/ext4/file.c > @@ -447,6 +447,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) > struct inode *inode = file_inode(iocb->ki_filp); > loff_t offset = iocb->ki_pos; > size_t count = iov_iter_count(from); > + const struct iomap_ops *iomap_ops = &ext4_iomap_ops; > bool extend = false, unaligned_io = false; > bool ilock_shared = true; > > @@ -526,7 +527,9 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) > ext4_journal_stop(handle); > } > > - ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops, > + if (ilock_shared) > + iomap_ops = &ext4_iomap_overwrite_ops; > + ret = iomap_dio_rw(iocb, from, iomap_ops, &ext4_dio_write_ops, > is_sync_kiocb(iocb) || unaligned_io || extend); > > if (extend) > > Yes, this looks correct to me. Thanks -ritesh