Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 9fc158d

Browse files
author
Samuel Ortiz
authored
Merge pull request #144 from clearcontainers/sameo/topic/ksm-deadlock
ksm: Fix deadlock
2 parents 197707f + 3cb3823 commit 9fc158d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ksm.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,17 +530,19 @@ func (k *ksm) throttle() {
530530
// kick gets us back to the aggressive setting
531531
func (k *ksm) kick() {
532532
k.Lock()
533-
defer k.Unlock()
534533

535534
if !k.initialized {
536535
proxyLog.Error(errors.New("KSM is unavailable"))
536+
k.Unlock()
537537
return
538538
}
539539

540540
// If we're not throttling, we must not kick.
541541
if !k.throttling {
542+
k.Unlock()
542543
return
543544
}
544545

546+
k.Unlock()
545547
k.kickChannel <- true
546548
}

0 commit comments

Comments
 (0)