[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230929093717.2972367-4-john.g.garry@oracle.com>
Date: Fri, 29 Sep 2023 09:37:16 +0000
From: John Garry <john.g.garry@...cle.com>
To: linux-kernel@...r.kernel.org, linux-api@...r.kernel.org
Cc: martin.petersen@...cle.com, djwong@...nel.org, david@...morbit.com,
himanshu.madhani@...cle.com, John Garry <john.g.garry@...cle.com>
Subject: [PATCH 3/4] man2/open.2: Document RWF_ATOMIC
Document special rule when using RWF_ATOMIC flag in conjunction with
O_DIRECT (which is the only time which it can be used).
Some block devices have a virtual boundary, which is a boundary at which
write iovec vectors start and end addresses need to align to - see
virt_boundary_mask in linux kernel sysfs-block Doc.
To avoid splitting writes with torn-write protection in the kernel for
when vectors cross this boundary, special iovec boundary rules are added
such that we don't cross this boundary.
Even though a virt_boundary_mask may be larger than the CPU page size,
we just impose that as a reasonable limit, which matches what the linux
kernel NVMe driver uses today - NVMe is of special interest for supporting
RWF_ATOMIC.
Signed-off-by: John Garry <john.g.garry@...cle.com>
---
man2/open.2 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/man2/open.2 b/man2/open.2
index 4c921723c95c..e5b9d107859a 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -1782,6 +1782,19 @@ blockdev \-\-getss
.EE
.in
.PP
+When
+.B O_DIRECT
+is used in conjunction with
+.BR pwritev2 ()
+and
+.BR RWF_ATOMIC
+flag, in addition to any alignment rules already imposed by the filesystem and
+underlying block device, it must be ensured that
+.I iovec
+vectors have no gaps such that the end alignment of a vector must have the same
+start alignment of any subsequent vector and that alignment must be least
+at a page boundary.
+.PP
.B O_DIRECT
I/Os should never be run concurrently with the
.BR fork (2)
--
2.31.1
Powered by blists - more mailing lists