freebsd-nq/sys/vm
Alfred Perlstein 426da3bcfb SMP Lock struct file, filedesc and the global file list.
Seigo Tanimura (tanimura) posted the initial delta.

I've polished it quite a bit reducing the need for locking and
adapting it for KSE.

Locks:

1 mutex in each filedesc
   protects all the fields.
   protects "struct file" initialization, while a struct file
     is being changed from &badfileops -> &pipeops or something
     the filedesc should be locked.

1 mutex in each struct file
   protects the refcount fields.
   doesn't protect anything else.
   the flags used for garbage collection have been moved to
     f_gcflag which was the FILLER short, this doesn't need
     locking because the garbage collection is a single threaded
     container.
  could likely be made to use a pool mutex.

1 sx lock for the global filelist.

struct file *	fhold(struct file *fp);
        /* increments reference count on a file */

struct file *	fhold_locked(struct file *fp);
        /* like fhold but expects file to locked */

struct file *	ffind_hold(struct thread *, int fd);
        /* finds the struct file in thread, adds one reference and
                returns it unlocked */

struct file *	ffind_lock(struct thread *, int fd);
        /* ffind_hold, but returns file locked */

I still have to smp-safe the fget cruft, I'll get to that asap.
2002-01-13 11:58:06 +00:00
..
default_pager.c With Alfred's permission, remove vm_mtx in favor of a fine-grained approach 2001-07-04 16:20:28 +00:00
device_pager.c With Alfred's permission, remove vm_mtx in favor of a fine-grained approach 2001-07-04 16:20:28 +00:00
phys_pager.c With Alfred's permission, remove vm_mtx in favor of a fine-grained approach 2001-07-04 16:20:28 +00:00
pmap.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
swap_pager.c Don't use an uninitialized field reserved for callers in the bio structure 2001-10-15 23:02:54 +00:00
swap_pager.h - If swap metadata does not fit into the KVM, reduce the number of 2000-12-13 10:01:00 +00:00
vm_contig.c contigmalloc1() could cause the vm_page_zero_count to become incorrect. 2001-10-17 17:34:34 +00:00
vm_extern.h Move the code that computes the system load average from vm_meter.c 2001-10-20 13:10:43 +00:00
vm_fault.c Fix deadlock introduced in 1.73 (Jan 1998). The paging-in-progress count 2001-11-09 21:34:45 +00:00
vm_glue.c Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
vm_init.c Move most of the kernel submap initialization code, including the 2001-08-22 04:07:27 +00:00
vm_kern.c vm/vm_kern.c: rate limit (to once per second) diagnostic printf when 2001-12-01 00:21:30 +00:00
vm_kern.h Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
vm_map.c Don't let pmap_object_init_pt() exhaust all available free pages 2001-10-31 03:06:33 +00:00
vm_map.h Don't let pmap_object_init_pt() exhaust all available free pages 2001-10-31 03:06:33 +00:00
vm_meter.c Move the code that computes the system load average from vm_meter.c 2001-10-20 13:10:43 +00:00
vm_mmap.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
vm_object.c Move recently added procedure which was incorrectly placed within an 2001-10-26 16:27:54 +00:00
vm_object.h Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has a 2001-10-26 00:08:05 +00:00
vm_page.c This fixes a large number of bugs in our NFS client side code. A recent 2001-12-14 01:16:57 +00:00
vm_page.h Implement idle zeroing of pages. I've been tinkering with this 2001-08-25 05:00:44 +00:00
vm_pageout.c Fix a BUF_TIMELOCK race against BUF_LOCK and fix a deadlock in vget() 2001-12-20 22:42:27 +00:00
vm_pageout.h - Remove asleep(), await(), and M_ASLEEP. 2001-08-10 06:37:05 +00:00
vm_pageq.c Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc). 2001-07-04 23:27:09 +00:00
vm_pager.c Whitespace fixes. 2001-08-04 20:49:29 +00:00
vm_pager.h With Alfred's permission, remove vm_mtx in favor of a fine-grained approach 2001-07-04 16:20:28 +00:00
vm_param.h Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader 2001-10-10 23:06:54 +00:00
vm_swap.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
vm_unix.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
vm_zeroidle.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
vm_zone.c When laying out objects in a ZONE_INTERRUPT zone, allow them to cross 2001-11-17 00:40:48 +00:00
vm_zone.h Add a zdestroy() function to the zone allocator. This is needed for the 2001-08-04 20:17:05 +00:00
vm.h Move most of the kernel submap initialization code, including the 2001-08-22 04:07:27 +00:00
vnode_pager.c This fixes a large number of bugs in our NFS client side code. A recent 2001-12-14 01:16:57 +00:00
vnode_pager.h vnode_pager_freepage() is really vm_page_free() in disguise, 2001-04-19 06:18:23 +00:00