Commit Graph

206 Commits

Author SHA1 Message Date
yamt 0a4f15d329 when allocating a new vnode,
increment numvnodes before releasing vnode_free_list_slock.
2003-09-14 11:09:48 +00:00
yamt ec0f99a001 acquire bqueue_slock around bremfree(). 2003-09-11 15:34:26 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
yamt cc104d0635 eliminate v_id. 2003-07-30 12:10:57 +00:00
yamt b0cdf0a26d maintain the list of namecaches attached to the vnode.
it makes vnodes freeable.
2003-07-30 12:09:46 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
thorpej a06b275edc Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget().  Turns out
  that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
  and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
  above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
  just to appease the above.
2003-06-29 18:43:21 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
dbj d225e8e1a7 use %PRIx64 instead of %x to print bp->b_lblkno and bp->b_blkno
in vfs_buf_print
2003-05-23 01:45:07 +00:00
thorpej fcecc153fe Use aprint_normal() for the non-error (and thus non-interative) case
of mounting the root file system.
2003-05-17 22:22:41 +00:00
itojun 35e21131ac use strlcat 2003-05-16 14:40:41 +00:00
christos 15fab6425c Fix a variety of kernel panics related to unchecked export data:
1. sa_len was not properly checked.
2. sa_family was not properly checked [even used as an array index!]
3. we only know about inet4 and inet6, so make sure that the corresponding
   data is valid before using it.
4. keep reference counts of addresses used (is that necessary?)
2003-05-16 14:01:56 +00:00
christos 8906603597 fix wrong calculation. pointed by enami. 2003-04-22 13:11:23 +00:00
christos cd174e0605 make the copy_statfs_args() function copy all the fields that are not
set by the filesystems. Before my changes, the statfs code depended
on calling it with mp->mnt_stat, and did not explicitly initialize
anything!
2003-04-18 22:44:45 +00:00
christos 80ecd573c0 PR/1796: John Kohl: statfs misbehaves under chrooted environments.
- Under chroot it displays only the visible filesystems with appropriate paths.
- The statfs f_mntonname gets adjusted to contain the real path from root.
- While was there, fixed a bug in ext2fs, locking problems with vfs_getfsstat(),
  and factored out some of the vfsop statfs() code to copy_statfs_info(). This
  fixes the problem where some filesystems forgot to set fsid.
- Made coda look more like a normal fs.
2003-04-16 21:44:18 +00:00
enami 7d8cb58793 Set va_birthtime field in vattr_null(). 2003-04-03 09:13:10 +00:00
jdolecek 3f362c0871 it appears one list of vnode type names should be enough 2003-02-25 23:35:03 +00:00
jdolecek b06fa82f3e make iftovt_tab[] const 2003-02-25 23:01:39 +00:00
jdolecek 2e574d6a8b add "VT_SMBFS" to vnode_tags[]
constify vnode_tags[] and vnode_types[]
2003-02-18 20:37:38 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
christos 416978b15b The hunt to make sync work from ddb again begins here.
Protect against lwp null dereference. set proc p properly.
2003-01-20 23:59:14 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
yamt 78d9abec0c sync comment for vflush with reality.
from FreeBSD.
2002-12-29 06:47:57 +00:00
blymn 29b7b4241f Added support for fingerprinted executables aka verified exec 2002-10-29 12:31:20 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
gmcgarry 3dae1c4857 vclean() isn't part of the interface so make it local.
Sort prototypes by the interface they belong to.
2002-10-23 06:45:49 +00:00
simonb 63533e7e48 "tmp" in vfs_vnode_print() is set but not used; remove it. 2002-10-22 03:38:21 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
matt 48bbf5f234 Use the queue macros from <sys/queue.h> instead of referring to the queue
members directly.  Use *_FOREACH whenever possible.
2002-09-04 01:32:31 +00:00
thorpej 3767580d1a Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-26 01:26:29 +00:00
perseant 43ca783b4a Back out rev 1.174 of vfs_subr.c, because the splbio() wasn't protecting
enough to be useful, and broadening it so that it did would have meant
that operations possibly requiring synchronous disk activity would have
to be done in splbio().  This clearly was not going to work.

Worked around this in the LFS case by having lfs_cluster_callback put an
extra hold on the vnode before calling biodone(), and taking the hold
off without HOLDRELE's problematic list swapping.  lfs_vunref() will take
care of that---in thread context---on the next write if need be.

Also, ensure that the list walking in lfs_{writevnodes,segunlock,gather}
takes into account the possibility that the list may change
underneath it (possibly because it itself deleted an element).

Tested on i386, test-compiled on alpha.
2002-05-23 23:05:25 +00:00
perseant ec0ca919be Protect v_freelist with splbio(), since HOLDRELE can be called in
interrupt context (through brelvp).  (LFS may be the only subsystem
affected by this problem.)

Tested on i386.
2002-05-20 22:50:57 +00:00
thorpej 605e664094 vfs_mountroot(): provide more info when we panic. 2002-04-04 01:44:30 +00:00
bjh21 dca4ae94d6 When checking that a potentially-unsigned enum is >= 0, assign it to an int
first.  This is necessary to avoid warnings with -fshort-enums.  Casting
to an int really should be enough, but turns out not to be.

This change will be documented in doc/HACKS.
2002-03-09 13:22:52 +00:00
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
simonb 9a942a34e0 Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().
2002-03-04 02:25:21 +00:00
chs 90503a3cda add an assert (hopefully to find where we recycle vnodes without
freeing all the pages, like I've seen recently).
2002-02-05 07:50:58 +00:00
chs 62c2e756ed update vnode flags in ddb vnode-printing function. 2001-12-10 01:38:48 +00:00
chs 8e9cdbbd63 replace "vnode" and "vtext" with "file" and "exec" in uvmexp field names. 2001-12-09 03:07:43 +00:00
chs 163b4fbc50 in vinvalbuf(), vtruncbuf() and vflushbuf(), don't skip calling
VOP_PUTPAGES() just because the vnode has no pages.  layered filesystems
will want to pass these calls on through to the underlying filesystem,
and non-layered filesystems may need to remove the vnode from the
syncer queues.  fix up MP locking and add some locking assertions.
fixes PRs 12284 and 14640.
2001-12-06 04:34:33 +00:00
msaitoh 1c87566f38 fix previous commit 2001-11-30 10:31:32 +00:00
msaitoh 797d100f77 fix printf format 2001-11-30 10:06:46 +00:00
christos 0fdce3fa8a sprinkle crcvt() 2001-11-29 21:21:29 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
chs 90a3a778a7 when attempting to reclaim a vnode, tell the lockmgr() that it's ok
to just fail if we already hold the lock.  we'll skip that vnode
and try another.  fixes PR 14090.
2001-10-04 05:46:45 +00:00
enami b0df86c9e6 In the function getnewvnode:
- Mark file system busy again on retry.
- Don't use the variable `listhd' uninitialized.
2001-09-26 00:59:57 +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