<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div style="font-family:Calibri,sans-serif">
<div dir="ltr">Also, the prepare to wait call does so in non exclusive mode so switching the parameter on the wakeup would have no effect as non exclusive waiters are always woken anyway.</div>
<br>
<div dir="ltr">So, there is some other reason why we decide to yield but never get woken.</div>
<br>
<div dir="ltr">Mark.</div>
<hr>
<b>From:</b> Mark Syms <Mark.Syms@citrix.com><br>
<b>Sent:</b> Thursday, 11 October 2018 09:14<br>
<b>To:</b> Tim Smith <tim.smith@citrix.com>,cluster-devel@redhat.com<br>
<b>CC:</b> Andreas Gruenbacher <agruenba@redhat.com>,Ross Lagerwall <ross.lagerwall@citrix.com><br>
<b>Subject:</b> RE: [Cluster-devel] [PATCH 1/2] GFS2: use schedule timeout in find insert glock<br>
<br>
<br>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">And, sadly, the change to wait all also doesn't prevent the schedule_timeout from occurring. Something more subtle going on obviously.<br>
<br>
        Mark.<br>
<br>
-----Original Message-----<br>
From: Tim Smith <tim.smith@citrix.com> <br>
Sent: 10 October 2018 09:23<br>
To: cluster-devel@redhat.com<br>
Cc: Andreas Gruenbacher <agruenba@redhat.com>; Ross Lagerwall <ross.lagerwall@citrix.com>; Mark Syms <Mark.Syms@citrix.com><br>
Subject: Re: [Cluster-devel] [PATCH 1/2] GFS2: use schedule timeout in find insert glock<br>
<br>
On Tuesday, 9 October 2018 16:08:10 BST Tim Smith wrote:<br>
> On Tuesday, 9 October 2018 14:00:34 BST Andreas Gruenbacher wrote:<br>
> > On Tue, 9 Oct 2018 at 14:46, Tim Smith <tim.smith@citrix.com> wrote:<br>
> > > On Tuesday, 9 October 2018 13:34:47 BST you wrote:<br>
> > > > There must be another reason for the missed wake-up. I'll have <br>
> > > > to study the code some more.<br>
> > > <br>
> > > I think it needs to go into gfs2_glock_dealloc(), in such a way as <br>
> > > to avoid that problem. Currently working out a patch to do that.<br>
> > <br>
> > That doesn't sound right: find_insert_glock is waiting for the glock <br>
> > to be removed from the rhashtable. In gfs2_glock_free, we remove the <br>
> > glock from the rhashtable and then we do the wake-up. Delaying the <br>
> > wakeup further isn't going to help (but it might hide the problem).<br>
> <br>
> The only way we can get the problem we're seeing is if we get an <br>
> effective order of<br>
> <br>
> T0: wake_up_glock()<br>
> T1: prepare_to_wait()<br>
> T1: schedule()<br>
> <br>
> so clearly there's a way for that to happen. Any other order and <br>
> either<br>
> schedule() doesn't sleep or it gets woken.<br>
> <br>
> The only way I can see at the moment to ensure that wake_up_glock() <br>
> *cannot* get called until after prepare_to_wait() is to delay it until <br>
> the read_side critical sections are done, and the first place that's <br>
> got that property is the start of gfs2_glock_dealloc(), unless we want <br>
> to add synchronise_rcu() to gfs2_glock_free() and I'm guessing there's <br>
> a reason it's using<br>
> call_rcu() instead.<br>
> <br>
> I'll keep thinking about it.<br>
<br>
OK, we have a result that this definitely *isn't* the right answer (still getting the wakeup happening). This is lends more weight to the idea that there are multiple waiters, so we'll try your patch.<br>
<br>
--<br>
Tim Smith <tim.smith@citrix.com><br>
<br>
<br>
</div>
</span></font>
</body>
</html>