From mboxrd@z Thu Jan 1 00:00:00 1970 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 93C33697A0; Thu, 21 Dec 2023 12:57:18 +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 AEB9768B05; Thu, 21 Dec 2023 13:57:13 +0100 (CET) Date: Thu, 21 Dec 2023 13:57:13 +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: <20231221125713.GA24013@lst.de> References: <20231219051456.GB3964019@frogsfrogsfrogs> <20231219052121.GA338@lst.de> <76c85021-dd9e-49e3-80e3-25a17c7ca455@oracle.com> <20231219151759.GA4468@lst.de> <20231221065031.GA25778@lst.de> <20231221121925.GB17956@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@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 12:48:24PM +0000, John Garry wrote: >>> - 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, > > ok, I think that alignment is not so important, but we still need to > consider a minimum length per iovec, such that we will always be able to > fit a write of length atomic_write_unit_max in a bio. I don't think you man a minim length per iovec for that, but a maximum number of iovecs instead. For SGL-capable devices that would be BIO_MAX_VECS, otherwise 1.