<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
A suggestion:<br>
<br>
Try just direct IO.&nbsp; Group locks are complicated and have challenging semantics, including the unavoidable possibility of stale file size and obviously requiring you to be very careful in your application.&nbsp; In recent versions of Lustre, using direct IO avoids
 taking locks on the client entirely - instead, it takes locks purely on the server side and only for the written extent and length of the IO itself.&nbsp; This avoids all of the problems with shared file lock contention for non-overlapping writes, and still gives
 100% expected semantics for overlapping reads and writes.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
So, if you are able to switch to direct IO as you mention, group locks should be unnecessary and are better avoided.&nbsp; Direct IO works like this in 2.15 and newer.&nbsp; (Also, in 2.17, hybrid IO can do this switch for you automatically for larger IO sizes.)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Patrick</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> lustre-discuss &lt;lustre-discuss-bounces@lists.lustre.org&gt; on behalf of Oleg Drokin via lustre-discuss &lt;lustre-discuss@lists.lustre.org&gt;<br>
<b>Sent:</b> Saturday, February 7, 2026 12:49 AM<br>
<b>To:</b> lustre-discuss@lists.lustre.org &lt;lustre-discuss@lists.lustre.org&gt;; freddie@witherden.org &lt;freddie@witherden.org&gt;<br>
<b>Subject:</b> Re: [lustre-discuss] Group Lock Semantics</font>
<div>&nbsp;</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hello!<br>
<br>
On Fri, 2026-02-06 at 18:09 -0800, Freddie Witherden via lustre-discuss<br>
wrote:<br>
<br>
&gt; So, we reworked our code slightly to ensure that each page is only<br>
&gt; ever <br>
&gt; written to by a single rank.&nbsp;&nbsp; However, even here we find data to <br>
&gt; occasionally be missing from the file with the offsets corresponding<br>
&gt; to <br>
&gt; boundaries between hosts.&nbsp; We have even tried increasing the size up<br>
&gt; to <br>
&gt; the stripe size for the file (so each N MiB stripe is only ever<br>
&gt; written <br>
&gt; to by a single rank) but to no avail.<br>
&gt; <br>
&gt; Hence, I am wondering what the specific semantics are for writes<br>
&gt; under a <br>
&gt; group lock?&nbsp; Do we have to use O_DIRECT and bypass the page cache,<br>
&gt; are <br>
&gt; there more significant alignment requirements than pages?<br>
<br>
I think O_DIRECT was the primary idea for using as otherwise same host<br>
mixed io might be confused about which pages are covered by what locks,<br>
but in general it's still supposed to work without any particular<br>
alignment requirements.<br>
<br>
Do you happen to have a simplistic test case demonstrating the problem<br>
by any chance?<br>
<br>
Bye,<br>
&nbsp;&nbsp; Oleg<br>
_______________________________________________<br>
lustre-discuss mailing list<br>
lustre-discuss@lists.lustre.org<br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
</div>
</span></font></div>
</body>
</html>