tech-kern archive

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

Re: uvm_object::vmobjlock



On Thu, Jan 28, 2010 at 09:55:53PM +0000, Mindaugas Rasiukevicius wrote:
 > Unless anyone objects, I would like to change struct
 > uvm_object::vmobjlock to be dynamically allocated with
 > mutex_obj_alloc().  It allows us to: 1) share the lock among
 > objects by holding a reference 2) avoid false-sharing on locks.
 > Note that struct vnode::v_interlock becomes a pointer, which means
 > a chunk of mechanical changes.

You could in theory do

   -#define v_interlock     v_uobj.vmobjlock
   +#define v_interlock     (*v_uobj.vmobjlock)

but it is probably not a good idea :-)

Anyhow, if you do this, can we please come up with a better name for
v_interlock? Calling a lock "interlock" is about as descriptive as
writing "int i" or "bool flag", i.e., fine sometimes when the scope is
limited, but generally not so great for public data structures.

If it were me I'd probably call it "v_memlock", but it looks as if it
ought to be something beginning with 'i' to avoid renaming a pile of
other stuff.

(Renaming it will also make sure that all code that needs to be
visited and adjusted actually does get visited and adjusted, which is
a good thing.)

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


Home | Main Index | Thread Index | Old Index