<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.  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.  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.  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.  Direct IO works like this in 2.15 and newer.  (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 <lustre-discuss-bounces@lists.lustre.org> on behalf of Oleg Drokin via lustre-discuss <lustre-discuss@lists.lustre.org><br>
<b>Sent:</b> Saturday, February 7, 2026 12:49 AM<br>
<b>To:</b> lustre-discuss@lists.lustre.org <lustre-discuss@lists.lustre.org>; freddie@witherden.org <freddie@witherden.org><br>
<b>Subject:</b> Re: [lustre-discuss] Group Lock Semantics</font>
<div> </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>
> So, we reworked our code slightly to ensure that each page is only<br>
> ever <br>
> written to by a single rank.   However, even here we find data to <br>
> occasionally be missing from the file with the offsets corresponding<br>
> to <br>
> boundaries between hosts.  We have even tried increasing the size up<br>
> to <br>
> the stripe size for the file (so each N MiB stripe is only ever<br>
> written <br>
> to by a single rank) but to no avail.<br>
> <br>
> Hence, I am wondering what the specific semantics are for writes<br>
> under a <br>
> group lock?  Do we have to use O_DIRECT and bypass the page cache,<br>
> are <br>
> 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>
   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>