Commit Graph

51 Commits

Author SHA1 Message Date
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
lukem 1ac69d9cb3 add RCSIDs 2001-11-12 22:54:03 +00:00
chs 781fe69288 add glue required by new genfs_getpages(). 2001-09-30 18:47:48 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chs adf5d360a7 add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl.  file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value.  the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
2001-09-15 16:12:54 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +00:00
chs 2a2f8d1727 initialize some struct mount fields that UBC needs.
DOS3 filesystems work now.
2001-04-03 05:40:27 +00:00
jdolecek d9466585b7 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 12:17:35 +00:00
jdolecek 458d7b0e00 adosfs_mountfs(): check for zero amp->secsperblk before dividing by it (which
would cause trap and panic); it might be invalid if the mounted filesystem is
not actually adosfs.
This fixes kern/11335 by Petri Koistinen.
2000-11-08 08:06:24 +00:00
jdolecek 89015c4648 Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
2000-03-16 18:08:17 +00:00
tron 0ba519abd7 Fix typo in softdep code. 1999-11-15 20:55:48 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
enami fee96e1746 Check if the type of device node isn't VBAD before touching v_specinfo. If
the device vnode is revoked, the field is NULL and touching it causes null
pointer derefercence.
1999-10-20 14:32:09 +00:00
wrstuden e5bf8dc4d5 Catch a few cases missed earlier where we need to lock the vnode before
calling VOP_CLOSE().
1999-10-18 19:52:24 +00:00
wrstuden e682a080e9 In spec_close(), if we're not doing a non-blocking close and VXLOCK is
not set, unlock the vnode before calling the device's close routine and
relock it after it returns. tty close routines will sleep waiting for
buffers to drain, which won't happen often times as the other side needs
to grab the vnode lock first.

Make all unmount routines lock the device vnode before calling VOP_CLOSE().
1999-10-16 23:53:26 +00:00
is 1790023ce8 Support ADOS file systems with more then 512 bytes/sector.
Fixes contributed by Detlef Würkner in PR 7653.
1999-06-02 22:04:30 +00:00
wrstuden 862a56e88b Modify vfsops to seperate vfs_fhtovp() into two routines. vfs_fhtovp() now
only handles the file handle to vnode conversion, and a new call,
vfs_checkexp(), performs the export verification.
1999-02-26 23:44:43 +00:00
bouyer 8be15977ce Correct both in my previous commit (#ifdef around by Matthew Jacob). 1999-02-11 09:49:46 +00:00
mjacob 99fb54992d ifdef around merge botch 1999-02-10 21:56:23 +00:00
bouyer 22d556f6cf Make sure a buffer optained from bread() is always bresle()'d in case of
error. Closes PR kern/1448 from Wolfgang Solfrank.
1999-02-10 13:14:08 +00:00
thorpej d0bcffb9a3 Use the pool allocator and the "nointr" pool page allocator for adosfs nodes. 1998-09-01 03:33:26 +00:00
perry 27ca6798df bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:15:38 +00:00
jonathan d275e56dee * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
1998-07-05 08:49:30 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
thorpej b5bf2ed6d0 Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().
1998-02-18 07:05:47 +00:00
kleink c2b4ef7d65 Fix a masking botch from last commit; make this more intuitive. 1997-07-08 09:11:29 +00:00
kleink d1380abbfd In AmigaDOS, read permission on a directory has the effect read and execute
permission has in VFS; execute permission permission on a directory is ignored
by AmigaDOS:  when translating permissions from AmigaDOS to VFS, set up VFS
execute permission for AmigaDOS-readable directories.
Fixes PR kern/3787 from Michael van Elst <mlelstv@serpens.swb.de>.
1997-06-26 21:04:32 +00:00
cgd 90688fce27 Change the second and third args to struct vfsops' (*vfs_mount)() to
'const char *', and 'void *', respectively.  The second arg is taken directly
from user arguments, and is const there, so must be const in the prototypes
and functions.  The third arg is also taken directly from user arguments.
It doesn't have to be changed, but since it's cleaner to keep the type
the same as the user arg's type, and I'm already making the 'const char *'
change...
1996-12-22 10:10:12 +00:00
christos 520aa2aeba backout previous kprintf change 1996-10-13 02:52:06 +00:00
mhitch 84abe4ea20 Where did that "l" come from? Another hiccup from the netbsd-1-2 branch
merge.
1996-10-12 05:28:14 +00:00
christos 5476886e52 printf -> kprintf, sprintf -> ksprintf 1996-10-10 17:47:29 +00:00
thorpej 8ef7e73ff1 Merge netbsd-1-2 branch back into mainline. 1996-10-08 22:18:02 +00:00
mhitch 7327b8ff44 Set file size of a softlink to the length of the symbolic link path,
to match what FFS does.  Fixes PR #2316.
1996-04-28 06:18:12 +00:00
veego 5bdb632088 u_int -> u_long fixes for printf's 1996-04-23 05:18:29 +00:00
mhitch a0e658617d Add support for OFS, International FileSystems, and blocksizes > 512.
Corrrect floppy rootblock calculation.  Validate filesystem type. (Closes
PR 2232)
Filename hashing requires unsigned characters.  (Closes PR 1026)
Soft link path is null-terminated string, not BSTR.
Use actual file header block info for hard links.
Set nlink to 2 for hard linked files in adosfs_getattr().
Load allocation bitmap and set correct free space.
1996-04-05 05:06:07 +00:00
christos 2140eeda0f Adosfs prototyping changes. 1996-02-09 19:06:38 +00:00
jtc 0cd793449e merge in changes from 1.1 release branch 1995-11-30 00:56:23 +00:00
chopps b84f35f3f0 make nfsable from osymh@gemini.oscs.montana.edu (Michael L. Hitch) 1995-08-18 15:14:33 +00:00
cgd 8f62c773e8 don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN 1995-06-18 14:45:14 +00:00
mycroft 2f805fa51b copy*str() should use size_t. 1995-03-09 12:05:21 +00:00
cgd 841ab5d975 size should be u_long, kill unneeded variable 1995-03-08 01:26:41 +00:00
mycroft 958b56730a amount -> adosfsmount 1995-01-18 09:17:32 +00:00
mycroft e4f6d6a7db Clean this up a bit, adding security checks, and copying code from other file
systems.
1995-01-18 09:16:37 +00:00
chopps 85444a9a0b a couple fixes. Add support for muFS (multi-user adosfs). Default to
case-insesitive lookup.  from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
1994-12-28 08:51:56 +00:00
mycroft 6b1a9a5ff9 Call foo_statfs() from a common place when mounting. 1994-12-15 20:47:51 +00:00
cgd 49c34d3337 move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS. 1994-10-14 18:26:22 +00:00
chopps 183bffdf36 fix a `bug' actually just an interface issue, cache last indirect block
to avoid geometrically increasing access time when reading files.
1994-07-11 05:07:38 +00:00
cgd cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
cgd f21254981e new standard, minimally intrusive ID format 1994-06-27 19:27:39 +00:00
chopps 61e3e83691 update to new vfs interface. 1994-06-17 20:06:05 +00:00