Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp106420rdb; Thu, 21 Dec 2023 04:19:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/iIyHA+au3ros/jJOFTgZWaQZzICMrtFitaPt6GK/0ThsTJe5J811M6ikTIxqWzl736RP X-Received: by 2002:a05:6e02:1e09:b0:35f:a313:5555 with SMTP id g9-20020a056e021e0900b0035fa3135555mr13214509ila.64.1703161186549; Thu, 21 Dec 2023 04:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703161186; cv=none; d=google.com; s=arc-20160816; b=Nm4sQhM+VNNiJ8ksYipwGNT9E4/W36ftRNoxK9lWhDr21i20hJYKr2dw/ovmIuNP6L vGXnYyHXrW7Dz0iF49QaooOnqvt80CiYVhRiLHuoo+Z+Nv3DMBnpsD52Qab+MMU98De/ sAXx4hipCAu2EtFA9vjHz/8DuSzK+9EsIEelPVy+SJYTLh+IBWGNTZqW5wxskoX+/txu kr+UQfHXq9yvbbC6gu4yBeaoNLHuob+9k9MgksIts4+5WXhhysFJwAo6H9s6INH4iw92 PuTppettXZszobgo2z9cgVP31EXsYWkEGCipEy3Q1fmJSnmAgvM39RiYsmD34DI2/YVV 6mKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=5A8S23WWSyecM76/3jjUJRcPk+ICW0RSwrI8FWXI0Vo=; fh=pRFDb1qzPVEVLkPLiwPjjL6kEjGObSneCb7bU5CT3Q8=; b=AuSXolF3Xq+YH1mEZwgva+Cx3PkBLACXrtaA5oJ8VYKSE0XylRDyIggTWYLDFLA1VZ vRSo62ZcaOvDSG+SHDJyPh12Cs1q6i/q7z9cVnmLMVD6MsFaMh3hLlCOLbedKDjRVQhq FBbtihZQoP3JXuc02jZMCBNp8CnUKinSaO3D9dypuMT8XCqL2ge5qu7OOKp8/QHUDDdB HpH3wPHFWvJEXErEwxbL8KXoFGRMD632v5EN6490sFquukN8IMmd2XydBtbS9p4atto9 c/af+CHnIuFIfdQyvry4QfmZwXnSKRhbPF5L2pbU6vAowvcz5MhjcYmpdFAMLu+aYPsf 0pNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8322-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8322-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m62-20020a632641000000b005bddb417affsi1468775pgm.291.2023.12.21.04.19.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 04:19:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8322-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8322-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8322-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 361DA285D3D for ; Thu, 21 Dec 2023 12:19:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 205976F610; Thu, 21 Dec 2023 12:19:32 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6C592206F; Thu, 21 Dec 2023 12:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 9193E68B05; Thu, 21 Dec 2023 13:19:25 +0100 (CET) Date: Thu, 21 Dec 2023 13:19:25 +0100 From: Christoph Hellwig To: John Garry Cc: Christoph Hellwig , "Darrick J. Wong" , axboe@kernel.dk, kbusch@kernel.org, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jack@suse.cz, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-scsi@vger.kernel.org, ming.lei@redhat.com, jaswin@linux.ibm.com, bvanassche@acm.org Subject: Re: [PATCH v2 00/16] block atomic writes Message-ID: <20231221121925.GB17956@lst.de> References: <20231213154409.GA7724@lst.de> <20231219051456.GB3964019@frogsfrogsfrogs> <20231219052121.GA338@lst.de> <76c85021-dd9e-49e3-80e3-25a17c7ca455@oracle.com> <20231219151759.GA4468@lst.de> <20231221065031.GA25778@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@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: User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Dec 21, 2023 at 09:49:35AM +0000, John Garry wrote: > I noticed the NVMe patch to stop always setting virt boundary (thanks), but > I am struggling for the wording for iovecs rules. I'd like to reuse > iov_iter_is_aligned() to enforce any such rule. > > I am thinking: > - ubuf / iovecs need to be PAGE-aligned > - each iovec needs to be length of multiple of PAGE_SIZE > > But that does not work for total length < PAGE_SIZE. > > So then we could have: > - ubuf / iovecs need to be PAGE-aligned > - each iovec needs to be length of multiple of atomic_write_unit_min. If > total length > PAGE_SIZE, each iovec also needs to be a multiple of > PAGE_SIZE. > > I'd rather something simpler. Maybe it's ok. If we decided to not support atomic writes on anything setting a virt boundary we don't have to care about the alignment of each vector, and IMHO we should do that as everything else would be a life in constant pain. If we really have a use case for atomic writes on consumer NVMe devices we'll just have to limit it to a single iovec.