opnsense-src/sys/alpha
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
..
alpha Use a spare slot in the machine context to identify the context format 2002-01-10 02:36:30 +00:00
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf Enable UFS_DIRHASH in the GENERIC kernel. 2001-12-14 16:27:11 +00:00
include Add missing prototype for pmap_unmapdev(). 2002-01-11 09:41:03 +00:00
isa Use the new resource_list_print_type() function. 2001-12-21 21:54:56 +00:00
linux Merge part of revision 1.18 of sys/i386/linux/linux_machdep.c: don't use 2001-12-18 18:50:02 +00:00
mcbus Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
osf1 SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
pci Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
tc If we're not going to use am7990_shutdown, comment it all out. 2001-06-14 19:36:37 +00:00
tlsb Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
Makefile Add a dopey makefile to do the tags dance, which is probably not perfect 2000-12-31 23:26:34 +00:00