Source-Changes-HG archive

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

[src/trunk]: src/share/man/man9 Change comments around locking. While you _ca...



details:   https://anonhg.NetBSD.org/src/rev/e4ed926f8dcb
branches:  trunk
changeset: 566954:e4ed926f8dcb
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Tue May 25 17:27:03 2004 +0000

description:
Change comments around locking. While you _can_ grab vnode locks
as LK_SHARED, the VOP_ code (in all our existing file systems)
was implememted assuming exclusive locking. Use of LK_SHARED
is technically a bug and only works right for uni-processor and
big-lock SMP systems. Our current file systems will blow up
(probably quite subtlely) with LK_SHARED and fine-grained SMP
locking.

diffstat:

 share/man/man9/vnode.9 |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 3d97011c65bd -r e4ed926f8dcb share/man/man9/vnode.9
--- a/share/man/man9/vnode.9    Tue May 25 16:47:31 2004 +0000
+++ b/share/man/man9/vnode.9    Tue May 25 17:27:03 2004 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: vnode.9,v 1.20 2003/10/24 07:43:35 wiz Exp $
+.\"     $NetBSD: vnode.9,v 1.21 2004/05/25 17:27:03 wrstuden Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -463,8 +463,12 @@
 Many file systems rely on it to prevent race conditions in updating
 file system type specific data structures rather than using their
 own private locks.
-The vnode lock operates as a multiple-reader (shared-access lock)
-or single-writer lock (exclusive access lock).
+The vnode lock can operate as a multiple-reader (shared-access lock)
+or single-writer lock (exclusive access lock), however many current file
+system implementations were written assuming only single-writer
+locking.
+Multiple-reader locking functions equivalently only in the presence
+of big-lock SMP locking or a uni-processor machine.
 The lock may be held while sleeping.
 While the
 .Em v_vnlock



Home | Main Index | Thread Index | Old Index