[OpenAFS-devel] Re: Thundering herds and the vnode state machine

Andrew Deason adeason@sinenomine.net
Thu, 23 Feb 2012 14:38:51 -0600


On Tue, 21 Feb 2012 18:05:34 +0000
Simon Wilkinson <simonxwilkinson@gmail.com> wrote:

> I think any solution to this would require threads to indicate what
> they are going to do once they have waited.

You already (sort of) have this from an API perspective.
VnWaitExclusiveState_r and VnWaitQuiescent_r could effectively be "wait
so I can read" and "wait so I can write/excl". Obviously not to the
extent of expressing what specific state we're going to, but for just
"how exclusive do I need this" we know.

> I'd welcome input from others more familiar with this code as to
> whether this is actually a problem, or if I'm missing something with
> the pthread condvar implementation that mitigates the problem.

Yeah, that sounds fine. I can't speak to the effectiveness of any
difference it would make; almost all of our current locking/signalling
strategies broadcast, do they not? (But the situations are a bit
different, here.) But sure, no reason not to do something in this area.

-- 
Andrew Deason
adeason@sinenomine.net