Whamcloud - gitweb
b=5492,5624,5654,5664,5672
authorphil <phil>
Wed, 2 Mar 2005 23:35:09 +0000 (23:35 +0000)
committerphil <phil>
Wed, 2 Mar 2005 23:35:09 +0000 (23:35 +0000)
commit8129cde023ee671708da75c89fe189593f749f6e
tree111294378b1728d626b5ef587038ce5696deac88
parent20d96d0223fd888958bcd1468e74229fcfa2d33d
b=5492,5624,5654,5664,5672
Fundamentally changes the locking rules for the i_size and KMS.  The way in
which this was done is documented in bug 5654 comment #6, and I'll ask the
colibri team to either adopt or adapt this design, but in any case make it a
part of their documentation after they've merged it.

i_size and KMS sampling and updates are now protected by an lli_size_sem.
The reasons are many:

The truncate path has been reorganized not to hold this semaphore during RPCs,
which allows us to reverse the deadlock-inducing order with the ns_lock in
ll_pgcache_remove_extent. (bug 5492)

The introduction of the i_alloc_sem in 2.6 was wreaking havoc on our ability
to get our ordering right.  The truncate path was a festering boil of unlocking
and relocking which may well have been the source of other concurrency bugs.
Not using the i_sem for i_size updates eliminates this rat nest (bugs 5624,
5654)

Finally, the CMD team reported a similar inversion between a writing thread
and ptlrpcd (the writing thread has the i_sem, and won't release it until
ptlrpcd finishes the I/O; ptlrpcd wants the i_sem to finalize lock cancellation
after being evicted). (bugs 5664, 5672)

This has been running at NERSC for the last week, so I think it's ready for
more exposure.
lustre/ChangeLog
lustre/include/linux/lustre_lite.h
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/rw.c
lustre/lov/lov_request.c
lustre/mds/mds_open.c