Commit graph

1524 commits

Author SHA1 Message Date
Alan Cox 034b3d7a6f o Update locking around vm_object_page_remove() in vm_map_clean()
to use the new macros.
 o Remove unnecessary increment and decrement of the vm_object's
   reference count in vm_map_clean().
2003-04-19 01:43:32 +00:00
Alan Cox 410cfc455e Lock the vm_object in obj_alloc(). 2003-04-19 00:30:36 +00:00
Alan Cox 49281fbf68 Update locking around vm_object_page_remove() to use the new macros. 2003-04-18 16:39:03 +00:00
Andrew Gallatin b37d8ead52 Don't grab Giant in slab_zalloc() if M_NOWAIT is specified. This
should allow the use of INTR_MPSAFE network drivers.

Tested by: njl
Glanced at by: jeff
2003-04-18 13:02:29 +00:00
John Baldwin 69297bf8c9 suser() does not need the proc lock, just the setting of P_PROTECTED in
p_flag needs the lock.
2003-04-17 22:38:27 +00:00
Tom Rhodes 9faaf3b3c8 Add some tunable descriptions.
Submitted by:	hmp
Discussed with:	bde
2003-04-17 15:44:22 +00:00
Tom Rhodes 2a3eeaa240 Pre-content whitespace commit.
Discussed with:	bde
2003-04-17 15:39:12 +00:00
Alan Cox acbff226fc Update locking on the kmem_object to use the new macros. 2003-04-15 01:16:05 +00:00
Alan Cox de5ef10142 Update locking on the kernel_object to use the new macros. 2003-04-14 00:36:53 +00:00
Alan Cox d1dc776d9d Lock some manipulations of the vm object's flags. 2003-04-13 23:43:34 +00:00
Alan Cox e2479b4fc3 Lock some manipulations of the vm object's flags. 2003-04-13 20:22:02 +00:00
Alan Cox b077a36297 Lock some manipulations of the vm object's flags. 2003-04-13 19:36:18 +00:00
Alan Cox fdff41609d Add new macros for locking and unlocking a vm object. 2003-04-13 18:39:47 +00:00
Alan Cox f279b88deb Permit vm_object_pip_add() and vm_object_pip_wakeup() on the kmem_object
without Giant held.
2003-04-13 00:43:48 +00:00
Alan Cox f31c239da1 Eliminate unnecessary gotos from kmem_malloc(). 2003-04-13 00:23:42 +00:00
John Baldwin d8fed0f0f2 - Kill the pv_flags member of the alpha mdpage since it stop being used
in rev 1.61 of pmap.c.
- Now that pmap_page_is_free() is empty and since it is just a hack for
  the Alpha pmap, remove it.
2003-04-10 18:42:06 +00:00
Alan Cox 2ac8b16089 Remove GIANT_REQUIRED from getpbuf(). Reviewed by: tegge
Reduce pbuf_mtx's scope in relpbuf().  Submitted by: tegge
2003-04-05 21:01:16 +00:00
Dag-Erling Smørgrav e8c7f48855 Rename a static variable to avoid future conflicts. 2003-04-04 12:08:42 +00:00
Wes Peters f4cf2141f6 Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.

Reviewed by:	arch@
Sponsored by:	St. Bernard Software
2003-03-31 21:09:57 +00:00
Maxime Henrion 6900a17c75 The object type can't be OBJT_PHYS in vm_mmap().
Reviewed by:	peter
2003-03-30 00:56:20 +00:00
Tor Egge 125ee0d161 Obtain Giant before calling kmem_alloc without M_NOWAIT and before calling
kmem_free if Giant isn't already held.
2003-03-26 18:44:53 +00:00
Jake Burkholder 227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Maxime Henrion dab392a4d4 Remove an empty comment. 2003-03-19 00:34:43 +00:00
Poul-Henning Kamp b4b138c27f Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
Jake Burkholder 9f77ba59c5 Subtract the memory that backs the vm_page structures from phys_avail
after mapping it.  This makes it possible to determine if a physical
page has a backing vm_page or not.
2003-03-17 03:16:00 +00:00
Jake Burkholder 5501d40bb9 Made the prototypes for pmap_kenter and pmap_kremove MD. These functions
are machine dependent because they are not required to update the tlb when
mappings are added or removed, and doing so is machine dependent.
In addition, an implementation may require that pages mapped with pmap_kenter
have a backing vm_page_t, which is not necessarily true of all physical
pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the
physical address in order to make this requirement clear.
2003-03-16 04:16:03 +00:00
David Schultz 72d97679ff - When the VM daemon is out of swap space and looking for a
process to kill, don't block on a map lock while holding the
  process lock.  Instead, skip processes whose map locks are held
  and find something else to kill.
- Add vm_map_trylock_read() to support the above.

Reviewed by:	alc, mike (mentor)
2003-03-12 23:13:16 +00:00
Kenneth D. Merry 9b80d344ec Zero copy send and receive fixes:
- On receive, vm_map_lookup() needs to trigger the creation of a shadow
  object.  To make that happen, call vm_map_lookup() with PROT_WRITE
  instead of PROT_READ in vm_pgmoveco().

- On send, a shadow object will be created by the vm_map_lookup() in
  vm_fault(), but vm_page_cowfault() will delete the original page from
  the backing object rather than simply letting the legacy COW mechanism
  take over.  In other words, the new page should be added to the shadow
  object rather than replacing the old page in the backing object.  (i.e.
  vm_page_cowfault() should not be called in this case.)  We accomplish
  this by making sure fs.object == fs.first_object before calling
  vm_page_cowfault() in vm_fault().

Submitted by:	gallatin, alc
Tested by:	ken
2003-03-08 06:58:18 +00:00
Alan Cox 09c80124a3 Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.
Discussed on:	arch@
2003-03-06 03:41:02 +00:00
Robert Watson 1b2c2ab29a Provide a mac_check_system_swapoff() entry point, which permits MAC
modules to authorize disabling of swap against a particular vnode.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-05 23:50:15 +00:00
John Baldwin 263067951a Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls
to WITNESS_WARN().
2003-03-04 21:03:05 +00:00
Poul-Henning Kamp afadcb6108 NO_GEOM cleanup:
Use VOP_IOCTL(DIOCGMEDIASIZE) to check the size of a potential swap device
instead of the cdevsw->d_psize() method.
2003-03-02 14:37:52 +00:00
Alan Cox 1a1e9f41e5 Teach vm_page_sleep_if_busy() to release the vm_object lock before sleeping. 2003-03-01 19:16:32 +00:00
Alan Cox 077808c588 Fuse two #ifdefs with identical conditions. 2003-02-25 06:46:08 +00:00
Jeff Roberson 17661e5ac4 - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.
- Remove the buftimelock mutex and acquire the buf's interlock to protect
   these fields instead.
 - Hold the vnode interlock while locking bufs on the clean/dirty queues.
   This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another
   BUF_LOCK with a LK_TIMEFAIL to a single lock.

Reviewed by:	arch, mckusick
2003-02-25 03:37:48 +00:00
Maxime Henrion 07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Alan Cox 3fa24ec9f1 In vm_page_dirty(), assert that the page is not in the free queue(s). 2003-02-24 17:30:45 +00:00
Warner Losh a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alan Cox 6420521aa5 Remove GIANT_REQUIRED from vm_pageq_remove(). 2003-02-16 06:36:48 +00:00
Alan Cox 814f5c92d7 Remove the acquisition and release of Giant around pmap_growkernel().
It's unnecessary for two reasons: (1) Giant is at present already held in
such cases and (2) our various implementations of pmap_growkernel() look to
be MP safe.  (For example, for sparc64 the proof of (2) is trivial.)
2003-02-15 20:01:09 +00:00
Alan Cox 53b1963649 Move kernel_vm_end's declaration to pmap.h; add a comment regarding the
synchronization of access to kernel_vm_end.
2003-02-15 19:38:23 +00:00
Alan Cox 6b4b77ad34 Add a comment describing how pagedaemon_wakeup() should be used and
synchronized.

Suggested by:	tegge
2003-02-09 20:40:36 +00:00
Poul-Henning Kamp 886eaaacfa Change a printf to also tell how many items were left in the zone. 2003-02-04 08:23:18 +00:00
Alan Cox a1c0a78518 - It's more accurate to say that vm_paging_needed() returns TRUE
than a positive number.
 - In pagedaemon_wakeup(), set vm_pages_needed to 1 rather than
   incrementing it to accomplish the same.
2003-02-02 07:16:40 +00:00
Alan Cox 8e1d8de578 - Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock. 2003-02-02 01:11:21 +00:00
Alan Cox 8b24576748 - Remove (some) unnecessary explicit initializations to zero.
- Style changes to vm_pageout(): declarations and white-space.
2003-02-01 21:55:30 +00:00
Alan Cox e6f2748cbc - Convert the tsleep()s in vm_wait() and vm_waitpfault() to msleep()s
with the page queue lock.
 - Assert that the page queue lock is held in vm_page_free_wakeup().
2003-02-01 21:18:16 +00:00
Alan Cox 75741c0497 Simplify vm_object_page_remove(): The object's memq is now ordered. The
two cases that existed before for performance optimization purposes can
be reduced to one.
2003-01-27 01:12:35 +00:00
Alan Cox d923c5986e Add MTX_DUPOK to the initialization of system map locks. 2003-01-25 18:45:55 +00:00
Alfred Perlstein c3dfdfd132 use 'void *' instead of 'caddr_t' for useracc, kernacc, vslock and vsunlock. 2003-01-21 11:34:57 +00:00