Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5118297rdb; Tue, 12 Dec 2023 22:00:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcctxg3Pbw7QmeFo4ImrVMQ4Ziq0kVgsRfWSnxufTh7bh8KXrD/zGrkwB4/9z5b9vZKrfc X-Received: by 2002:a05:6214:1150:b0:67e:b683:4550 with SMTP id b16-20020a056214115000b0067eb6834550mr8230090qvt.93.1702447231117; Tue, 12 Dec 2023 22:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702447231; cv=none; d=google.com; s=arc-20160816; b=OC8d7ORbVLTOUOodxSDnFKpwsKWJ2NYKGkJYGEy3MaNH/cl7g9ZyWQu+qb2GIL/3ay 0x8/ptYoKzYsSg8Ix8zlZGtPLdRFqgWfT71K19HWa7m7tKXtshb6kOyeBvORWuKnH/oA IMeBFQORIMDHl8WSqJ8Wx0J0pzpx2QhLaA+9wB+5M5cjd1mcl5EaiAL1OHYb1Y9aXkwl b3RKsVvUmiu29abbGxRf7cD+O0T4NYGeLcJVIVEW1mckU9XpytiBIoOES6E+dAy4xS2o HoUM+boKaUewqIvxu8M0aHSWBju4Y9e6rkvxeylBgVqRgIyrAl+nVEQa5s6Ea5ANrL3R MVFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TjaLeJnqTOAYTFIcON8BZhczgaQnsRt3YN92XTznSZU=; fh=c9ndHfVHtW1zFyQCjHmbQRH/XfkImt5YURxx3VgQzvA=; b=QgHhtBqWnMJiNbEf4rrF/7AZsgWK0VO66EotDZ1khItePY2BUxvX40WQ4aVqnhyGUP NgF/6soauZLPeh9HGTCHR5T8ykfwtZ19vTDVibffHoqJaGkY0HW8E0MTWPtXl12aDmVt SNyfw53yF0iOmnmqU8v2TjqjKrBUAjs+IMpWVDMpUJ1PTCroSwHu/cGPGjmpLtH4xg9f j5AL0nYydb8UNoKq5DYiYc49FEYhZo7FUpXkdrBrm0oBOoeP1mwd0sSLupwLOO84V5t/ 2vsnY7lIydlNEkMwcwi8N3xM1uXfStsfYFDe8ZZdctdvMCOsL8o5EPpns1n6Y00dGMqx 1zOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YjgO2RbA; spf=pass (google.com: domain of linux-ext4+bounces-423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u19-20020ae9c013000000b0077f11e3539csi11272314qkk.516.2023.12.12.22.00.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 22:00:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YjgO2RbA; spf=pass (google.com: domain of linux-ext4+bounces-423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DB5301C2033E for ; Wed, 13 Dec 2023 06:00:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22CB3D53F; Wed, 13 Dec 2023 06:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="YjgO2RbA" X-Original-To: linux-ext4@vger.kernel.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7439F7; Tue, 12 Dec 2023 22:00:14 -0800 (PST) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BD5gRtY009863; Wed, 13 Dec 2023 06:00:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=TjaLeJnqTOAYTFIcON8BZhczgaQnsRt3YN92XTznSZU=; b=YjgO2RbA7ZTb6qQQT9Pd1Q+4qL1RWzIMcPKn0H+8jxnep/6LUCUTPXHxQa0+bDeUC4Ze ikyIq4TalgvhwJvH+1i/FTy7aUBKITv0bult90vOXDozybGR2s/itZ0xaHzpqpBsKEH6 1InwZtbbNrbZ37b3dLDwe/kbM4j1pB/z+QcrhSAtdo+gwKy4MUINWpizEmSP2aFr5m0z GdVzLl9435VoVvIxGfNyRLRqQ9SFFiRVVGAu1JfpjyuC8IKu8/qgp71CSRy6ojhZDzES 4b3/EMZelNuTjdFYh8QK71zqt510twEc56E46O0HaKZhHoeRsUt8+soRUqv7fEsnnGiZ 3A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uy6pvrdvu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 06:00:08 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BD5qh9W003082; Wed, 13 Dec 2023 06:00:07 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uy6pvrduc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 06:00:07 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BD4e9Ij004899; Wed, 13 Dec 2023 06:00:06 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw4skeb1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 06:00:06 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BD604pw44827110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 06:00:04 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA6D32004D; Wed, 13 Dec 2023 06:00:04 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DAE5820043; Wed, 13 Dec 2023 06:00:01 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com (unknown [9.43.51.82]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 13 Dec 2023 06:00:01 +0000 (GMT) Date: Wed, 13 Dec 2023 11:29:57 +0530 From: Ojaswin Mujoo To: John Garry Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" , Ritesh Harjani , linux-kernel@vger.kernel.org, "Darrick J . Wong" , linux-block@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dchinner@redhat.com Subject: Re: [RFC 0/7] ext4: Allocator changes for atomic write support with DIO Message-ID: References: <8c06c139-f994-442b-925e-e177ef2c5adb@oracle.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _8OkYYCLfW-dy6EZ47uB0qBsdgMdIFs4 X-Proofpoint-ORIG-GUID: 7rrjuVr4GoM9eExABM89Fy3OpjTg-SS2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-12_14,2023-12-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 bulkscore=0 mlxlogscore=851 adultscore=0 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130041 On Tue, Dec 12, 2023 at 07:46:51AM +0000, John Garry wrote: > On 11/12/2023 10:54, Ojaswin Mujoo wrote: > > > This seems a rather big drawback. > > So if I'm not wrong, we force the extent alignment as well as the size > > of the extent in xfs right. > > For XFS in my v1 patchset, we only force alignment (but not size). > > It is assumed that the user will fallocate/dd the complete file before > issuing atomic writes, and we will have extent alignment and length as > required. > > However - as we have seen with a trial user - it can create a problem if we > don't do that and we write 4K and then overwrite with a 16K atomic write to > a file, as 2x extents may be allocated for the complete 16K and it cannot be > issued as a single BIO. So currently, if we don't fallocate beforehand in xfs and the user tries to do the 16k overwrite to an offset having a 4k extent, how are we handling it? Here ext4 will return an error indicating atomic write can't happen at this particular offset. The way I see it is if the user passes atomic flag to pwritev2 and we are unable to ensure atomicity for any reason we return error, which seems like a fair approach for a generic interface. > > > > > We didn't want to overly restrict the users of atomic writes by > > forcing > > the extents to be of a certain alignment/size irrespective of the > > size > > of write. The design in this patchset provides this flexibility at > > the > > cost of some added precautions that the user should take (eg not > > doing > > an atomic write on a pre existing unaligned extent etc). > > Doesn't bigalloc already give you what you require here? Yes, but its an mkfs time feature and it also applies to each an every file which might not be desirable for all use cases. Regards, ojaswin