tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

vrele vs. syncer deadlock



On a low-memory machine Nick ran into the following deadlock:

  (a) rename -> vrele on child -> inactive -> truncate -> getblk ->
      no memory in buffer pool -> wait for syncer
  (b) syncer waiting for locked parent vnode from the rename

This makes it in general unsafe to vrele while holding a vnode lock.

In theory we could arrange this, but it's not desirable: the tidy
locking model for directory operations is: lock parent, call into fs,
fs handles child, unlock parent on return, so needing to unlock the
parent before releasing the child would bust up the abstraction
layer. (Not that we currently have this, but we're ostensibly working
towards it.)

Does anyone have any suggestions for a patch to address this problem
without first rewriting the syncer? While the latter is probably a
good idea, it's not entirely trivial to do and get right, making it
e.g. a poor pullup candidate...

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index