<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Patrick,</p>
<p>Please find attached my reproducer, <b><font
face="Courier New, Courier, monospace">sim.c</font></b>, and
my run script <b><font face="Courier New, Courier, monospace">sim.sh</font></b>
My apologies for sloppy coding ( no error handling, documentation
). Pretty simple though.</p>
<p>I'm not sure it will matter, but it was run on a system with
512GB RAM. I tuned the number of requests and transfer size to
trigger something that is not relevant for this problem, the
caching behavior for the second file being read forwards and
backwards. We discussed that one at LUG 24. That's the program I
am simulating here.</p>
<p>John</p>
<p>John</p>
<div class="moz-cite-prefix">On 3/24/2026 6:56 PM, Oleg Drokin
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:78456f41d91f27a3205037d4fdcb7015bd0986a6.camel@whamcloud.com">
<pre wrap="" class="moz-quote-pre">On Tue, 2026-03-24 at 23:42 +0000, Patrick Farrell wrote:
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">
John,
Are you able to pin this down into more of a reproducer? Even just a
more granular description.
I’m curious to explore it - this is poor behavior, not desirable for
sure. I’m curious in particular to see about the lock cancellation -
my understanding had been the glimpse request to read lock path was
entirely opportunistic (NONBLOCKING in ldlm speak) - and would never
cause a cancel (ie, my understanding doesn’t accord with Andreas’s).
I was pretty sure about that.
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
We definitely consider dropping unused the lock after glimpse:
/**
* Callback handler for receiving incoming glimpse ASTs.
*
* This only can happen on client side. After handling the glimpse AST
* we also consider dropping the lock here if it is unused locally for
a
* long time.
*/
static void ldlm_handle_gl_callback(struct ptlrpc_request *req,
struct ldlm_namespace *ns,
struct ldlm_request *dlm_req,
struct ldlm_lock *lock)
...
if (lock->l_granted_mode == LCK_PW &&
!lock->l_readers && !lock->l_writers &&
ktime_after(ktime_get(),
ktime_add(lock->l_last_used, ns-
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">ns_dirty_age_limit))) {
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">...
if (ldlm_bl_to_thread_lock(ns, ld, lock))
ldlm_handle_bl_callback(ns, ld, lock);
And ns_dirty_age_limit is 10 seconds.
John, what version are you testing on btw?
There were some lru changes in master very recently and I wonder if it
made any difference for this kind of workload.
</pre>
</blockquote>
</body>
</html>