Commit Graph

269 Commits

Author SHA1 Message Date
alc
8ded4dfb69 - Additional vm object locking in vm_object_split()
- New vm object locking assertions in vm_page_insert() and
   vm_object_set_writeable_dirty()
2003-11-01 04:54:23 +00:00
alc
794553172b - Retire vm_pageout_page_free(). Instead, use vm_page_select_cache() from
vm_pageout_scan().  Rationale: I don't like leaving a busy page in the
   cache queue with neither the vm object nor the vm page queues lock held.
 - Assert that the page is active in vm_pageout_page_stats().
2003-10-22 18:41:32 +00:00
alc
35743f84b8 - Assert that the containing vm object is locked in
vm_page_set_validclean().  (This function reads and modifies the
   vm page's valid field, which is synchronized by the lock on the
   containing vm object.)
2003-10-21 19:36:51 +00:00
alc
eecac55b7d - Remove some long unused code. 2003-10-20 18:57:01 +00:00
alc
76f6c3b059 Retire vm_page_copy(). Its reason for being ended when peter@ modified
pmap_copy_page() et al. to accept a vm_page_t rather than a physical
address.  Also, this change will facilitate locking access to the vm page's
valid field.
2003-10-08 05:35:12 +00:00
alc
57538c344f Assert that the containing vm object's lock is held in
vm_page_set_invalid().
2003-10-05 06:58:07 +00:00
alc
632febaf7e Assert that the containing vm object's lock is held in
vm_page_zero_invalid().
2003-10-04 21:56:27 +00:00
alc
7c11eaebac - Extend the scope the vm object lock to cover calls to
vm_page_is_valid().
 - Assert that the lock on the containing vm object is held in
   vm_page_is_valid().
2003-10-04 19:23:29 +00:00
alc
8b797c473e In vm_page_remove(), assert that the vm object is locked, unless an Alpha.
(The Alpha still requires updates to its pmap.)
2003-09-28 04:50:48 +00:00
alc
601ceb70ef Initialize the page's pindex field even for VM_ALLOC_NOOBJ allocations.
(This field is useful for implementing sanity checks even if the page does
not belong to an object.)
2003-09-22 00:56:13 +00:00
alc
de18724542 Recent pmap changes permit the use of a more precise locking assertion
in vm_page_lookup().
2003-08-28 23:23:04 +00:00
alc
5b4e761019 Held pages, just like wired pages, should not be added to the cache queues.
Submitted by:	tegge
2003-08-23 20:29:29 +00:00
alc
5d6f66de90 Hold the page queues lock when performing vm_page_clear_dirty() and
vm_page_set_invalid().
2003-08-23 18:11:53 +00:00
alc
9e89497b7d Assert that the vm object's lock is held on entry to vm_page_grab(); remove
code from this function that was needed when vm object locking was
incomplete.
2003-08-21 20:59:07 +00:00
alc
f8ecd895b9 Assert that the vm object lock is held in vm_page_alloc(). 2003-08-20 20:24:29 +00:00
alc
7db05daaf9 Modify vm_page_alloc() and vm_page_select_cache() to allow the page that
is returned by vm_page_select_cache() to belong to the object that is
already locked by the caller to vm_page_alloc().
2003-07-01 07:33:41 +00:00
alc
1eef33b705 - Use an int rather than a vm_pindex_t to represent the desired page
color in vm_page_alloc().  (This also has small performance benefits.)
 - Eliminate vm_page_select_free(); vm_page_alloc() might as well
   call vm_pageq_find() directly.
2003-06-28 07:58:10 +00:00
alc
0e0026d70f vm_page_select_cache() enforces a number of conditions on the returned
page.  Add the ability to lock the containing object to those conditions.
2003-06-26 15:44:03 +00:00
alc
fa54a6610e Maintain a lock on the vm object of interest throughout vm_fault(),
releasing the lock only if we are about to sleep (e.g., vm_pager_get_pages()
or vm_pager_has_pages()).  If we sleep, we have marked the vm object with
the paging-in-progress flag.
2003-06-22 21:35:41 +00:00
alc
cb7655e83c Assert that the vm object is locked in vm_page_try_to_free(). 2003-06-19 01:50:14 +00:00
obrien
b0678d7a44 Use __FBSDID(). 2003-06-11 23:50:51 +00:00
alc
e448f32b52 Teach vm_page_grab() how to handle the vm object's lock. 2003-06-07 23:22:04 +00:00
alc
93ce6848ad - Relax the Giant required in vm_page_remove().
- Remove the Giant required from vm_page_free_toq().  (Any locking
   errors will be caught by vm_page_remove().)

This remedies a panic that occurred when kmem_malloc(NOWAIT) performed
without Giant failed to allocate the necessary pages.

Reported by:	phk
2003-04-25 06:35:05 +00:00
alc
eb6d5ae625 Revision 1.246 should have also included
- Weaken the assertion in vm_page_insert() to require Giant only if the
   vm_object isn't locked.

Reported by:	 "Ilmar S. Habibulin" <ilmar@watson.org>
2003-04-22 14:26:02 +00:00
alc
3b5c40ed83 Revision 1.52 of vm/uma_core.c has led to UMA's obj_alloc() being
called without Giant; and obj_alloc() in turn calls vm_page_alloc()
without Giant.  This causes an assertion failure in vm_page_alloc().
Fortunately, obj_alloc() is now MPSAFE.  So, we need only clean up
some assertions.

 - Weaken the assertion in vm_page_lookup() to require Giant only
   if the vm_object isn't locked.
 - Remove an assertion from vm_page_alloc() that duplicates a check
   performed in vm_page_lookup().

In collaboration with:	gallatin, jake, jeff
2003-04-22 05:36:14 +00:00
jhb
526c3912c0 - 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
jake
783ae539c3 - 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
mux
aeac636bfd Remove an empty comment. 2003-03-19 00:34:43 +00:00
jake
17dd501c20 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
alc
1d9375957c Teach vm_page_sleep_if_busy() to release the vm_object lock before sleeping. 2003-03-01 19:16:32 +00:00
alc
92c44b2895 In vm_page_dirty(), assert that the page is not in the free queue(s). 2003-02-24 17:30:45 +00:00
alc
cbb6b35209 - 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
alc
43a8628b32 - Hold the page queues lock around vm_page_hold().
- Assert that the page queues lock rather than Giant is held in
   vm_page_hold().
2003-01-20 09:24:03 +00:00
alc
c7ca47fcc7 - Update vm_pageout_deficit using atomic operations. It's a simple
counter outside the scope of existing locks.
 - Eliminate a redundant clearing of vm_pageout_deficit.
2003-01-14 06:57:03 +00:00
alc
fe540b81bb Make vm_page_alloc() return PG_ZERO only if VM_ALLOC_ZERO is specified.
The objective being to eliminate some cases of page queues locking.
(See, for example, vm/vm_fault.c revision 1.160.)

Reviewed by:	tegge

(Also, pointed out by tegge that I changed vm_fault.c before changing
vm_page.c.  Oops.)
2003-01-12 23:32:46 +00:00
alc
d833c390ba In vm_page_alloc(), fuse two if statements that are conditioned on the same
expression.
2003-01-11 20:07:17 +00:00
alc
03f7564d9e In vm_page_alloc(), honor VM_ALLOC_ZERO for system and interrupt class
requests when the number of free pages is below the reserved threshold.
Previously, VM_ALLOC_ZERO was only honored when the number of free pages
was above the reserved threshold.  Honoring it in all cases generally
makes sense, does no harm, and simplifies the code.
2003-01-08 19:58:42 +00:00
alc
e9e799ad84 Use atomic add and subtract to update the global wired page count,
cnt.v_wire_count.
2003-01-05 01:31:45 +00:00
alc
d5b9d0271f Refine the assertions in vm_page_alloc(). 2003-01-04 19:07:13 +00:00
alc
0912d72a88 Update the assertions in vm_page_insert() and vm_page_lookup() to reflect
locking of the kmem_object.
2003-01-01 19:45:36 +00:00
alc
3f894298eb Reduce the number of times that we acquire and release the page queues
lock by making vm_page_rename()'s caller, rather than vm_page_rename(),
responsible for acquiring it.
2002-12-29 07:17:06 +00:00
alc
e053499669 Assert that the page queues lock rather than Giant is held in
vm_page_flag_clear().
2002-12-28 22:49:37 +00:00
alc
6bff4b9a47 - Remove vm_page_sleep_busy(). The transition to vm_page_sleep_if_busy(),
which incorporates page queue and field locking, is complete.
 - Assert that the page queue lock rather than Giant is held in
   vm_page_flag_set().
2002-12-19 07:23:46 +00:00
alc
339c5b2dab Assert that the page queues lock is held in vm_page_unhold(),
vm_page_remove(), and vm_page_free_toq().
2002-12-15 00:06:02 +00:00
alc
cd298c7231 Hold the page queues/flags lock when calling vm_page_set_validclean().
Approved by:	re
2002-11-23 19:10:31 +00:00
alc
631af658fa Remove vm_page_protect(). Instead, use pmap_page_protect() directly. 2002-11-18 04:05:22 +00:00
alc
5e336b1d19 Now that pmap_remove_all() is exported by our pmap implementations
use it directly.
2002-11-16 07:44:25 +00:00
alc
fc8a5bc419 When prot is VM_PROT_NONE, call pmap_page_protect() directly rather than
indirectly through vm_page_protect().  The one remaining page flag that
is updated by vm_page_protect() is already being updated by our various
pmap implementations.

Note: A later commit will similarly change the VM_PROT_READ case and
eliminate vm_page_protect().
2002-11-10 07:12:04 +00:00
alc
5f7be03df2 In vm_page_remove(), avoid calling vm_page_splay() if the object's memq
is empty.
2002-11-09 08:27:42 +00:00
alc
a4cefee670 Export the function vm_page_splay(). 2002-11-04 19:21:39 +00:00