Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Describe UVM object and explain lock sharing a little.



details:   https://anonhg.NetBSD.org/src/rev/b9d0ef887189
branches:  trunk
changeset: 773131:b9d0ef887189
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat Jan 28 14:37:35 2012 +0000

description:
Describe UVM object and explain lock sharing a little.

diffstat:

 sys/uvm/uvm_object.h |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r 60a09623ebe5 -r b9d0ef887189 sys/uvm/uvm_object.h
--- a/sys/uvm/uvm_object.h      Sat Jan 28 14:24:53 2012 +0000
+++ b/sys/uvm/uvm_object.h      Sat Jan 28 14:37:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_object.h,v 1.31 2011/06/12 03:36:03 rmind Exp $    */
+/*     $NetBSD: uvm_object.h,v 1.32 2012/01/28 14:37:35 rmind Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -30,16 +30,24 @@
 #ifndef _UVM_UVM_OBJECT_H_
 #define _UVM_UVM_OBJECT_H_
 
-/*
- * uvm_object.h
- */
-
 #include <sys/queue.h>
 #include <sys/rbtree.h>
 #include <uvm/uvm_pglist.h>
 
 /*
- * uvm_object: all that is left of mach objects.
+ * The UVM memory object interface.  Notes:
+ *
+ * A UVM memory object represents a list of pages, which are managed by
+ * the object's pager operations (uvm_object::pgops).  All pages belonging
+ * to an object are owned by it and thus protected by the object lock.
+ *
+ * The lock (uvm_object::vmobjlock) may be shared amongst the UVM objects.
+ * By default, the lock is allocated dynamically using mutex_obj(9) cache.
+ * Lock sharing is normally used when there is an underlying object.  For
+ * example, vnode representing a file may have an underlying node, which
+ * is the case for tmpfs and layered file systems.  In such case, vnode's
+ * UVM object and the underlying UVM object shares the lock (note that the
+ * vnode_t::v_interlock points to uvm_object::vmobjlock).
  */
 
 struct uvm_object {



Home | Main Index | Thread Index | Old Index