Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/vm/vm_map.c

[BACK] Up to [FreeBSD] / src / sys / vm

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.445.2.2: download - view: text, markup, annotated - select for diffs
Tue Jan 31 01:45:20 2012 UTC (10 days, 3 hours ago) by attilio
Branches: RELENG_9
Diff to: previous 1.445.2.1: preferred, colored; branchpoint 1.445: preferred, colored; next MAIN 1.446: preferred, colored
Changes since revision 1.445.2.1: +23 -42 lines
SVN rev 230799 on 2012-01-31 01:45:20Z by attilio

MFC r227758,227759,227788:
Introduce macro stubs in the mutex and sxlock implementation that will
be always defined and will allow consumers, willing to provide options,
file and line to locking requests, to not worry about options
redefining the interfaces.
This is typically useful when there is the need to build another
locking interface on top of the mutex one.

Requested by:	kib

Revision 1.447: download - view: text, markup, annotated - select for diffs
Mon Nov 21 12:59:52 2011 UTC (2 months, 2 weeks ago) by attilio
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.446: preferred, colored
Changes since revision 1.446: +13 -29 lines
SVN rev 227788 on 2011-11-21 12:59:52Z by attilio

Introduce the same mutex-wise fix in r227758 for sx locks.

The functions that offer file and line specifications are:
- sx_assert_
- sx_downgrade_
- sx_slock_
- sx_slock_sig_
- sx_sunlock_
- sx_try_slock_
- sx_try_xlock_
- sx_try_upgrade_
- sx_unlock_
- sx_xlock_
- sx_xlock_sig_
- sx_xunlock_

Now vm_map locking is fully converted and can avoid to know specifics
about locking procedures.
Reviewed by:	kib
MFC after:	1 month

Revision 1.446: download - view: text, markup, annotated - select for diffs
Sun Nov 20 16:33:09 2011 UTC (2 months, 2 weeks ago) by attilio
Branches: MAIN
Diff to: previous 1.445: preferred, colored
Changes since revision 1.445: +12 -15 lines
SVN rev 227758 on 2011-11-20 16:33:09Z by attilio

Introduce macro stubs in the mutex implementation that will be always
defined and will allow consumers, willing to provide options, file and
line to locking requests, to not worry about options redefining the
interfaces.
This is typically useful when there is the need to build another
locking interface on top of the mutex one.

The introduced functions that consumers can use are:
- mtx_lock_flags_
- mtx_unlock_flags_
- mtx_lock_spin_flags_
- mtx_unlock_spin_flags_
- mtx_assert_
- thread_lock_flags_

Spare notes:
- Likely we can get rid of all the 'INVARIANTS' specification in the
  ppbus code by using the same macro as done in this patch (but this is
  left to the ppbus maintainer)
- all the other locking interfaces may require a similar cleanup, where
  the most notable case is sx which will allow a further cleanup of
  vm_map locking facilities
- The patch should be fully compatible with older branches, thus a MFC
  is previewed (infact it uses all the underlying mechanisms already
  present).

Comments review by:	eadler, Ben Kaduk
Discussed with:		kib, jhb
MFC after:	1 month

Revision 1.445.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.445.2.1: preferred, colored; next MAIN 1.445.2.2: preferred, colored
Changes since revision 1.445.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.445.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.445: preferred, colored
Changes since revision 1.445: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.445: download - view: text, markup, annotated - select for diffs
Wed Jul 6 20:06:44 2011 UTC (7 months ago) by trasz
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.444: preferred, colored
Changes since revision 1.444: +10 -0 lines
SVN rev 223825 on 2011-07-06 20:06:44Z by trasz

All the racct_*() calls need to happen with the proc locked.  Fixing this
won't happen before 9.0.  This commit adds "#ifdef RACCT" around all the
"PROC_LOCK(p); racct_whatever(p, ...); PROC_UNLOCK(p)" instances, in order
to avoid useless locking/unlocking in kernels built without "options RACCT".

Revision 1.444: download - view: text, markup, annotated - select for diffs
Wed Jun 29 16:40:41 2011 UTC (7 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.443: preferred, colored
Changes since revision 1.443: +9 -1 lines
SVN rev 223677 on 2011-06-29 16:40:41Z by alc

Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove().  Passing this
option to vm_object_page_remove() asserts that the specified range of pages
is not mapped, or more precisely that none of these pages have any managed
mappings.  Thus, vm_object_page_remove() need not call pmap_remove_all() on
the pages.

This change not only saves time by eliminating pointless calls to
pmap_remove_all(), but it also eliminates an inconsistency in the use of
pmap_remove_all() versus related functions, like pmap_remove_write().  It
eliminates harmless but pointless calls to pmap_remove_all() that were being
performed on PG_UNMANAGED pages.

Update all of the existing assertions on pmap_remove_all() to reflect this
change.

Reviewed by:	kib

Revision 1.443: download - view: text, markup, annotated - select for diffs
Tue Apr 5 20:23:59 2011 UTC (10 months ago) by trasz
Branches: MAIN
Diff to: previous 1.442: preferred, colored
Changes since revision 1.442: +54 -1 lines
SVN rev 220373 on 2011-04-05 20:23:59Z by trasz

Add accounting for most of the memory-related resources.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (earlier version)

Revision 1.442: download - view: text, markup, annotated - select for diffs
Mon Mar 21 09:40:01 2011 UTC (10 months, 3 weeks ago) by jeff
Branches: MAIN
Diff to: previous 1.441: preferred, colored
Changes since revision 1.441: +14 -13 lines
SVN rev 219819 on 2011-03-21 09:40:01Z by jeff

 - Merge changes to the base system to support OFED.  These include
   a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
   and other miscellaneous small features.

Revision 1.419.2.13: download - view: text, markup, annotated - select for diffs
Sat Feb 26 21:18:38 2011 UTC (11 months, 1 week ago) by alc
Branches: RELENG_8
Diff to: previous 1.419.2.12: preferred, colored; branchpoint 1.419: preferred, colored; next MAIN 1.420: preferred, colored
Changes since revision 1.419.2.12: +3 -6 lines
SVN rev 219064 on 2011-02-26 21:18:38Z by alc

MFC r206140
  Re-enable the call to pmap_release() by vmspace_dofree().

Revision 1.441: download - view: text, markup, annotated - select for diffs
Fri Feb 4 21:49:24 2011 UTC (12 months ago) by alc
Branches: MAIN
Diff to: previous 1.440: preferred, colored
Changes since revision 1.440: +5 -7 lines
SVN rev 218304 on 2011-02-04 21:49:24Z by alc

Since the last parameter to vm_object_shadow() is a vm_size_t and not a
vm_pindex_t, it makes no sense for its callers to perform atop().  Let
vm_object_shadow() do that instead.

Revision 1.440: download - view: text, markup, annotated - select for diffs
Sat Jan 29 15:23:02 2011 UTC (12 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.439: preferred, colored
Changes since revision 1.439: +5 -9 lines
SVN rev 218070 on 2011-01-29 15:23:02Z by alc

Reenable the call to vm_map_simplify_entry() from vm_map_insert() for non-
MAP_STACK_* entries.  (See r71983 and r74235.)

In some cases, performing this call to vm_map_simplify_entry() halves the
number of vm map entries used by the Sun JDK.

Revision 1.388.2.15: download - view: text, markup, annotated - select for diffs
Tue Jan 25 19:44:55 2011 UTC (12 months, 2 weeks ago) by jhb
Branches: RELENG_7
Diff to: previous 1.388.2.14: preferred, colored; branchpoint 1.388: preferred, colored; next MAIN 1.389: preferred, colored
Changes since revision 1.388.2.14: +1 -5 lines
SVN rev 217836 on 2011-01-25 19:44:55Z by jhb

MFC 214144:
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
  its value as a loop invariant.  Currently this is a no-op because
  'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
  a reference in vmspace_free().

Revision 1.419.2.12: download - view: text, markup, annotated - select for diffs
Tue Jan 25 19:44:42 2011 UTC (12 months, 2 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.419.2.11: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.11: +1 -5 lines
SVN rev 217835 on 2011-01-25 19:44:42Z by jhb

MFC 214144:
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
  its value as a loop invariant.  Currently this is a no-op because
  'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
  a reference in vmspace_free().

Revision 1.388.2.14.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.388.2.14: preferred, colored; next MAIN 1.388.2.15: preferred, colored
Changes since revision 1.388.2.14: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.419.2.11.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.419.2.11: preferred, colored; next MAIN 1.419.2.12: preferred, colored
Changes since revision 1.419.2.11: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.388.2.14: download - view: text, markup, annotated - select for diffs
Sun Dec 19 06:09:02 2010 UTC (13 months, 3 weeks ago) by mlaier
Branches: RELENG_7
CVS tags: RELENG_7_4_BP
Branch point for: RELENG_7_4
Diff to: previous 1.388.2.13: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.13: +56 -1 lines
SVN rev 216554 on 2010-12-19 06:09:02Z by mlaier

MFC r216335:
  Fix a long standing (from the original 4.4BSD lite sources) race between
  vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
  missing" panics.  While faulting in pages for a map entry that is being
  wired down, mark the containing map as busy.  In vmspace_fork wait until
  the map is unbusy, before we try to copy the entries.

  Sponsored by:	Isilon Systems, Inc.

Approved by:	re (kib)

Revision 1.419.2.11: download - view: text, markup, annotated - select for diffs
Sun Dec 19 06:07:35 2010 UTC (13 months, 3 weeks ago) by mlaier
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.419.2.10: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.10: +41 -1 lines
SVN rev 216553 on 2010-12-19 06:07:35Z by mlaier

MFC r216335:
  Fix a long standing (from the original 4.4BSD lite sources) race between
  vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
  missing" panics.  While faulting in pages for a map entry that is being
  wired down, mark the containing map as busy.  In vmspace_fork wait until
  the map is unbusy, before we try to copy the entries.

  Sponsored by:	Isilon Systems, Inc.

Approved by:	re (kib)

Revision 1.439: download - view: text, markup, annotated - select for diffs
Thu Dec 9 21:02:22 2010 UTC (14 months ago) by mlaier
Branches: MAIN
Diff to: previous 1.438: preferred, colored
Changes since revision 1.438: +41 -1 lines
SVN rev 216335 on 2010-12-09 21:02:22Z by mlaier

Fix a long standing (from the original 4.4BSD lite sources) race between
vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
missing" panics.  While faulting in pages for a map entry that is being
wired down, mark the containing map as busy.  In vmspace_fork wait until the
map is unbusy, before we try to copy the entries.

Reviewed by:	kib
MFC after:	5 days
Sponsored by:	Isilon Systems, Inc.

Revision 1.438: download - view: text, markup, annotated - select for diffs
Thu Dec 2 17:37:16 2010 UTC (14 months, 1 week ago) by trasz
Branches: MAIN
Diff to: previous 1.437: preferred, colored
Changes since revision 1.437: +106 -106 lines
SVN rev 216128 on 2010-12-02 17:37:16Z by trasz

Replace pointer to "struct uidinfo" with pointer to "struct ucred"
in "struct vm_object".  This is required to make it possible to account
for per-jail swap usage.

Reviewed by:	kib@
Tested by:	pho@
Sponsored by:	FreeBSD Foundation

Revision 1.419.2.10: download - view: text, markup, annotated - select for diffs
Sat Nov 27 12:26:40 2010 UTC (14 months, 1 week ago) by jchandra
Branches: RELENG_8
Diff to: previous 1.419.2.9: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.9: +12 -1 lines
SVN rev 215938 on 2010-11-27 12:26:40Z by jchandra

Merge MIPS platform support to 8-STABLE.

This commit merges the MIPS platform changes that was now stable in
-CURRENT into 8-STABLE. The MIPS changesets are too many (~400) to list
here. But the changesets merged in this commit that affect other platforms
are summarized below:

r204635 : (changes to sys/dev/hwpmc, lib/libpmc, sys/sys/pmc.h)
Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor.

r205845: (changes to sys/modules/Makefile)
Fix for building modules on mips and arm.

r204031: (changes to sys/kern/link_elf_obj.c)
printf fix, as part of kernel module support for MIPS.

r206404: (changes to sys/arm/include/bus.h)
Add BUS_SPACE_UNRESTRICTED and define it to be ~0, just like all the
other platforms - for arm and mips.

r206819: (changes to sys/vm/)
Add VMFS_TLB_ALIGNED_SPACE option and kmem_alloc_nofault_space(), which
is used to allocate kernel stack address on MIPS.

r208165, r211087: (sys/kern/subr_smp.c, sys/kern/sched_ule.c)
Enable ULE scheduler for MIPS, Fix for an issue in SMP when 32 cpus are
enabled.

r208659: (sys/{ia64/ia64,mips/mips,sun4v/sun4v}/pmap.c)
Simplify the inner loop of get_pv_entry()

r208794: (changes to sys/vm/)
Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
fails to allocate MIPS page table pages.

r210327:  (changes to sys/vm/)
Support for MIPS page table page allocation.  Add a new function 'vm_page_t
vm_page_alloc_freelist(int flind, int order, int req)' to vm/vm_page.c to
allocate a page from a specified freelist, and other related changes.

Reviewed by:	alc(vm changes only)
Approved by:	kib(re), alc(vm), imp(mips), jmallett(mips), gnn(mips pmc)

Revision 1.419.2.9: download - view: text, markup, annotated - select for diffs
Sun Nov 21 09:50:11 2010 UTC (14 months, 2 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.419.2.8: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.8: +13 -1 lines
SVN rev 215608 on 2010-11-21 09:50:11Z by kib

MFC r215307:
Implement a (soft) stack guard page for auto-growing stack mappings.

Revision 1.388.2.13: download - view: text, markup, annotated - select for diffs
Tue Nov 16 04:51:07 2010 UTC (14 months, 3 weeks ago) by alc
Branches: RELENG_7
Diff to: previous 1.388.2.12: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.12: +2 -1 lines
SVN rev 215370 on 2010-11-16 04:51:07Z by alc

MFC r214953
  In case the stack size reaches its limit and its growth must be
  restricted, ensure that grow_amount is a multiple of the page size.
  Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and
  FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD
  7.x.

Revision 1.419.2.8: download - view: text, markup, annotated - select for diffs
Tue Nov 16 04:40:27 2010 UTC (14 months, 3 weeks ago) by alc
Branches: RELENG_8
Diff to: previous 1.419.2.7: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.7: +2 -1 lines
SVN rev 215369 on 2010-11-16 04:40:27Z by alc

MFC r214953
  In case the stack size reaches its limit and its growth must be
  restricted, ensure that grow_amount is a multiple of the page size.
  Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and
  FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD
  7.x.

Revision 1.437: download - view: text, markup, annotated - select for diffs
Sun Nov 14 17:53:52 2010 UTC (14 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.436: preferred, colored
Changes since revision 1.436: +13 -1 lines
SVN rev 215307 on 2010-11-14 17:53:52Z by kib

Implement a (soft) stack guard page for auto-growing stack mappings.
The unmapped page separates the tip of the stack and possible adjanced
segment, making some uses of stack overflow harder.  The stack growing
code refuses to expand the segment to the last page of the reseved
region when sysctl security.bsd.stack_guard_page is set to 1. The
default value for sysctl and accompanying tunable is 0.

Please note that mmap(MAP_FIXED) still can place a mapping right up to
the stack, making continuous region.

Reviewed by:	alc
MFC after:	1 week

Revision 1.436: download - view: text, markup, annotated - select for diffs
Sun Nov 7 21:40:34 2010 UTC (15 months ago) by alc
Branches: MAIN
Diff to: previous 1.435: preferred, colored
Changes since revision 1.435: +2 -1 lines
SVN rev 214953 on 2010-11-07 21:40:34Z by alc

In case the stack size reaches its limit and its growth must be restricted,
ensure that grow_amount is a multiple of the page size.  Otherwise, the
kernel may crash in swap_reserve_by_uid() on HEAD and FreeBSD 8.x, and
produce a core file with a missing stack on FreeBSD 7.x.

Diagnosed and reported by: jilles
Reviewed by:	kib
MFC after:	1 week

Revision 1.388.2.12: download - view: text, markup, annotated - select for diffs
Sat Oct 30 16:09:15 2010 UTC (15 months, 1 week ago) by alc
Branches: RELENG_7
Diff to: previous 1.388.2.11: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.11: +8 -14 lines
SVN rev 214558 on 2010-10-30 16:09:15Z by alc

MFC r213408
  If vm_map_find() is asked to allocate a superpage-aligned region of
  virtual addresses that is greater than a superpage in size but not a
  multiple of the superpage size, then vm_map_find() is not always
  expanding the kernel pmap to support the last few small pages being
  allocated.  Previously, we grew the kernel page table in
  vm_map_findspace() when we found the first available virtual address.
  Now, instead, we defer the call to pmap_growkernel() until we are
  committed to a range of virtual addresses in vm_map_insert().

Revision 1.419.2.7: download - view: text, markup, annotated - select for diffs
Sat Oct 30 04:53:50 2010 UTC (15 months, 1 week ago) by alc
Branches: RELENG_8
Diff to: previous 1.419.2.6: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.6: +8 -14 lines
SVN rev 214546 on 2010-10-30 04:53:50Z by alc

MFC r213408
  If vm_map_find() is asked to allocate a superpage-aligned region of
  virtual addresses that is greater than a superpage in size but not a
  multiple of the superpage size, then vm_map_find() is not always
  expanding the kernel pmap to support the last few small pages being
  allocated.  Previously, we grew the kernel page table in
  vm_map_findspace() when we found the first available virtual address.
  Now, instead, we defer the call to pmap_growkernel() until we are
  committed to a range of virtual addresses in vm_map_insert().

Revision 1.435: download - view: text, markup, annotated - select for diffs
Thu Oct 21 17:29:32 2010 UTC (15 months, 2 weeks ago) by jhb
Branches: MAIN
Diff to: previous 1.434: preferred, colored
Changes since revision 1.434: +1 -5 lines
SVN rev 214144 on 2010-10-21 17:29:32Z by jhb

- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
  its value as a loop invariant.  Currently this is a no-op because
  'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
  a reference in vmspace_free().

Reviewed by:	alc
MFC after:	1 month

Revision 1.434: download - view: text, markup, annotated - select for diffs
Mon Oct 4 16:49:40 2010 UTC (16 months ago) by alc
Branches: MAIN
Diff to: previous 1.433: preferred, colored
Changes since revision 1.433: +8 -14 lines
SVN rev 213408 on 2010-10-04 16:49:40Z by alc

If vm_map_find() is asked to allocate a superpage-aligned region of virtual
addresses that is greater than a superpage in size but not a multiple of
the superpage size, then vm_map_find() is not always expanding the kernel
pmap to support the last few small pages being allocated.  These failures
are not commonplace, so this was first noticed by someone porting FreeBSD
to a new architecture.  Previously, we grew the kernel page table in
vm_map_findspace() when we found the first available virtual address.
This works most of the time because we always grow the kernel pmap or page
table by an amount that is a multiple of the superpage size.  Now, instead,
we defer the call to pmap_growkernel() until we are committed to a range
of virtual addresses in vm_map_insert().  In general, there is another
reason to prefer calling pmap_growkernel() in vm_map_insert().  It makes
it possible for someone to do the equivalent of an mmap(MAP_FIXED) on the
kernel map.

Reported by:	Svatopluk Kraus
Reviewed by:	kib@
MFC after:	3 weeks

Revision 1.419.2.6: download - view: text, markup, annotated - select for diffs
Sat Oct 2 17:41:47 2010 UTC (16 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.419.2.5: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.5: +60 -27 lines
SVN rev 213362 on 2010-10-02 17:41:47Z by kib

MFC r212824:
Adopt the deferring of object deallocation for the deleted map entries
on map unlock to the lock downgrade and later read unlock operation.

MFC r212868 (by alc) [1]:
Make refinements to r212824. Redo the implementation of
vm_map_unlock_and_wait().

Approved by:	alc [1]

Revision 1.433: download - view: text, markup, annotated - select for diffs
Sun Sep 19 17:43:22 2010 UTC (16 months, 3 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.432: preferred, colored
Changes since revision 1.432: +24 -16 lines
SVN rev 212868 on 2010-09-19 17:43:22Z by alc

Make refinements to r212824.  In particular, don't make
vm_map_unlock_nodefer() part of the synchronization interface for maps.

Add comments to vm_map_unlock_and_wait() and vm_map_wakeup() describing
how they should be used.  In particular, describe the deferred deallocations
issue with vm_map_unlock_and_wait().

Redo the implementation of vm_map_unlock_and_wait() so that it passes
along the caller's file and line information, just like the other map
locking primitives.

Reviewed by:	kib
X-MFC after:	r212824

Revision 1.432: download - view: text, markup, annotated - select for diffs
Sat Sep 18 15:03:31 2010 UTC (16 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.431: preferred, colored
Changes since revision 1.431: +45 -20 lines
SVN rev 212824 on 2010-09-18 15:03:31Z by kib

Adopt the deferring of object deallocation for the deleted map entries
on map unlock to the lock downgrade and later read unlock operation.

System map entries cannot be backed by OBJT_VNODE objects, no need to
defer deallocation for them. Map entries from user maps do not require
the owner map for deallocation, and can be accumulated in the
thread-local list for freeing when a user map is unlocked.

Move the collection of entries for deferred reclamation into
vm_map_delete(). Create helper vm_map_process_deferred(), that is
called from locations where processing is feasible. Do not process
deferred entries in vm_map_unlock_and_wait() since map_sleep_mtx is
held.

Reviewed by:	alc, rstone (previous versions)
Tested by:	pho
MFC after:	2 weeks

Revision 1.419.2.5: download - view: text, markup, annotated - select for diffs
Sun Jul 11 09:37:34 2010 UTC (19 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.419.2.4: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.4: +1 -7 lines
SVN rev 209896 on 2010-07-11 09:37:34Z by kib

MFC r209685:
Introduce a helper function vm_page_find_least(). Use it in several places,
which inline the function.

Revision 1.431: download - view: text, markup, annotated - select for diffs
Sun Jul 4 11:13:33 2010 UTC (19 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.430: preferred, colored
Changes since revision 1.430: +1 -7 lines
SVN rev 209685 on 2010-07-04 11:13:33Z by kib

Introduce a helper function vm_page_find_least(). Use it in several places,
which inline the function.

Reviewed by:	alc
Tested by:	pho
MFC after:	1 week

Revision 1.419.2.4.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.419.2.4: preferred, colored; next MAIN 1.419.2.5: preferred, colored
Changes since revision 1.419.2.4: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.430: download - view: text, markup, annotated - select for diffs
Wed May 26 18:00:44 2010 UTC (20 months, 2 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.429: preferred, colored
Changes since revision 1.429: +1 -14 lines
SVN rev 208574 on 2010-05-26 18:00:44Z by alc

Push down page queues lock acquisition in pmap_enter_object() and
pmap_is_referenced().  Eliminate the corresponding page queues lock
acquisitions from vm_map_pmap_enter() and mincore(), respectively.  In
mincore(), this allows some additional cases to complete without ever
acquiring the page queues lock.

Assert that the page is managed in pmap_is_referenced().

On powerpc/aim, push down the page queues lock acquisition from
moea*_is_modified() and moea*_is_referenced() into moea*_query_bit().
Again, this will allow some additional cases to complete without ever
acquiring the page queues lock.

Reorder a few statements in vm_page_dontneed() so that a race can't lead
to an old reference persisting.  This scenario is described in detail by a
comment.

Correct a spelling error in vm_page_dontneed().

Assert that the object is locked in vm_page_clear_dirty(), and restrict the
page queues lock assertion to just those cases in which the page is
currently writeable.

Add object locking to vnode_pager_generic_putpages().  This was the one
and only place where vm_page_clear_dirty() was being called without the
object being locked.

Eliminate an unnecessary vm_page_lock() around vnode_pager_setsize()'s call
to vm_page_clear_dirty().

Change vnode_pager_generic_putpages() to the modern-style of function
definition.  Also, change the name of one of the parameters to follow
virtual memory system naming conventions.

Reviewed by:	kib

Revision 1.429: download - view: text, markup, annotated - select for diffs
Sun May 2 01:25:03 2010 UTC (21 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.428: preferred, colored
Changes since revision 1.428: +5 -1 lines
SVN rev 207487 on 2010-05-02 01:25:03Z by alc

Correct an error of omission in r206819.  If VMFS_TLB_ALIGNED_SPACE is
specified to vm_map_find(), then retry the vm_map_findspace() if
vm_map_insert() fails because the aligned space is already partly used.

Reported by:	Neel Natu

Revision 1.428: download - view: text, markup, annotated - select for diffs
Sun Apr 18 22:32:07 2010 UTC (21 months, 3 weeks ago) by jmallett
Branches: MAIN
Diff to: previous 1.427: preferred, colored
Changes since revision 1.427: +12 -1 lines
SVN rev 206819 on 2010-04-18 22:32:07Z by jmallett

o) Add a VM find-space option, VMFS_TLB_ALIGNED_SPACE, which searches the
   address space for an address as aligned by the new pmap_align_tlb()
   function, which is for constraints imposed by the TLB. [1]
o) Add a kmem_alloc_nofault_space() function, which acts like
   kmem_alloc_nofault() but allows the caller to specify which find-space
   option to use. [1]
o) Use kmem_alloc_nofault_space() with VMFS_TLB_ALIGNED_SPACE to allocate the
   kernel stack address on MIPS. [1]
o) Make pmap_align_tlb() on MIPS align addresses so that they do not start on
   an odd boundary within the TLB, so that they are suitable for insertion as
   wired entries and do not have to share a TLB entry with another mapping,
   assuming they are appropriately-sized.
o) Eliminate md_realstack now that the kstack will be appropriately-aligned on
   MIPS.
o) Increase the number of guard pages to 2 so that we retain the proper
   alignment of the kstack address.

Reviewed by:	[1] alc
X-MFC-after:	Making sure alc has not come up with a better interface.

Revision 1.427: download - view: text, markup, annotated - select for diffs
Sat Apr 3 19:07:05 2010 UTC (22 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.426: preferred, colored
Changes since revision 1.426: +9 -9 lines
SVN rev 206142 on 2010-04-03 19:07:05Z by alc

Make _vm_map_init() the one place where the vm map's pmap field is
initialized.

Reviewed by:	kib

Revision 1.426: download - view: text, markup, annotated - select for diffs
Sat Apr 3 16:20:22 2010 UTC (22 months, 1 week ago) by alc
Branches: MAIN
Diff to: previous 1.425: preferred, colored
Changes since revision 1.425: +3 -6 lines
SVN rev 206140 on 2010-04-03 16:20:22Z by alc

Re-enable the call to pmap_release() by vmspace_dofree().  The accounting
problem that is described in the comment has been addressed.

Submitted by:	kib
Tested by:	pho (a few months ago)
MFC after:	6 weeks

Revision 1.388.2.10.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 13 11:24:11 2010 UTC (23 months, 3 weeks ago) by kib
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.388.2.10.2.1: preferred, colored; branchpoint 1.388.2.10: preferred, colored; next MAIN 1.388.2.11: preferred, colored
Changes since revision 1.388.2.10.2.1: +1 -1 lines
SVN rev 203820 on 2010-02-13 11:24:11Z by kib

MFC r195635:
Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

PR:	kern/143717 (for RELENG_7)
Approved by:	re (bz)

Revision 1.388.2.11: download - view: text, markup, annotated - select for diffs
Sat Feb 13 10:42:29 2010 UTC (23 months, 3 weeks ago) by kib
Branches: RELENG_7
Diff to: previous 1.388.2.10: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.10: +1 -1 lines
SVN rev 203819 on 2010-02-13 10:42:29Z by kib

MFC r195635:
Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

PR:	kern/143717 (for RELENG_7)
Approved by:	re (bz)

Revision 1.388.2.10.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
Diff to: previous 1.388.2.10: preferred, colored
Changes since revision 1.388.2.10: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.419.2.4: download - view: text, markup, annotated - select for diffs
Mon Feb 1 10:45:23 2010 UTC (2 years ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.419.2.3: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.3: +1 -1 lines
SVN rev 203336 on 2010-02-01 10:45:23Z by kib

MFC r203175:
The MAP_ENTRY_NEEDS_COPY flag belongs to protoeflags, cow variable
uses different namespace.

Revision 1.425: download - view: text, markup, annotated - select for diffs
Fri Jan 29 19:25:45 2010 UTC (2 years ago) by kib
Branches: MAIN
Diff to: previous 1.424: preferred, colored
Changes since revision 1.424: +1 -1 lines
SVN rev 203175 on 2010-01-29 19:25:45Z by kib

The MAP_ENTRY_NEEDS_COPY flag belongs to protoeflags, cow variable
uses different namespace.

Reported by:	Jonathan Anderson <jonathan.anderson cl cam ac uk>
MFC after:	3 days

Revision 1.388.2.10: download - view: text, markup, annotated - select for diffs
Mon Jan 25 17:51:34 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_3_BP
Branch point for: RELENG_7_3
Diff to: previous 1.388.2.9: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.9: +2 -4 lines
SVN rev 202978 on 2010-01-25 17:51:34Z by jhb

MFC 193842:
Eliminate an unnecessary restriction on the vm object type from
vm_map_pmap_enter().  The immediate effect of this change is that automatic
prefaulting by mmap() for small mappings is performed on POSIX shared memory
objects just the same as it is on ordinary files.

Approved by:	re (kib)

Revision 1.424: download - view: text, markup, annotated - select for diffs
Thu Nov 26 05:16:07 2009 UTC (2 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.423: preferred, colored
Changes since revision 1.423: +10 -23 lines
SVN rev 199819 on 2009-11-26 05:16:07Z by alc

Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY.  VM_PROT_OVERRIDE_WRITE has
represented a write access that is allowed to override write protection.
Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into
text pages.  Text pages are not just write protected but they are also
copy-on-write.  VM_PROT_OVERRIDE_WRITE overrides the write protection on the
text page and triggers the replication of the page so that the breakpoint
will be written to a private copy.  However, here is where things become
confused.  It is the debugger, not the process being debugged that requires
write access to the copied page.  Nonetheless, the copied page is being
mapped into the process with write access enabled.  In other words, once the
debugger sets a breakpoint within a text page, the program can write to its
private copy of that text page.  Whereas prior to setting the breakpoint, a
SIGSEGV would have occurred upon a write access.  VM_PROT_COPY addresses
this problem.  The combination of VM_PROT_READ and VM_PROT_COPY forces the
replication of a copy-on-write page even though the access is only for read.
Moreover, the replicated page is only mapped into the process with read
access, and not write access.

Reviewed by:	kib
MFC after:	4 weeks

Revision 1.423: download - view: text, markup, annotated - select for diffs
Wed Nov 18 18:05:54 2009 UTC (2 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.422: preferred, colored
Changes since revision 1.422: +2 -2 lines
SVN rev 199490 on 2009-11-18 18:05:54Z by alc

Simplify both the invocation and the implementation of vm_fault() for wiring
pages.

(Note: Claims made in the comments about the handling of breakpoints in
wired pages have been false for roughly a decade.  This and another bug
involving breakpoints will be fixed in coming changes.)

Reviewed by:	kib

Revision 1.419.2.3: download - view: text, markup, annotated - select for diffs
Tue Nov 17 18:38:00 2009 UTC (2 years, 2 months ago) by kib
Branches: RELENG_8
Diff to: previous 1.419.2.2: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.2: +10 -4 lines
SVN rev 199416 on 2009-11-17 18:38:00Z by kib

MFC r198505:
When protection of wired read-only mapping is changed to read-write,
install new shadow object behind the map entry and copy the pages
from the underlying objects to it. This makes the mprotect(2) call to
actually perform the requested operation instead of silently do nothing
and return success, that causes SIGSEGV on later write access to the
mapping.

Reuse vm_fault_copy_entry() to do the copying, modifying it to behave
correctly when src_entry == dst_entry.

Revision 1.422: download - view: text, markup, annotated - select for diffs
Mon Nov 2 17:45:39 2009 UTC (2 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.421: preferred, colored
Changes since revision 1.421: +3 -3 lines
SVN rev 198812 on 2009-11-02 17:45:39Z by alc

Avoid pointless calls to pmap_protect().

Reviewed by:	kib

Revision 1.421: download - view: text, markup, annotated - select for diffs
Tue Oct 27 10:15:58 2009 UTC (2 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.420: preferred, colored
Changes since revision 1.420: +10 -4 lines
SVN rev 198505 on 2009-10-27 10:15:58Z by kib

When protection of wired read-only mapping is changed to read-write,
install new shadow object behind the map entry and copy the pages
from the underlying objects to it. This makes the mprotect(2) call to
actually perform the requested operation instead of silently do nothing
and return success, that causes SIGSEGV on later write access to the
mapping.

Reuse vm_fault_copy_entry() to do the copying, modifying it to behave
correctly when src_entry == dst_entry.

Reviewed by:	alc
MFC after:	3 weeks

Revision 1.419.2.2.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.419.2.2: preferred, colored; next MAIN 1.419.2.3: preferred, colored
Changes since revision 1.419.2.2: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.388.2.9: download - view: text, markup, annotated - select for diffs
Sun Oct 4 13:03:07 2009 UTC (2 years, 4 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.388.2.8: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.8: +16 -16 lines
SVN rev 197746 on 2009-10-04 13:03:07Z by kib

MFC r197661:
Move the annotation for vm_map_startup() immediately before the function.

Revision 1.419.2.2: download - view: text, markup, annotated - select for diffs
Sun Oct 4 12:14:49 2009 UTC (2 years, 4 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.419.2.1: preferred, colored; branchpoint 1.419: preferred, colored
Changes since revision 1.419.2.1: +16 -16 lines
SVN rev 197743 on 2009-10-04 12:14:49Z by kib

MFC r197661:
Move the annotation for vm_map_startup() immediately before the function.

Approved by:	re (bz, kensmith)

Revision 1.420: download - view: text, markup, annotated - select for diffs
Thu Oct 1 12:48:35 2009 UTC (2 years, 4 months ago) by kib
Branches: MAIN
Diff to: previous 1.419: preferred, colored
Changes since revision 1.419: +16 -16 lines
SVN rev 197661 on 2009-10-01 12:48:35Z by kib

Move the annotation for vm_map_startup() immediately before the function.

MFC after:	3 days

Revision 1.388.2.8: download - view: text, markup, annotated - select for diffs
Mon Sep 14 17:34:49 2009 UTC (2 years, 4 months ago) by jhb
Branches: RELENG_7
Diff to: previous 1.388.2.7: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.7: +9 -5 lines
SVN rev 197197 on 2009-09-14 17:34:49Z by jhb

MFC 195840, 195844, and 196637:
Add a new type of VM object: OBJT_SG.  An OBJT_SG object is very similar to
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses.  The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.

Revision 1.419.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
Diff to: previous 1.419: preferred, colored
Changes since revision 1.419: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.419: download - view: text, markup, annotated - select for diffs
Fri Jul 24 13:50:29 2009 UTC (2 years, 6 months ago) by jhb
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.418: preferred, colored
Changes since revision 1.418: +9 -5 lines
SVN rev 195840 on 2009-07-24 13:50:29Z by jhb

Add a new type of VM object: OBJT_SG.  An OBJT_SG object is very similar to
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses.  The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.

Reviewed by:	alc
Approved by:	re (kensmith)
MFC after:	2 weeks

Revision 1.418: download - view: text, markup, annotated - select for diffs
Sun Jul 12 12:37:38 2009 UTC (2 years, 6 months ago) by kib
Branches: MAIN
Diff to: previous 1.417: preferred, colored
Changes since revision 1.417: +1 -1 lines
SVN rev 195635 on 2009-07-12 12:37:38Z by kib

When VM_MAP_WIRE_HOLESOK is not specified and vm_map_wire(9) encounters
non-readable and non-executable map entry, the entry is skipped from
wiring and loop is aborted. But, since MAP_ENTRY_WIRE_SKIPPED was not
set for the map entry, its wired_count is later erronously decremented.
vm_map_delete(9) for such map entry stuck in "vmmaps".

Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

Reported by:	John Marshall <john.marshall riverwillow com au>
Approved by:	re (kensmith)

Revision 1.417: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:17:37 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
Diff to: previous 1.416: preferred, colored
Changes since revision 1.416: +3 -1 lines
SVN rev 195329 on 2009-07-03 22:17:37Z by kib

When forking a vm space that has wired map entries, do not forget to
charge the objects created by vm_fault_copy_entry. The object charge
was set, but reserve not incremented.

Reported by:	Greg Rivers <gcr+freebsd-current tharned org>
Reviewed by:	alc (previous version)
Approved by:	re (kensmith)

Revision 1.416: download - view: text, markup, annotated - select for diffs
Thu Jun 25 20:33:45 2009 UTC (2 years, 7 months ago) by svn2cvs
Branches: MAIN
Diff to: previous 1.415: preferred, colored
Changes since revision 1.415: +284 -28 lines
manual sync of cvs tree due to export bug

Revision 1.415: download - view: text, markup, annotated - select for diffs
Tue Jun 9 17:04:39 2009 UTC (2 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.414: preferred, colored
Changes since revision 1.414: +2 -4 lines
SVN rev 193842 on 2009-06-09 17:04:39Z by alc

Eliminate an unnecessary restriction on the vm object type from
vm_map_pmap_enter().  The immediate effect of this change is that automatic
prefaulting by mmap() for small mappings is performed on POSIX shared memory
objects just the same as it is on ordinary files.

Revision 1.414: download - view: text, markup, annotated - select for diffs
Sun Jun 7 19:38:26 2009 UTC (2 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.413: preferred, colored
Changes since revision 1.413: +1 -1 lines
SVN rev 193643 on 2009-06-07 19:38:26Z by alc

Eliminate unnecessary obfuscation when testing a page's valid bits.

Revision 1.388.2.7: download - view: text, markup, annotated - select for diffs
Tue May 5 09:16:57 2009 UTC (2 years, 9 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.388.2.6: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.6: +15 -1 lines
SVN rev 191810 on 2009-05-05 09:16:57Z by kib

MFC r190886:
When vm_map_wire(9) is allowed to skip holes in the wired region, skip
the mappings without any of read and execution rights, in particular,
the PROT_NONE entries. This makes mlockall(2) work for the process
address space that has such mappings.

Since protection mode of the entry may change between setting
MAP_ENTRY_IN_TRANSITION and final pass over the region that records
the wire status of the entries, allocate new map entry flag
MAP_ENTRY_WIRE_SKIPPED to mark the skipped PROT_NONE entries.

Revision 1.413: download - view: text, markup, annotated - select for diffs
Sun Apr 19 00:34:34 2009 UTC (2 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.412: preferred, colored
Changes since revision 1.412: +1 -2 lines
SVN rev 191256 on 2009-04-19 00:34:34Z by alc

Allow valid pages to be mapped for read access when they have a non-zero
busy count.  Only mappings that allow write access should be prevented by
a non-zero busy count.

(The prohibition on mapping pages for read access when they have a non-
zero busy count originated in revision 1.202 of i386/i386/pmap.c when
this code was a part of the pmap.)

Reviewed by:	tegge

Revision 1.388.2.6.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.388.2.6: preferred, colored; next MAIN 1.388.2.7: preferred, colored
Changes since revision 1.388.2.6: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.412: download - view: text, markup, annotated - select for diffs
Fri Apr 10 10:16:03 2009 UTC (2 years, 10 months ago) by kib
Branches: MAIN
Diff to: previous 1.411: preferred, colored
Changes since revision 1.411: +15 -1 lines
SVN rev 190886 on 2009-04-10 10:16:03Z by kib

When vm_map_wire(9) is allowed to skip holes in the wired region, skip
the mappings without any of read and execution rights, in particular,
the PROT_NONE entries. This makes mlockall(2) work for the process
address space that has such mappings.

Since protection mode of the entry may change between setting
MAP_ENTRY_IN_TRANSITION and final pass over the region that records
the wire status of the entries, allocate new map entry flag
MAP_ENTRY_WIRE_SKIPPED to mark the skipped PROT_NONE entries.

Reported and tested by:	Hans Ottevanger <fbsdhackers beasties demon nl>
Reviewed by:	alc
MFC after:	3 weeks

Revision 1.388.2.6: download - view: text, markup, annotated - select for diffs
Thu Feb 26 15:59:22 2009 UTC (2 years, 11 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.388.2.5: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.5: +17 -13 lines
SVN rev 189075 on 2009-02-26 15:59:22Z by jhb

MFC: Add support for "superpages" on amd64 and i386.  This includes adding the
superpage reservation system to the machine-independent VM system as well as
changes to the pmap code for amd64 and i386 to support superpages.

Reviewed by:	alc
Tested by:	ps

Revision 1.411: download - view: text, markup, annotated - select for diffs
Tue Feb 24 20:57:43 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.410: preferred, colored
Changes since revision 1.410: +24 -30 lines
SVN rev 189015 on 2009-02-24 20:57:43Z by kib

Revert the addition of the freelist argument for the vm_map_delete()
function, done in r188334. Instead, collect the entries that shall be
freed, in the deferred_freelist member of the map. Automatically purge
the deferred freelist when map is unlocked.

Tested by:	pho
Reviewed by:	alc

Revision 1.410: download - view: text, markup, annotated - select for diffs
Tue Feb 24 20:43:29 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.409: preferred, colored
Changes since revision 1.409: +44 -0 lines
SVN rev 189014 on 2009-02-24 20:43:29Z by kib

Add the assertion macros for the map locks. Use them in several map
manipulation functions.

Tested by:	pho
Reviewed by:	alc

Revision 1.409: download - view: text, markup, annotated - select for diffs
Tue Feb 24 20:23:16 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.408: preferred, colored
Changes since revision 1.408: +4 -4 lines
SVN rev 189012 on 2009-02-24 20:23:16Z by kib

Update the comment after the r188334.

Reviewed by:	alc

Revision 1.388.2.5: download - view: text, markup, annotated - select for diffs
Sun Feb 22 10:28:09 2009 UTC (2 years, 11 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.388.2.4: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.4: +4 -2 lines
SVN rev 188913 on 2009-02-22 10:28:09Z by kib

MFC r188320:
Do not leak the MAP_ENTRY_IN_TRANSITION flag when copying map entry
on fork. Otherwise, copied entry cannot be removed in the child map.

Revision 1.408: download - view: text, markup, annotated - select for diffs
Sun Feb 8 20:52:09 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.407: preferred, colored
Changes since revision 1.407: +8 -8 lines
SVN rev 188335 on 2009-02-08 20:52:09Z by kib

Improve comments, correct English.

Submitted by:	alc

Revision 1.407: download - view: text, markup, annotated - select for diffs
Sun Feb 8 20:39:17 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.406: preferred, colored
Changes since revision 1.406: +32 -8 lines
SVN rev 188334 on 2009-02-08 20:39:17Z by kib

Do not call vm_object_deallocate() from vm_map_delete(), because we
hold the map lock there, and might need the vnode lock for OBJT_VNODE
objects. Postpone object deallocation until caller of vm_map_delete()
drops the map lock. Link the map entries to be freed into the freelist,
that is released by the new helper function vm_map_entry_free_freelist().

Reviewed by:	tegge, alc
Tested by:	pho

Revision 1.406: download - view: text, markup, annotated - select for diffs
Sun Feb 8 20:30:51 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.405: preferred, colored
Changes since revision 1.405: +10 -2 lines
SVN rev 188333 on 2009-02-08 20:30:51Z by kib

In vm_map_sync(), do not call vm_object_sync() while holding map lock.
Reference object, drop the map lock, and then call vm_object_sync().
The object sync might require vnode lock for OBJT_VNODE type objects.

Reviewed by:	tegge
Tested by:	pho

Revision 1.405: download - view: text, markup, annotated - select for diffs
Sun Feb 8 20:00:33 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.404: preferred, colored
Changes since revision 1.404: +20 -0 lines
SVN rev 188325 on 2009-02-08 20:00:33Z by kib

Add the comments to vm_map_simplify_entry() and vmspace_fork(),
describing why several calls to vm_deallocate_object() with locked map
do not result in the acquisition of the vnode lock after map lock.

Suggested and reviewed by:	tegge

Revision 1.404: download - view: text, markup, annotated - select for diffs
Sun Feb 8 19:55:03 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.403: preferred, colored
Changes since revision 1.403: +5 -0 lines
SVN rev 188323 on 2009-02-08 19:55:03Z by kib

Lock the new map in vmspace_fork(). The newly allocated map should not
be accessible outside vmspace_fork() yet, but locking it would satisfy
the protocol of the vm_map_entry_link() and other functions called
from vmspace_fork().

Use trylock that is supposedly cannot fail, to silence WITNESS warning
of the nested acquisition of the sx lock with the same name.

Suggested and reviewed by:	tegge

Revision 1.403: download - view: text, markup, annotated - select for diffs
Sun Feb 8 19:41:08 2009 UTC (3 years ago) by kib
Branches: MAIN
Diff to: previous 1.402: preferred, colored
Changes since revision 1.402: +4 -2 lines
SVN rev 188320 on 2009-02-08 19:41:08Z by kib

Do not leak the MAP_ENTRY_IN_TRANSITION flag when copying map entry
on fork. Otherwise, copied entry cannot be removed in the child map.

Reviewed by:	tegge
MFC after:	2 weeks

Revision 1.388.2.4: download - view: text, markup, annotated - select for diffs
Sun Jan 18 19:20:10 2009 UTC (3 years ago) by alc
Branches: RELENG_7
Diff to: previous 1.388.2.3: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.3: +1 -1 lines
SVN rev 187404 on 2009-01-18 19:20:10Z by alc

MFC rev 179921
  KERNBASE is not necessarily an address within the kernel map, e.g.,
  PowerPC/AIM.  Consequently, it should not be used to determine the maximum
  number of kernel map entries.  Instead, use VM_MIN_KERNEL_ADDRESS, which
  marks the start of the kernel map on all architectures.

Revision 1.402: download - view: text, markup, annotated - select for diffs
Thu Jan 1 00:31:46 2009 UTC (3 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.401: preferred, colored
Changes since revision 1.401: +83 -11 lines
SVN rev 186665 on 2009-01-01 00:31:46Z by alc

Resurrect shared map locks allowing greater concurrency during some map
operations, such as page faults.

An earlier version of this change was ...

Reviewed by:	kib
Tested by:	pho
MFC after:	6 weeks

Revision 1.401: download - view: text, markup, annotated - select for diffs
Wed Dec 31 05:44:05 2008 UTC (3 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.400: preferred, colored
Changes since revision 1.400: +4 -3 lines
SVN rev 186633 on 2008-12-31 05:44:05Z by alc

Update or eliminate some stale comments.

Revision 1.400: download - view: text, markup, annotated - select for diffs
Tue Dec 30 21:52:18 2008 UTC (3 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.399: preferred, colored
Changes since revision 1.399: +4 -3 lines
SVN rev 186618 on 2008-12-30 21:52:18Z by alc

Avoid an unnecessary memory dereference in vm_map_entry_splay().

Revision 1.399: download - view: text, markup, annotated - select for diffs
Tue Dec 30 20:51:07 2008 UTC (3 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.398: preferred, colored
Changes since revision 1.398: +8 -11 lines
SVN rev 186616 on 2008-12-30 20:51:07Z by alc

Style change to vm_map_lookup(): Eliminate a macro of dubious value.

Revision 1.398: download - view: text, markup, annotated - select for diffs
Tue Dec 30 19:48:03 2008 UTC (3 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.397: preferred, colored
Changes since revision 1.397: +23 -34 lines
SVN rev 186609 on 2008-12-30 19:48:03Z by alc

Move the implementation of the vm map's fast path on address lookup from
vm_map_lookup{,_locked}() to vm_map_lookup_entry().  Having the fast path
in vm_map_lookup{,_locked}() limits its benefits to page faults.  Moving
it to vm_map_lookup_entry() extends its benefits to other operations on
the vm map.

Revision 1.388.2.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.388.2.3: preferred, colored; next MAIN 1.388.2.4: preferred, colored
Changes since revision 1.388.2.3: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.366.2.8.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.366.2.8: preferred, colored; next MAIN 1.367: preferred, colored
Changes since revision 1.366.2.8: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.397: download - view: text, markup, annotated - select for diffs
Sat Jun 21 21:02:13 2008 UTC (3 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.396: preferred, colored
Changes since revision 1.396: +1 -1 lines
SVN rev 179921 on 2008-06-21 21:02:13Z by alc

KERNBASE is not necessarily an address within the kernel map, e.g.,
PowerPC/AIM.  Consequently, it should not be used to determine the maximum
number of kernel map entries.  Intead, use VM_MIN_KERNEL_ADDRESS, which marks
the start of the kernel map on all architectures.

Tested by:	marcel@ (PowerPC/AIM)

Revision 1.396: download - view: text, markup, annotated - select for diffs
Sat May 10 18:55:35 2008 UTC (3 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.395: preferred, colored
Changes since revision 1.395: +15 -10 lines
Generalize vm_map_find(9)'s parameter "find_space".  Specifically, add
support for VMFS_ALIGNED_SPACE, which requests the allocation of an
address range best suited to superpages.  The old options TRUE and FALSE
are mapped to VMFS_ANY_SPACE and VMFS_NO_SPACE, so that there is no
immediate need to update all of vm_map_find(9)'s callers.

While I'm here, correct a misstatement about vm_map_find(9)'s return
values in the man page.

Revision 1.395: download - view: text, markup, annotated - select for diffs
Mon Apr 28 05:30:23 2008 UTC (3 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.394: preferred, colored
Changes since revision 1.394: +2 -3 lines
vm_map_fixed(), unlike vm_map_find(), does not update "addr", so it can be
passed by value.

Revision 1.394: download - view: text, markup, annotated - select for diffs
Fri Apr 4 19:14:58 2008 UTC (3 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.393: preferred, colored
Changes since revision 1.393: +2 -2 lines
Update a comment to vm_map_pmap_enter().

Revision 1.393: download - view: text, markup, annotated - select for diffs
Wed Mar 12 10:12:01 2008 UTC (3 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.392: preferred, colored
Changes since revision 1.392: +2 -2 lines
Remove kernel support for M:N threading.

While the KSE project was quite successful in bringing threading to
FreeBSD, the M:N approach taken by the kse library was never developed
to its full potential.  Backwards compatibility will be provided via
libmap.conf for dynamically linked binaries and static binaries will
be broken.

Revision 1.388.2.1.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 19 18:15:07 2008 UTC (4 years ago) by kib
Branches: RELENG_7_0
CVS tags: RELENG_7_0_0_RELEASE
Diff to: previous 1.388.2.1.2.1: preferred, colored; branchpoint 1.388.2.1: preferred, colored; next MAIN 1.388.2.2: preferred, colored
Changes since revision 1.388.2.1.2.1: +23 -6 lines
MFC fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

The reason for MFCing this so late in release cycle is, according to
marius@, because
> it fixes the crashing (though no panic) of the test suite
> of the graphic/OpenEXR port on sparc64. This test suite is run
> (and required to succeed) during the package build and that's
> why portmgr@ bitch about at it as OpenEXR is a dependency of KDE
> which in turn is supposed to end up on the release CD images.

Revisions MFCed:
  1.677     of      src/sys/amd64/amd64/machdep.c
  1.592     of      src/sys/amd64/amd64/pmap.c
  1.88      of      src/sys/arm/arm/pmap.c
  1.27      of      src/sys/arm/at91/kb920x_machdep.c
  1.22      of      src/sys/arm/sa11x0/assabet_machdep.c
  1.8       of      src/sys/arm/xscale/i80321/ep80219_machdep.c
  1.29      of      src/sys/arm/xscale/i80321/iq31244_machdep.c
  1.3       of      src/sys/arm/xscale/i8134x/crb_machdep.c
  1.6       of      src/sys/arm/xscale/ixp425/avila_machdep.c
  1.41      of      src/sys/compat/pecoff/imgact_pecoff.c
  1.26      of      src/sys/compat/svr4/imgact_svr4.c
  1.660     of      src/sys/i386/i386/machdep.c
  1.596     of      src/sys/i386/i386/pmap.c
  1.68      of      src/sys/i386/ibcs2/imgact_coff.c
  1.56      of      src/sys/i386/linux/imgact_linux.c
  1.226     of      src/sys/ia64/ia64/machdep.c
  1.192     of      src/sys/ia64/ia64/pmap.c
  1.102     of      src/sys/kern/imgact_aout.c
  1.179     of      src/sys/kern/imgact_elf.c
  1.56      of      src/sys/kern/imgact_gzip.c
  1.310     of      src/sys/kern/kern_exec.c
  1.287     of      src/sys/kern/kern_fork.c
  1.236     of      src/sys/kern/kern_kse.c
  1.253     of      src/sys/kern/kern_proc.c
  1.352     of      src/sys/kern/kern_sig.c
  1.63      of      src/sys/kern/kern_thr.c
  1.257     of      src/sys/kern/kern_thread.c
  1.397     of      src/sys/pc98/pc98/machdep.c
  1.104     of      src/sys/powerpc/powerpc/machdep.c
  1.10      of      src/sys/powerpc/powerpc/pmap_dispatch.c
  1.139     of      src/sys/sparc64/sparc64/machdep.c
  1.167     of      src/sys/sparc64/sparc64/pmap.c
  1.16      of      src/sys/sun4v/sun4v/machdep.c
  1.40      of      src/sys/sun4v/sun4v/pmap.c
  1.493     of      src/sys/sys/proc.h
  1.78      of      src/sys/sys/signalvar.h
  1.80      of      src/sys/vm/pmap.h
  1.79      of      src/sys/vm/vm_extern.h
  1.226     of      src/sys/vm/vm_glue.c
  1.390     of       src/sys/vm/vm_map.c

Requested by:	marius
Tested by:	Peter Holm, marius (make universe and sparc64 runs)
Approved by:	re (kensmith)

Revision 1.388.2.3: download - view: text, markup, annotated - select for diffs
Fri Jan 18 10:02:53 2008 UTC (4 years ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.388.2.2: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.2: +23 -6 lines
MFC fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

The reason for MFCing this so late in release cycle is, according to
marius@, because
> it fixes the crashing (though no panic) of the test suite
> of the graphic/OpenEXR port on sparc64. This test suite is run
> (and required to succeed) during the package build and that's
> why portmgr@ bitch about at it as OpenEXR is a dependency of KDE
> which in turn is supposed to end up on the release CD images.

Revisions MFCed:
  1.677     of      src/sys/amd64/amd64/machdep.c
  1.592     of      src/sys/amd64/amd64/pmap.c
  1.88      of      src/sys/arm/arm/pmap.c
  1.27      of      src/sys/arm/at91/kb920x_machdep.c
  1.22      of      src/sys/arm/sa11x0/assabet_machdep.c
  1.8       of      src/sys/arm/xscale/i80321/ep80219_machdep.c
  1.29      of      src/sys/arm/xscale/i80321/iq31244_machdep.c
  1.3       of      src/sys/arm/xscale/i8134x/crb_machdep.c
  1.6       of      src/sys/arm/xscale/ixp425/avila_machdep.c
  1.41      of      src/sys/compat/pecoff/imgact_pecoff.c
  1.26      of      src/sys/compat/svr4/imgact_svr4.c
  1.660     of      src/sys/i386/i386/machdep.c
  1.596     of      src/sys/i386/i386/pmap.c
  1.68      of      src/sys/i386/ibcs2/imgact_coff.c
  1.56      of      src/sys/i386/linux/imgact_linux.c
  1.226     of      src/sys/ia64/ia64/machdep.c
  1.192     of      src/sys/ia64/ia64/pmap.c
  1.102     of      src/sys/kern/imgact_aout.c
  1.179     of      src/sys/kern/imgact_elf.c
  1.56      of      src/sys/kern/imgact_gzip.c
  1.310     of      src/sys/kern/kern_exec.c
  1.287     of      src/sys/kern/kern_fork.c
  1.236     of      src/sys/kern/kern_kse.c
  1.253     of      src/sys/kern/kern_proc.c
  1.352     of      src/sys/kern/kern_sig.c
  1.63      of      src/sys/kern/kern_thr.c
  1.257     of      src/sys/kern/kern_thread.c
  1.397     of      src/sys/pc98/pc98/machdep.c
  1.104     of      src/sys/powerpc/powerpc/machdep.c
  1.10      of      src/sys/powerpc/powerpc/pmap_dispatch.c
  1.139     of      src/sys/sparc64/sparc64/machdep.c
  1.167     of      src/sys/sparc64/sparc64/pmap.c
  1.16      of      src/sys/sun4v/sun4v/machdep.c
  1.40      of      src/sys/sun4v/sun4v/pmap.c
  1.493     of      src/sys/sys/proc.h
  1.78      of      src/sys/sys/signalvar.h
  1.80      of      src/sys/vm/pmap.h
  1.79      of      src/sys/vm/vm_extern.h
  1.226     of      src/sys/vm/vm_glue.c
  1.390     of       src/sys/vm/vm_map.c

Requested by:	marius
Tested by:	Peter Holm, marius (make universe and sparc64 runs)
Approved by:	re (kensmith)

Revision 1.366.2.8: download - view: text, markup, annotated - select for diffs
Wed Jan 9 16:08:39 2008 UTC (4 years, 1 month ago) by kib
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.366.2.7: preferred, colored; branchpoint 1.366: preferred, colored; next MAIN 1.367: preferred, colored
Changes since revision 1.366.2.7: +3 -1 lines
MFC rev. 1.392:
In the vm_map_stack(), check for the specified stack region wraparound.

Revision 1.388.2.1.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 9 15:59:15 2008 UTC (4 years, 1 month ago) by kib
Branches: RELENG_7_0
Diff to: previous 1.388.2.1: preferred, colored
Changes since revision 1.388.2.1: +3 -1 lines
MFC rev. 1.392:
In the vm_map_stack(), check for the specified stack region wraparound.

Approved by:	re (kensmith)

Revision 1.388.2.2: download - view: text, markup, annotated - select for diffs
Wed Jan 9 15:19:22 2008 UTC (4 years, 1 month ago) by kib
Branches: RELENG_7
Diff to: previous 1.388.2.1: preferred, colored; branchpoint 1.388: preferred, colored
Changes since revision 1.388.2.1: +3 -1 lines
MFC rev. 1.392:
In the vm_map_stack(), check for the specified stack region wraparound.

Approved by:	re (kensmith)

Revision 1.392: download - view: text, markup, annotated - select for diffs
Fri Jan 4 04:33:13 2008 UTC (4 years, 1 month ago) by kib
Branches: MAIN
Diff to: previous 1.391: preferred, colored
Changes since revision 1.391: +3 -1 lines
In the vm_map_stack(), check for the specified stack region wraparound.

Reported and tested by:	Peter Holm
Reviewed by:	alc
MFC after:	3 days

Revision 1.391: download - view: text, markup, annotated - select for diffs
Wed Nov 7 21:56:58 2007 UTC (4 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.390: preferred, colored
Changes since revision 1.390: +5 -5 lines
Change unused 'user_wait' argument to 'timo' argument, which will be
used to specify timeout for msleep(9).

Discussed with:	alc
Reviewed by:	alc

Revision 1.390: download - view: text, markup, annotated - select for diffs
Mon Nov 5 11:36:16 2007 UTC (4 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.389: preferred, colored
Changes since revision 1.389: +23 -6 lines
Fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

As consequence, vmspace_exec() and vmspace_unshare() returns the errno
int. struct vmspace arg was added to vm_forkproc() to avoid dealing
with failed allocation when most of the fork1() job is already done.

The kernel stack for the thread is now set up in the thread_alloc(),
that itself may return NULL. Also, allocation of the first process
thread is performed in the fork1() to properly deal with stack
allocation failure. proc_linkup() is separated into proc_linkup()
called from fork1(), and proc_linkup0(), that is used to set up the
kernel process (was known as swapper).

In collaboration with:	Peter Holm
Reviewed by:	jhb

Revision 1.366.2.7: download - view: text, markup, annotated - select for diffs
Fri Nov 2 06:33:20 2007 UTC (4 years, 3 months ago) by alc
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Diff to: previous 1.366.2.6: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.6: +4 -2 lines
MFC revision 1.389
  Correct an error in vm_map_sync(), nee vm_map_clean(), that has existed
  since revision 1.1.  Specifically, neither traversal of the vm map checks
  whether the end of the vm map has been reached.  Consequently, the first
  traversal can wrap around and bogusly return an error.

Revision 1.388.2.1: download - view: text, markup, annotated - select for diffs
Wed Oct 31 02:31:51 2007 UTC (4 years, 3 months ago) by alc
Branches: RELENG_7
CVS tags: RELENG_7_0_BP
Branch point for: RELENG_7_0
Diff to: previous 1.388: preferred, colored
Changes since revision 1.388: +4 -2 lines
MFC revision 1.389
  Correct an error in vm_map_sync(), nee vm_map_clean(), that has existed
  since revision 1.1.  Specifically, neither traversal of the vm map checks
  whether the end of the vm map has been reached.  Consequently, the first
  traversal can wrap around and bogusly return an error.

Approved by:	re (kensmith)

Revision 1.389: download - view: text, markup, annotated - select for diffs
Mon Oct 22 05:21:05 2007 UTC (4 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.388: preferred, colored
Changes since revision 1.388: +4 -2 lines
Correct an error in vm_map_sync(), nee vm_map_clean(), that has existed
since revision 1.1.  Specifically, neither traversal of the vm map checks
whether the end of the vm map has been reached.  Consequently, the first
traversal can wrap around and bogusly return an error.

This error has gone unnoticed for so long because no one had ever before
tried msync(2)ing a region above the stack.

Reported by:	peter
MFC after:	1 week

Revision 1.388: download - view: text, markup, annotated - select for diffs
Tue Sep 25 06:25:06 2007 UTC (4 years, 4 months ago) by alc
Branches: MAIN
CVS tags: RELENG_7_BP
Branch point for: RELENG_7
Diff to: previous 1.387: preferred, colored
Changes since revision 1.387: +7 -11 lines
Change the management of cached pages (PQ_CACHE) in two fundamental
ways:

(1) Cached pages are no longer kept in the object's resident page
splay tree and memq.  Instead, they are kept in a separate per-object
splay tree of cached pages.  However, access to this new per-object
splay tree is synchronized by the _free_ page queues lock, not to be
confused with the heavily contended page queues lock.  Consequently, a
cached page can be reclaimed by vm_page_alloc(9) without acquiring the
object's lock or the page queues lock.

This solves a problem independently reported by tegge@ and Isilon.
Specifically, they observed the page daemon consuming a great deal of
CPU time because of pages bouncing back and forth between the cache
queue (PQ_CACHE) and the inactive queue (PQ_INACTIVE).  The source of
this problem turned out to be a deadlock avoidance strategy employed
when selecting a cached page to reclaim in vm_page_select_cache().
However, the root cause was really that reclaiming a cached page
required the acquisition of an object lock while the page queues lock
was already held.  Thus, this change addresses the problem at its
root, by eliminating the need to acquire the object's lock.

Moreover, keeping cached pages in the object's primary splay tree and
memq was, in effect, optimizing for the uncommon case.  Cached pages
are reclaimed far, far more often than they are reactivated.  Instead,
this change makes reclamation cheaper, especially in terms of
synchronization overhead, and reactivation more expensive, because
reactivated pages will have to be reentered into the object's primary
splay tree and memq.

(2) Cached pages are now stored alongside free pages in the physical
memory allocator's buddy queues, increasing the likelihood that large
allocations of contiguous physical memory (i.e., superpages) will
succeed.

Finally, as a result of this change long-standing restrictions on when
and where a cached page can be reclaimed and returned by
vm_page_alloc(9) are eliminated.  Specifically, calls to
vm_page_alloc(9) specifying VM_ALLOC_INTERRUPT can now reclaim and
return a formerly cached page.  Consequently, a call to malloc(9)
specifying M_NOWAIT is less likely to fail.

Discussed with: many over the course of the summer, including jeff@,
   Justin Husted @ Isilon, peter@, tegge@
Tested by: an earlier version by kris@
Approved by: re (kensmith)

Revision 1.366.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 9 04:41:24 2007 UTC (4 years, 5 months ago) by kib
Branches: RELENG_6
Diff to: previous 1.366.2.5: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.5: +35 -16 lines
MFC
rev. 1.387 of src/sys/vm/vm_map.c
rev. 1.120 of src/sys/vm/vm_map.h
rev. 1.213 of src/sys/vm/vm_mmap.c

Do not drop vm_map lock between doing vm_map_remove() and vm_map_insert().
For this, introduce vm_map_fixed() that does that for MAP_FIXED case.

Tested by:	Marc G. Fournier <scrappy hub org>

Revision 1.366.2.5: download - view: text, markup, annotated - select for diffs
Tue Sep 4 22:40:40 2007 UTC (4 years, 5 months ago) by alfred
Branches: RELENG_6
Diff to: previous 1.366.2.4: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.4: +2 -2 lines
Backport of optimized sx locks and rwlocks from FreeBSD 7.0.

Reviewed by: attilio, jhb
Obtained from: Juniper Networks

Revision 1.366.2.4: download - view: text, markup, annotated - select for diffs
Thu Aug 30 02:32:04 2007 UTC (4 years, 5 months ago) by alc
Branches: RELENG_6
Diff to: previous 1.366.2.3: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.3: +18 -8 lines
MFC revisions 1.375-1.377
  Use pmap_enter_object() in vm_map_pmap_enter() to reduce the
  locking overhead of premapping objects.

Note: It was later discovered that this change addresses a race condition
that is discussed by vm/vm_fault.c revision 1.216.  Specifically, replacing
pmap_enter_quick() by pmap_enter_object() addresses the race.

Revision 1.387: download - view: text, markup, annotated - select for diffs
Mon Aug 20 12:05:45 2007 UTC (4 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.386: preferred, colored
Changes since revision 1.386: +35 -16 lines
Do not drop vm_map lock between doing vm_map_remove() and vm_map_insert().
For this, introduce vm_map_fixed() that does that for MAP_FIXED case.

Dropping the lock allowed for parallel thread to occupy the freed space.

Reported by:	Tijl Coosemans <tijl ulyssis org>
Reviewed by:	alc
Approved by:	re (kensmith)
MFC after:	2 weeks

Revision 1.386: download - view: text, markup, annotated - select for diffs
Thu May 31 22:52:15 2007 UTC (4 years, 8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.385: preferred, colored
Changes since revision 1.385: +2 -2 lines
Revert VMCNT_* operations introduction.
Probabilly, a general approach is not the better solution here, so we should
solve the sched_lock protection problems separately.

Requested by: alc
Approved by: jeff (mentor)

Revision 1.385: download - view: text, markup, annotated - select for diffs
Thu May 31 09:14:48 2007 UTC (4 years, 8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.384: preferred, colored
Changes since revision 1.384: +2 -2 lines
Add functions sx_xlock_sig() and sx_slock_sig().
These functions are intended to do the same actions of sx_xlock() and
sx_slock() but with the difference to perform an interruptible sleep, so
that sleep can be interrupted by external events.
In order to support these new featueres, some code renstruction is needed,
but external API won't be affected at all.

Note: use "void" cast for "int" returning functions in order to avoid tools
like Coverity prevents to whine.

Requested by: rwatson
Tested by: rwatson
Reviewed by: jhb
Approved by: jeff (mentor)

Revision 1.384: download - view: text, markup, annotated - select for diffs
Tue May 22 04:45:59 2007 UTC (4 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.383: preferred, colored
Changes since revision 1.383: +13 -5 lines
Eliminate the reactivation of cached pages in vm_fault_prefault() and
vm_map_pmap_enter() unless the caller is madvise(MADV_WILLNEED).  With
the exception of calls to vm_map_pmap_enter() from
madvise(MADV_WILLNEED), vm_fault_prefault() and vm_map_pmap_enter()
are both used to create speculative mappings.  Thus, always
reactivating cached pages is a mistake.  In principle, cached pages
should only be reactivated by an actual access.  Otherwise, the
following misbehavior can occur.  On a hard fault for a text page the
clustering algorithm fetches not only the required page but also
several of the adjacent pages.  Now, suppose that one or more of the
adjacent pages are never accessed.  Ultimately, these unused pages
become cached pages through the efforts of the page daemon.  However,
the next activation of the executable reactivates and maps these
unused pages.  Consequently, they are never replaced.  In effect, they
become pinned in memory.

Revision 1.383: download - view: text, markup, annotated - select for diffs
Fri May 18 07:10:49 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
Diff to: previous 1.382: preferred, colored
Changes since revision 1.382: +2 -2 lines
 - define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
   vmcnts.  This can be used to abstract away pcpu details but also changes
   to use atomics for all counters now.  This means sched lock is no longer
   responsible for protecting counts in the switch routines.

Contributed by:		Attilio Rao <attilio@FreeBSD.org>

Revision 1.382: download - view: text, markup, annotated - select for diffs
Thu Apr 26 05:48:17 2007 UTC (4 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.381: preferred, colored
Changes since revision 1.381: +0 -4 lines
Remove some code from vmspace_fork() that became redundant after
revision 1.334 modified _vm_map_init() to initialize the new vm map's
flags to zero.

Revision 1.381: download - view: text, markup, annotated - select for diffs
Sun Mar 25 19:33:40 2007 UTC (4 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.380: preferred, colored
Changes since revision 1.380: +3 -4 lines
Two small changes to vm_map_pmap_enter():

1) Eliminate an unnecessary check for fictitious pages.  Specifically,
only device-backed objects contain fictitious pages and the object is
not device-backed.

2) Change the types of "psize" and "tmpidx" to vm_pindex_t in order to
prevent possible wrap around with extremely large maps and objects,
respectively.  Observed by: tegge (last summer)

Revision 1.380: download - view: text, markup, annotated - select for diffs
Sun Feb 25 06:14:58 2007 UTC (4 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.379: preferred, colored
Changes since revision 1.379: +1 -2 lines
Change the way that unmanaged pages are created.  Specifically,
immediately flag any page that is allocated to a OBJT_PHYS object as
unmanaged in vm_page_alloc() rather than waiting for a later call to
vm_page_unmanage().  This allows for the elimination of some uses of
the page queues lock.

Change the type of the kernel and kmem objects from OBJT_DEFAULT to
OBJT_PHYS.  This allows us to take advantage of the above change to
simplify the allocation of unmanaged pages in kmem_alloc() and
kmem_malloc().

Remove vm_page_unmanage().  It is no longer used.

Revision 1.379: download - view: text, markup, annotated - select for diffs
Sat Oct 21 21:02:04 2006 UTC (5 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.378: preferred, colored
Changes since revision 1.378: +1 -1 lines
Eliminate unnecessary PG_BUSY tests.  They originally served a purpose
that is now handled by vm object locking.

Revision 1.378: download - view: text, markup, annotated - select for diffs
Fri Jul 21 23:22:49 2006 UTC (5 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.377: preferred, colored
Changes since revision 1.377: +2 -8 lines
Retire debug.mpsafevm.  None of the architectures supported in CVS require
it any longer.

Revision 1.377: download - view: text, markup, annotated - select for diffs
Sat Jun 17 08:45:01 2006 UTC (5 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.376: preferred, colored
Changes since revision 1.376: +3 -3 lines
Use ptoa(psize) instead of size to compute the end of the mapping in
vm_map_pmap_enter().

Revision 1.376: download - view: text, markup, annotated - select for diffs
Wed Jun 14 17:48:45 2006 UTC (5 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.375: preferred, colored
Changes since revision 1.375: +1 -0 lines
Correct an error in the previous revision that could lead to a panic:
Found mapped cache page.  Specifically, if cnt.v_free_count dips below
cnt.v_free_reserved after p_start has been set to a non-NULL value,
then vm_map_pmap_enter() would break out of the loop and incorrectly
call pmap_enter_object() for the remaining address range.  To correct
this error, this revision truncates the address range so that
pmap_enter_object() will not map any cache pages.

In collaboration with: tegge@
Reported by: kris@

Revision 1.375: download - view: text, markup, annotated - select for diffs
Mon Jun 5 20:35:26 2006 UTC (5 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.374: preferred, colored
Changes since revision 1.374: +15 -5 lines
Introduce the function pmap_enter_object().  It maps a sequence of resident
pages from the same object.  Use it in vm_map_pmap_enter() to reduce the
locking overhead of premapping objects.

Reviewed by: tegge@

Revision 1.366.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 2 00:26:27 2006 UTC (5 years, 8 months ago) by tegge
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.366.2.2: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.2: +93 -16 lines
MFC: Close race between vmspace_exitfree() and exit1() and races between
     vmspace_exitfree() and vmspace_free() which could result in the same
     vmspace being freed twice.

     Factor out part of exit1() into new function vmspace_exit().  Attach
     to vmspace0 to allow old vmspace to be freed earlier.

     Add new function, vmspace_acquire_ref(), for obtaining a vmspace
     reference for a vmspace belonging to another process.  Avoid changing
     vmspace refcount from 0 to 1 since that could also lead to the same
     vmspace being freed twice.

     Change vmtotal() and swapout_procs() to use vmspace_acquire_ref().

Revision 1.374: download - view: text, markup, annotated - select for diffs
Mon May 29 21:28:56 2006 UTC (5 years, 8 months ago) by tegge
Branches: MAIN
Diff to: previous 1.373: preferred, colored
Changes since revision 1.373: +91 -16 lines
Close race between vmspace_exitfree() and exit1() and races between
vmspace_exitfree() and vmspace_free() which could result in the same
vmspace being freed twice.

Factor out part of exit1() into new function vmspace_exit().  Attach
to vmspace0 to allow old vmspace to be freed earlier.

Add new function, vmspace_acquire_ref(), for obtaining a vmspace
reference for a vmspace belonging to another process.  Avoid changing
vmspace refcount from 0 to 1 since that could also lead to the same
vmspace being freed twice.

Change vmtotal() and swapout_procs() to use vmspace_acquire_ref().

Reviewed by:	alc

Revision 1.373: download - view: text, markup, annotated - select for diffs
Wed Mar 8 06:31:46 2006 UTC (5 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.372: preferred, colored
Changes since revision 1.372: +3 -3 lines
Remove leading __ from __(inline|const|signed|volatile).  They are
obsolete.  This should reduce diffs to NetBSD as well.

Revision 1.372: download - view: text, markup, annotated - select for diffs
Fri Jan 27 07:28:50 2006 UTC (6 years ago) by alc
Branches: MAIN
Diff to: previous 1.371: preferred, colored
Changes since revision 1.371: +1 -1 lines
Use the new macros abstracting the page coloring/queues implementation.
(There are no functional changes.)

Revision 1.371: download - view: text, markup, annotated - select for diffs
Sun Dec 4 22:55:41 2005 UTC (6 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.370: preferred, colored
Changes since revision 1.370: +1 -3 lines
Simplify vmspace_dofree().

Revision 1.370: download - view: text, markup, annotated - select for diffs
Sat Dec 3 22:41:15 2005 UTC (6 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.369: preferred, colored
Changes since revision 1.369: +0 -1 lines
Eliminate unneeded preallocation at initialization.

Reviewed by: tegge

Revision 1.369: download - view: text, markup, annotated - select for diffs
Sun Nov 20 06:09:49 2005 UTC (6 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.368: preferred, colored
Changes since revision 1.368: +0 -1 lines
Eliminate pmap_init2().  It's no longer used.

Revision 1.366.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 13 21:45:49 2005 UTC (6 years, 2 months ago) by alc
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.366.2.1: preferred, colored; branchpoint 1.366: preferred, colored
Changes since revision 1.366.2.1: +2 -2 lines
MFC
  Pass a value of type vm_prot_t to pmap_enter_quick() so that it determine
  whether the mapping should permit execute access.

  Revision  Changes    Path
  1.179     +2 -2      src/sys/alpha/alpha/pmap.c
  1.527     +4 -2      src/sys/amd64/amd64/pmap.c
  1.37      +3 -3      src/sys/arm/arm/pmap.c
  1.531     +2 -2      src/sys/i386/i386/pmap.c
  1.163     +4 -3      src/sys/ia64/ia64/pmap.c
  1.100     +3 -2      src/sys/powerpc/powerpc/pmap.c
  1.149     +3 -2      src/sys/sparc64/sparc64/pmap.c
  1.72      +1 -1      src/sys/vm/pmap.h
  1.207     +2 -1      src/sys/vm/vm_fault.c
  1.368     +2 -2      src/sys/vm/vm_map.c

Revision 1.366.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 9 03:07:29 2005 UTC (6 years, 4 months ago) by delphij
Branches: RELENG_6
CVS tags: RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Diff to: previous 1.366: preferred, colored
Changes since revision 1.366: +1 -1 lines
MFC (by alc)
| Eliminate an incorrect (and unnecessary) cast.
|
| Revision  Changes    Path
| 1.367     +1 -1      src/sys/vm/vm_map.c

Approved by:	re (scottl)

Revision 1.368: download - view: text, markup, annotated - select for diffs
Sat Sep 3 18:20:20 2005 UTC (6 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.367: preferred, colored
Changes since revision 1.367: +2 -2 lines
Pass a value of type vm_prot_t to pmap_enter_quick() so that it determine
whether the mapping should permit execute access.

Revision 1.367: download - view: text, markup, annotated - select for diffs
Wed Jul 20 18:41:08 2005 UTC (6 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.366: preferred, colored
Changes since revision 1.366: +1 -1 lines
Eliminate an incorrect (and unnecessary) cast.

Revision 1.366: download - view: text, markup, annotated - select for diffs
Mon May 2 07:05:20 2005 UTC (6 years, 9 months ago) by alc
Branches: MAIN
CVS tags: RELENG_6_BP
Branch point for: RELENG_6
Diff to: previous 1.365: preferred, colored
Changes since revision 1.365: +0 -1 lines
Remove GIANT_REQUIRED from vmspace_exec().

Prodded by: jeff

Revision 1.360.2.3: download - view: text, markup, annotated - select for diffs
Wed Feb 23 06:52:56 2005 UTC (6 years, 11 months ago) by alc
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.360.2.2: preferred, colored; branchpoint 1.360: preferred, colored; next MAIN 1.361: preferred, colored
Changes since revision 1.360.2.2: +8 -4 lines
MFC revision 1.365
 Add checks to vm_map_findspace() to test for address wrap.  The conditions
 where this could occur are very rare, but possible.

Revision 1.360.2.2: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:27:02 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.360.2.1: preferred, colored; branchpoint 1.360: preferred, colored
Changes since revision 1.360.2.1: +1 -1 lines
MFC: /*- and related license changes

Revision 1.365: download - view: text, markup, annotated - select for diffs
Tue Jan 18 19:50:09 2005 UTC (7 years ago) by alc
Branches: MAIN
Diff to: previous 1.364: preferred, colored
Changes since revision 1.364: +8 -4 lines
Add checks to vm_map_findspace() to test for address wrap.  The conditions
where this could occur are very rare, but possible.

Submitted by: Mark W. Krentel
MFC after: 2 weeks

Revision 1.364: download - view: text, markup, annotated - select for diffs
Fri Jan 7 02:29:27 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.363: preferred, colored
Changes since revision 1.363: +1 -1 lines
/* -> /*- for license, minor formatting changes

Revision 1.187.2.31.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 1 19:53:59 2005 UTC (7 years, 1 month ago) by kensmith
Branches: RELENG_4_11
CVS tags: RELENG_4_11_0_RELEASE
Diff to: previous 1.187.2.31: preferred, colored; next MAIN 1.187.2.32: preferred, colored
Changes since revision 1.187.2.31: +1 -1 lines
MFC of rev 1.329 of vm_object.c:
  date: 2004/07/28 18:23:08;  author: alc;  state: Exp;  lines: +2 -2
  Correct a very old error in both vm_object_madvise() (originating in
  vm/vm_object.c revision 1.88) and vm_object_sync() (originating in
  vm/vm_map.c revision 1.36): When descending a chain of backing objects,
  both use the wrong object's backing offset.  Consequently, both may
  operate on the wrong pages.

  Quoting Matt, "This could be responsible for all of the sporatic madvise
  oddness that has been reported over the years."

  Reviewed by:    Matt Dillon

Reviewed by:    alc
Helped by:      DFly vm_map.c rev 1.31, vm_object.c rev 1.17
Approved by:	re (scottl)

Revision 1.187.2.32: download - view: text, markup, annotated - select for diffs
Fri Dec 31 11:12:18 2004 UTC (7 years, 1 month ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.31: preferred, colored; branchpoint 1.187: preferred, colored; next MAIN 1.188: preferred, colored
Changes since revision 1.187.2.31: +1 -1 lines
MFC of rev 1.329 of vm_object.c:
  date: 2004/07/28 18:23:08;  author: alc;  state: Exp;  lines: +2 -2
  Correct a very old error in both vm_object_madvise() (originating in
  vm/vm_object.c revision 1.88) and vm_object_sync() (originating in
  vm/vm_map.c revision 1.36): When descending a chain of backing objects,
  both use the wrong object's backing offset.  Consequently, both may
  operate on the wrong pages.

  Quoting Matt, "This could be responsible for all of the sporatic madvise
  oddness that has been reported over the years."

  Reviewed by:    Matt Dillon

Reviewed by:	alc
Helped by:	DFly vm_map.c rev 1.31, vm_object.c rev 1.17

Revision 1.363: download - view: text, markup, annotated - select for diffs
Thu Dec 23 20:16:11 2004 UTC (7 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.362: preferred, colored
Changes since revision 1.362: +8 -3 lines
Modify pmap_enter_quick() so that it expects the page queues to be locked
on entry and it assumes the responsibility for releasing the page queues
lock if it must sleep.

Remove a bogus comment from pmap_enter_quick().

Using the first change, modify vm_map_pmap_enter() so that the page queues
lock is acquired and released once, rather than each time that a page
is mapped.

Revision 1.362: download - view: text, markup, annotated - select for diffs
Wed Dec 15 19:55:05 2004 UTC (7 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.361: preferred, colored
Changes since revision 1.361: +4 -9 lines
In the common case, pmap_enter_quick() completes without sleeping.
In such cases, the busying of the page and the unlocking of the
containing object by vm_map_pmap_enter() and vm_fault_prefault() is
unnecessary overhead.  To eliminate this overhead, this change
modifies pmap_enter_quick() so that it expects the object to be locked
on entry and it assumes the responsibility for busying the page and
unlocking the object if it must sleep.  Note: alpha, amd64, i386 and
ia64 are the only implementations optimized by this change; arm,
powerpc, and sparc64 still conservatively busy the page and unlock the
object within every pmap_enter_quick() call.

Additionally, this change is the first case where we synchronize
access to the page's PG_BUSY flag and busy field using the containing
object's lock rather than the global page queues lock.  (Modifications
to the page's PG_BUSY flag and busy field have asserted both locks for
several weeks, enabling an incremental transition.)

Revision 1.360.2.1: download - view: text, markup, annotated - select for diffs
Sun Nov 28 05:08:02 2004 UTC (7 years, 2 months ago) by alc
Branches: RELENG_5
Diff to: previous 1.360: preferred, colored
Changes since revision 1.360: +0 -3 lines
MFC
 Push Giant deep into vm_forkproc(), acquiring it only if the process has
 mapped System V shared memory segments (see shmfork_myhook()).

Revision 1.187.2.31: download - view: text, markup, annotated - select for diffs
Tue Nov 16 19:48:09 2004 UTC (7 years, 2 months ago) by ps
Branches: RELENG_4
CVS tags: RELENG_4_11_BP
Branch point for: RELENG_4_11
Diff to: previous 1.187.2.30: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.30: +17 -5 lines
MFC:
>alc         2004/05/21 21:53:52 PDT
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/vm               vm_extern.h vm_fault.c vm_map.c vm_page.c
>  Log:
>    To date, unwiring a fictitious page has produced a panic.  The reason
>    being that PHYS_TO_VM_PAGE() returns the wrong vm_page for fictitious
>    pages but unwiring uses PHYS_TO_VM_PAGE().  The resulting panic
>    reported an unexpected wired count.  Rather than attempting to fix
>    PHYS_TO_VM_PAGE(), this fix takes advantage of the properties of
>    fictitious pages.  Specifically, fictitious pages will never be
>    completely unwired.  Therefore, we can keep a fictitious page's wired
>    count forever set to one and thereby avoid the use of
>    PHYS_TO_VM_PAGE() when we know that we're working with a fictitious
>    page, just not which one.
>
>    In collaboration with: green@, tegge@
>    PR: kern/29915

Reviewed by:	alc

Revision 1.361: download - view: text, markup, annotated - select for diffs
Fri Sep 3 05:11:32 2004 UTC (7 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.360: preferred, colored
Changes since revision 1.360: +0 -3 lines
Push Giant deep into vm_forkproc(), acquiring it only if the process has
mapped System V shared memory segments (see shmfork_myhook()) or requires
the allocation of an ldt (see vm_fault_wire()).

Revision 1.360: download - view: text, markup, annotated - select for diffs
Mon Aug 16 06:16:12 2004 UTC (7 years, 5 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.359: preferred, colored
Changes since revision 1.359: +4 -4 lines
 - Introduce and use a new tunable "debug.mpsafevm".  At present, setting
   "debug.mpsafevm" results in (almost) Giant-free execution of zero-fill
   page faults.  (Giant is held only briefly, just long enough to determine
   if there is a vnode backing the faulting address.)

   Also, condition the acquisition and release of Giant around calls to
   pmap_remove() on "debug.mpsafevm".

   The effect on performance is significant.  On my dual Opteron, I see a
   3.6% reduction in "buildworld" time.

 - Use atomic operations to update several counters in vm_fault().

Revision 1.359: download - view: text, markup, annotated - select for diffs
Mon Aug 16 03:11:09 2004 UTC (7 years, 5 months ago) by green
Branches: MAIN
Diff to: previous 1.358: preferred, colored
Changes since revision 1.358: +5 -1 lines
Rather than bringing back all of the changes to make VM map deletion
wait for system wires to disappear, do so (much more trivially) by
instead only checking for system wires of user maps and not kernel maps.

Alternative by:	tor
Reviewed by:	alc

Revision 1.358: download - view: text, markup, annotated - select for diffs
Sat Aug 14 18:57:41 2004 UTC (7 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.357: preferred, colored
Changes since revision 1.357: +2 -19 lines
Remove spl calls.

Revision 1.357: download - view: text, markup, annotated - select for diffs
Fri Aug 13 08:06:34 2004 UTC (7 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.356: preferred, colored
Changes since revision 1.356: +212 -98 lines
Replace the linear search in vm_map_findspace() with an O(log n)
algorithm built into the map entry splay tree.  This replaces the
first_free hint in struct vm_map with two fields in vm_map_entry:
adj_free, the amount of free space following a map entry, and
max_free, the maximum amount of free space in the entry's subtree.
These fields make it possible to find a first-fit free region of a
given size in one pass down the tree, so O(log n) amortized using
splay trees.

This significantly reduces the overhead in vm_map_findspace() for
applications that mmap() many hundreds or thousands of regions, and
has a negligible slowdown (0.1%) on buildworld.  See, for example, the
discussion of a micro-benchmark titled "Some mmap observations
compared to Linux 2.6/OpenBSD" on -hackers in late October 2003.

OpenBSD adopted this approach in March 2002, and NetBSD added it in
November 2003, both with Red-Black trees.

Submitted by: Mark W. Krentel

Revision 1.356: download - view: text, markup, annotated - select for diffs
Thu Aug 12 20:14:49 2004 UTC (7 years, 5 months ago) by tegge
Branches: MAIN
Diff to: previous 1.355: preferred, colored
Changes since revision 1.355: +102 -6 lines
The vm map lock is needed in vm_fault() after the page has been found,
to avoid later changes before pmap_enter() and vm_fault_prefault()
has completed.

Simplify deadlock avoidance by not blocking on vm map relookup.

In collaboration with: alc

Revision 1.355: download - view: text, markup, annotated - select for diffs
Thu Aug 12 17:22:28 2004 UTC (7 years, 5 months ago) by green
Branches: MAIN
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +0 -3 lines
Re-delete the comment from r1.352.

Revision 1.354: download - view: text, markup, annotated - select for diffs
Tue Aug 10 14:42:48 2004 UTC (7 years, 6 months ago) by green
Branches: MAIN
Diff to: previous 1.353: preferred, colored
Changes since revision 1.353: +18 -33 lines
Back out all behavioral chnages.

Revision 1.353: download - view: text, markup, annotated - select for diffs
Mon Aug 9 19:52:29 2004 UTC (7 years, 6 months ago) by green
Branches: MAIN
Diff to: previous 1.352: preferred, colored
Changes since revision 1.352: +32 -14 lines
Revamp VM map wiring.

* Allow no-fault wiring/unwiring to succeed for consistency;
  however, the wired count remains at zero, so it's a special case.

* Fix issues inside vm_map_wire() and vm_map_unwire() where the
  exact state of user wiring (one or zero) and system wiring
  (zero or more) could be confused; for example, system unwiring
  could succeed in removing a user wire, instead of being an
  error.

* Require all mappings to be unwired before they are deleted.
  When VM space is still wired upon deletion, it will be waited
  upon for the following unwire.  This makes vslock(9) work
  rather than allowing kernel-locked memory to be deleted
  out from underneath of its consumer as it would before.

Revision 1.352: download - view: text, markup, annotated - select for diffs
Mon Aug 9 18:15:46 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.351: preferred, colored
Changes since revision 1.351: +0 -3 lines
Remove a stale comment from vm_map_lookup() that pertains to share maps.
(The last vestiges of the share map code were removed in revisions 1.153
and 1.159.)

Revision 1.351: download - view: text, markup, annotated - select for diffs
Wed Aug 4 22:03:16 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.350: preferred, colored
Changes since revision 1.350: +0 -2 lines
 - Push down the acquisition and release of Giant into pmap_enter_quick()
   on those architectures without pmap locking.
 - Eliminate the acquisition and release of Giant in vm_map_pmap_enter().

Revision 1.350: download - view: text, markup, annotated - select for diffs
Mon Aug 2 00:18:35 2004 UTC (7 years, 6 months ago) by green
Branches: MAIN
Diff to: previous 1.349: preferred, colored
Changes since revision 1.349: +9 -7 lines
* Add a "how" argument to uma_zone constructors and initialization functions
  so that they know whether the allocation is supposed to be able to sleep
  or not.
* Allow uma_zone constructors and initialation functions to return either
  success or error.  Almost all of the ones in the tree currently return
  success unconditionally, but mbuf is a notable exception: the packet
  zone constructor wants to be able to fail if it cannot suballocate an
  mbuf cluster, and the mbuf allocators want to be able to fail in general
  in a MAC kernel if the MAC mbuf initializer fails.  This fixes the
  panics people are seeing when they run out of memory for mbuf clusters.
* Allow debug.nosleepwithlocks on WITNESS to be disabled, without changing
  the default.

Both bmilekic and jeff have reviewed the changes made to make failable
zone allocations work.

Revision 1.349: download - view: text, markup, annotated - select for diffs
Fri Jul 30 20:38:30 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.348: preferred, colored
Changes since revision 1.348: +0 -2 lines
 - Push down the acquisition and release of Giant into pmap_protect() on
   those architectures without pmap locking.
 - Eliminate the acquisition and release of Giant from vm_map_protect().

(Translation: mprotect(2) runs to completion without touching Giant on
alpha, amd64, i386 and ia64.)

Revision 1.348: download - view: text, markup, annotated - select for diffs
Fri Jul 30 09:10:28 2004 UTC (7 years, 6 months ago) by mux
Branches: MAIN
Diff to: previous 1.347: preferred, colored
Changes since revision 1.347: +17 -25 lines
Get rid of another lockmgr(9) consumer by using sx locks for the user
maps.  We always acquire the sx lock exclusively here, but we can't
use a mutex because we want to be able to sleep while holding the
lock.  This is completely equivalent to what we were doing with the
lockmgr(9) locks before.

Approved by:	alc

Revision 1.347: download - view: text, markup, annotated - select for diffs
Tue Jul 27 03:53:41 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.346: preferred, colored
Changes since revision 1.346: +11 -6 lines
 - Use atomic ops for updating the vmspace's refcnt and exitingcnt.
 - Push down Giant into shmexit().  (Giant is acquired only if the vmspace
   contains shm segments.)
 - Eliminate the acquisition of Giant from proc_rwmem().
 - Reduce the scope of Giant in exit1(), uncovering the destruction of the
   address space.

Revision 1.346: download - view: text, markup, annotated - select for diffs
Sun Jul 25 07:48:47 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.345: preferred, colored
Changes since revision 1.345: +2 -2 lines
Make the code and comments for vm_object_coalesce() consistent.

Revision 1.345: download - view: text, markup, annotated - select for diffs
Sat Jul 24 07:40:35 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.344: preferred, colored
Changes since revision 1.344: +8 -11 lines
Simplify vmspace initialization.  The bcopy() of fields from the old
vmspace to the new vmspace in vmspace_exec() is mostly wasted effort.  With
one exception, vm_swrss, the copied fields are immediately overwritten.
Instead, initialize these fields to zero in vmspace_alloc(), eliminating a
bcopy() from vmspace_exec() and a bzero() from vmspace_fork().

Revision 1.344: download - view: text, markup, annotated - select for diffs
Wed Jul 21 05:08:10 2004 UTC (7 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.343: preferred, colored
Changes since revision 1.343: +4 -2 lines
Semi-gratuitous change.  Move two refcount operations to their own lines
rather than be buried inside an if (expression).  And now that the if
expression is the same in both exit paths, use the same ordering.

Revision 1.343: download - view: text, markup, annotated - select for diffs
Wed Jul 21 00:29:21 2004 UTC (7 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.342: preferred, colored
Changes since revision 1.342: +2 -3 lines
Move the initialization and teardown of pmaps to the vmspace zone's
init and fini handlers.  Our vm system removes all userland mappings at
exit prior to calling pmap_release.  It just so happens that we might
as well reuse the pmap for the next process since the userland slate
has already been wiped clean.

However.  There is a functional benefit to this as well.  For platforms
that share userland and kernel context in the same pmap, it means that
the kernel portion of a pmap remains valid after the vmspace has been
freed (process exit) and while it is in uma's cache.  This is significant
for i386 SMP systems with kernel context borrowing because it avoids
a LOT of IPIs from the pmap_lazyfix() cleanup in the usual case.

Tested on:  amd64, i386, sparc64, alpha
Glanced at by:  alc

Revision 1.342: download - view: text, markup, annotated - select for diffs
Thu Jul 15 18:00:43 2004 UTC (7 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.341: preferred, colored
Changes since revision 1.341: +0 -8 lines
Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove().  In general, they require the lock in
order to modify a page's pv list or flags.  In some cases, however,
pmap_protect() can avoid acquiring the lock.

Revision 1.341: download - view: text, markup, annotated - select for diffs
Mon Jun 28 19:58:39 2004 UTC (7 years, 7 months ago) by gallatin
Branches: MAIN
Diff to: previous 1.340: preferred, colored
Changes since revision 1.340: +3 -3 lines
Use MIN() macro rather than ulmin() inline, and fix stray tab
that snuck in with my last commit.

Submitted by: green

Revision 1.340: download - view: text, markup, annotated - select for diffs
Mon Jun 28 19:15:40 2004 UTC (7 years, 7 months ago) by gallatin
Branches: MAIN
Diff to: previous 1.339: preferred, colored
Changes since revision 1.339: +3 -3 lines
Fix alpha - the use of min() on longs was loosing the high bits and
returning wrong answers, leading to strange values vm2->vm_{s,t,d}size.

Revision 1.339: download - view: text, markup, annotated - select for diffs
Thu Jun 24 22:43:46 2004 UTC (7 years, 7 months ago) by green
Branches: MAIN
Diff to: previous 1.338: preferred, colored
Changes since revision 1.338: +44 -3 lines
Correct the tracking of various bits of the process's vmspace and vm_map
when not propogated on fork (due to minherit(2)).  Consistency checks
otherwise fail when the vm_map is freed and it appears to have not been
emptied completely, causing an INVARIANTS panic in vm_map_zdtor().

PR:		kern/68017
Submitted by:	Mark W. Krentel <krentel@dreamscape.com>
Reviewed by:	alc

Revision 1.187.2.23.2.1: download - view: text, markup, annotated - select for diffs
Tue May 25 23:01:21 2004 UTC (7 years, 8 months ago) by des
Branches: RELENG_4_9
Diff to: previous 1.187.2.23: preferred, colored; next MAIN 1.187.2.24: preferred, colored
Changes since revision 1.187.2.23: +7 -1 lines
MFS: msync(2) with the MS_INVALIDATE flag should not delete dirty pages.

Approved by:	so

Revision 1.187.2.17.2.1: download - view: text, markup, annotated - select for diffs
Tue May 25 23:01:19 2004 UTC (7 years, 8 months ago) by des
Branches: RELENG_4_8
Diff to: previous 1.187.2.17: preferred, colored; next MAIN 1.187.2.18: preferred, colored
Changes since revision 1.187.2.17: +7 -1 lines
MFS: msync(2) with the MS_INVALIDATE flag should not delete dirty pages.

Approved by:	so

Revision 1.187.2.30: download - view: text, markup, annotated - select for diffs
Tue May 25 22:46:38 2004 UTC (7 years, 8 months ago) by des
Branches: RELENG_4
Diff to: previous 1.187.2.29: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.29: +2 -2 lines
Cosmetic change to simplify patch generation.

Revision 1.338: download - view: text, markup, annotated - select for diffs
Tue May 25 18:28:52 2004 UTC (7 years, 8 months ago) by des
Branches: MAIN
Diff to: previous 1.337: preferred, colored
Changes since revision 1.337: +1 -8 lines
Back out previous commit; it went to the wrong file.

Revision 1.337: download - view: text, markup, annotated - select for diffs
Tue May 25 16:31:49 2004 UTC (7 years, 8 months ago) by des
Branches: MAIN
Diff to: previous 1.336: preferred, colored
Changes since revision 1.336: +8 -1 lines
MFS: rev 1.187.2.27 through 1.187.2.29, fix MS_INVALIDATE semantics but
provide a sysctl knob for reverting to old ones.

Revision 1.336: download - view: text, markup, annotated - select for diffs
Tue May 25 05:51:17 2004 UTC (7 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.335: preferred, colored
Changes since revision 1.335: +5 -4 lines
Correct two error cases in vm_map_unwire():

1. Contrary to the Single Unix Specification our implementation of
   munlock(2) when performed on an unwired virtual address range has
   returned an error.  Correct this.  Note, however, that the behavior
   of "system" unwiring is unchanged, only "user" unwiring is changed.
   If "system" unwiring is performed on an unwired virtual address
   range, an error is still returned.

2. Performing an errant "system" unwiring on a virtual address range
   that was "user" (i.e., mlock(2)) but not "system" wired would
   incorrectly undo the "user" wiring instead of returning an error.
   Correct this.

Discussed with:  green@
Reviewed by:     tegge@

Revision 1.187.2.24.2.4: download - view: text, markup, annotated - select for diffs
Sat May 22 23:09:19 2004 UTC (7 years, 8 months ago) by kensmith
Branches: RELENG_4_10
CVS tags: RELENG_4_10_0_RELEASE
Diff to: previous 1.187.2.24.2.3: preferred, colored; branchpoint 1.187.2.24: preferred, colored; next MAIN 1.187.2.25: preferred, colored
Changes since revision 1.187.2.24.2.3: +7 -1 lines
MFS of Rev. 1.187.2.29, adding sysctl "vm.old_msync" to allow users to
choose the old msync(... MS_INVALIDATE) heuristics if needed.

Approved by:	re (scottl)

Revision 1.187.2.29: download - view: text, markup, annotated - select for diffs
Sat May 22 20:28:53 2004 UTC (7 years, 8 months ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.28: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.28: +7 -1 lines
It was found the previous commit causes a severe change in behavior
of msync( ...,MS_INVALIDATE) on NFS-mounted partitions.  Given this
is a stable branch and the issue being addressed to begin with may
not concern some users we are providing a way to get the old behavior
if desired.  The default will be to have the new behavior which is to
only flush pages from memory if they are not dirty.  By changing the
sysctl vm.old_msync users can get the old behavior back.  Because of the
unified VM/buffer-cache system what to do as a proper fix to this
issue is proving to be quite difficult.  It is still being worked on
but we need this stop-gap solution for now.

Revision 1.335: download - view: text, markup, annotated - select for diffs
Sat May 22 04:53:51 2004 UTC (7 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.334: preferred, colored
Changes since revision 1.334: +13 -5 lines
To date, unwiring a fictitious page has produced a panic.  The reason
being that PHYS_TO_VM_PAGE() returns the wrong vm_page for fictitious
pages but unwiring uses PHYS_TO_VM_PAGE().  The resulting panic
reported an unexpected wired count.  Rather than attempting to fix
PHYS_TO_VM_PAGE(), this fix takes advantage of the properties of
fictitious pages.  Specifically, fictitious pages will never be
completely unwired.  Therefore, we can keep a fictitious page's wired
count forever set to one and thereby avoid the use of
PHYS_TO_VM_PAGE() when we know that we're working with a fictitious
page, just not which one.

In collaboration with: green@, tegge@
PR: kern/29915

Revision 1.187.2.28: download - view: text, markup, annotated - select for diffs
Fri May 14 23:35:19 2004 UTC (7 years, 8 months ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.27: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.27: +0 -0 lines
Forced commit to note that the change for rev 1.187.2.27 was developed
by Matt Dillon.  Sorry Matt.

Revision 1.187.2.24.2.3: download - view: text, markup, annotated - select for diffs
Fri May 14 23:06:25 2004 UTC (7 years, 8 months ago) by kensmith
Branches: RELENG_4_10
Diff to: previous 1.187.2.24.2.2: preferred, colored; branchpoint 1.187.2.24: preferred, colored
Changes since revision 1.187.2.24.2.2: +1 -1 lines
MFS of rev 1.187.2.27: Change vm_map_clean(... MS_INVALIDATE) to not
delete dirty pages.

Approved by:	re (bmah)

Revision 1.187.2.27: download - view: text, markup, annotated - select for diffs
Fri May 14 18:24:44 2004 UTC (7 years, 8 months ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.26: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.26: +1 -1 lines
Change vm_map_clean(... MS_INVALIDATE) to not delete dirty pages.  Note
this was not needed in HEAD because the VM system is different.

Reviewed by:	alc, tegge
MFS:		immediately

Revision 1.334: download - view: text, markup, annotated - select for diffs
Fri May 7 00:17:07 2004 UTC (7 years, 9 months ago) by green
Branches: MAIN
Diff to: previous 1.333: preferred, colored
Changes since revision 1.333: +1 -0 lines
Properly remove MAP_FUTUREWIRE when a vm_map_entry gets torn down.
Previously, mlockall(2) usage would leak MAP_FUTUREWIRE of the process's
vmspace::vm_map and subsequent processes would wire all of their memory.
Coupled with a wired-page leak in vm_fault_unwire(), this would run the
system out of free pages and cause programs to randomly SIGBUS when
faulting in new pages.

(Note that this is not the fix for the latter part; pages are still
 leaked when a wired area is unmapped in some cases.)

Reviewed by:	alc
PR		kern/62930

Revision 1.187.2.24.2.2: download - view: text, markup, annotated - select for diffs
Wed May 5 19:38:28 2004 UTC (7 years, 9 months ago) by kensmith
Branches: RELENG_4_10
Diff to: previous 1.187.2.24.2.1: preferred, colored; branchpoint 1.187.2.24: preferred, colored
Changes since revision 1.187.2.24.2.1: +2 -1 lines
MFS of rev. 1.187.2.26

Approved by:	re (scottl)

Revision 1.187.2.26: download - view: text, markup, annotated - select for diffs
Wed May 5 19:28:23 2004 UTC (7 years, 9 months ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.25: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.25: +2 -1 lines
MFC of rev 1.331:

	date: 2004/03/23 08:37:34;  author: tjr;  state: Exp;  lines: +2 -1
	Do not copy vm_exitingcnt to the new vmspace in vmspace_exec().
	Copying it led to impossibly high values in the new vmspace,
	causing it to never drop to 0 and be freed.

Requested/tested by:	ps
Reviewed by:		alc
MFS:			immediately

Revision 1.187.2.24.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 03:05:36 2004 UTC (7 years, 9 months ago) by kensmith
Branches: RELENG_4_10
Diff to: previous 1.187.2.24: preferred, colored
Changes since revision 1.187.2.24: +3 -2 lines
Merging Alan Cox's fixes to mmap(2) into the 4.10 release.  RELENG_4
commit versions being merged:

  Revision    Changes    Path
  1.35.2.10   +2 -2      src/sys/alpha/alpha/pmap.c
  1.250.2.25  +3 -2      src/sys/i386/i386/pmap.c
  1.33.2.6    +2 -2      src/sys/vm/pmap.h
  1.187.2.25  +3 -2      src/sys/vm/vm_map.c

Approved by:	re (scottl)

Revision 1.187.2.25: download - view: text, markup, annotated - select for diffs
Sun Apr 25 16:03:41 2004 UTC (7 years, 9 months ago) by kensmith
Branches: RELENG_4
Diff to: previous 1.187.2.24: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.24: +3 -2 lines
This is an MFC of work done by Alan Cox.  It addresses a security issue
with mmap(2) where pages marked as PROT_NONE may become readable under
certain circumstances.

The commits to -current being MFC-ed with this are:

	Revision  Changes    Path
	1.333     +5 -4      src/sys/vm/vm_map.c
	1.109     +1 -1      src/sys/vm/vm_map.h

Which were a result of a PR:

	Submitted by:   "Mark W. Krentel" <krentel@dreamscape.com>
	PR:             kern/64573

Reviewed by:	alc

Revision 1.333: download - view: text, markup, annotated - select for diffs
Sat Apr 24 03:46:44 2004 UTC (7 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.332: preferred, colored
Changes since revision 1.332: +5 -4 lines
In cases where a file was resident in memory mmap(..., PROT_NONE, ...)
would actually map the file with read access enabled.  According to
http://www.opengroup.org/onlinepubs/007904975/functions/mmap.html this is
an error.  Similarly, an madvise(..., MADV_WILLNEED) would enable read
access on a virtual address range that was PROT_NONE.

The solution implemented herein is (1) to pass a vm_prot_t to
vm_map_pmap_enter() describing the allowed access and (2) to make
vm_map_pmap_enter() responsible for understanding the limitations of
pmap_enter_quick().

Submitted by:	"Mark W. Krentel" <krentel@dreamscape.com>
PR:		kern/64573

Revision 1.332: download - view: text, markup, annotated - select for diffs
Tue Apr 6 20:15:36 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.331: preferred, colored
Changes since revision 1.331: +0 -4 lines
Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core

Revision 1.331: download - view: text, markup, annotated - select for diffs
Tue Mar 23 08:37:34 2004 UTC (7 years, 10 months ago) by tjr
Branches: MAIN
Diff to: previous 1.330: preferred, colored
Changes since revision 1.330: +2 -1 lines
Do not copy vm_exitingcnt to the new vmspace in vmspace_exec(). Copying
it led to impossibly high values in the new vmspace, causing it to never
drop to 0 and be freed.

Revision 1.187.2.24: download - view: text, markup, annotated - select for diffs
Fri Mar 12 00:24:55 2004 UTC (7 years, 11 months ago) by peter
Branches: RELENG_4
CVS tags: RELENG_4_10_BP
Branch point for: RELENG_4_10
Diff to: previous 1.187.2.23: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.23: +1 -1 lines
MFC: part of vm_map.h rev 1.68 and vm_map.c 1.212.  This is actually
a prequisite of the vm_map.c rev 1.280 that dillon prematurely MFC'ed
on Jan 13th, 2003.  Without this change, the kernel leaks vmspaces
to varying degrees depending on the circumstances.  Specifically,
vm_exitingcnt was being copied from the parent to the child when it
might have been non-zero.  This caused the child's vm_exitingcnt to
never hit zero.  This was blowing up machines at work.

Revision 1.330: download - view: text, markup, annotated - select for diffs
Sun Mar 7 21:06:48 2004 UTC (7 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.329: preferred, colored
Changes since revision 1.329: +0 -2 lines
Retire pmap_pinit2().  Alpha was the last platform that used it.  However,
ever since alpha/alpha/pmap.c revision 1.81 introduced the list allpmaps,
there has been no reason for having this function on Alpha.  Briefly,
when pmap_growkernel() relied upon the list of all processes to find and
update the various pmaps to reflect a growth in the kernel's valid
address space, pmap_init2() served to avoid a race between pmap
initialization and pmap_growkernel().  Specifically, pmap_pinit2() was
responsible for initializing the kernel portions of the pmap and
pmap_pinit2() was called after the process structure contained a pointer
to the new pmap for use by pmap_growkernel().  Thus, an update to the
kernel's address space might be applied to the new pmap unnecessarily,
but an update would never be lost.

Revision 1.329: download - view: text, markup, annotated - select for diffs
Thu Feb 12 20:56:06 2004 UTC (7 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +2 -2 lines
Further reduce the use of Giant in vm_map_delete(): Perform pmap_remove()
on system maps, besides the kmem_map, without Giant.

In collaboration with:	tegge

Revision 1.328: download - view: text, markup, annotated - select for diffs
Thu Feb 5 06:33:18 2004 UTC (8 years ago) by alc
Branches: MAIN
Diff to: previous 1.327: preferred, colored
Changes since revision 1.327: +1 -3 lines
 - Locking for the per-process resource limits structure has eliminated
   the need for Giant in vm_map_growstack().
 - Use the proc * that is passed to vm_map_growstack() rather than
   curthread->td_proc.

Revision 1.327: download - view: text, markup, annotated - select for diffs
Wed Feb 4 21:52:57 2004 UTC (8 years ago) by jhb
Branches: MAIN
Diff to: previous 1.326: preferred, colored
Changes since revision 1.326: +16 -9 lines
Locking for the per-process resource limits structure.
- struct plimit includes a mutex to protect a reference count.  The plimit
  structure is treated similarly to struct ucred in that is is always copy
  on write, so having a reference to a structure is sufficient to read from
  it without needing a further lock.
- The proc lock protects the p_limit pointer and must be held while reading
  limits from a process to keep the limit structure from changing out from
  under you while reading from it.
- Various global limits that are ints are not protected by a lock since
  int writes are atomic on all the archs we support and thus a lock
  wouldn't buy us anything.
- All accesses to individual resource limits from a process are abstracted
  behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return
  either an rlimit, or the current or max individual limit of the specified
  resource from a process.
- dosetrlimit() was renamed to kern_setrlimit() to match existing style of
  other similar syscall helper functions.
- The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit()
  (it didn't used the stackgap when it should have) but uses lim_rlimit()
  and kern_setrlimit() instead.
- The svr4 compat no longer uses the stackgap for resource limits calls,
  but uses lim_rlimit() and kern_setrlimit() instead.
- The ibcs2 compat no longer uses the stackgap for resource limits.  It
  also no longer uses the stackgap for accessing sysctl's for the
  ibcs2_sysconf() syscall but uses kernel_sysctl() instead.  As a result,
  ibcs2_sysconf() no longer needs Giant.
- The p_rlimit macro no longer exists.

Submitted by:	mtm (mostly, I only did a few cleanups and catchups)
Tested on:	i386
Compiled on:	alpha, amd64

Revision 1.326: download - view: text, markup, annotated - select for diffs
Mon Feb 2 23:23:48 2004 UTC (8 years ago) by jhb
Branches: MAIN
Diff to: previous 1.325: preferred, colored
Changes since revision 1.325: +2 -2 lines
Drop the reference count on the old vmspace after fully switching the
current thread to the new vmspace.

Suggested by:	dillon

Revision 1.325: download - view: text, markup, annotated - select for diffs
Tue Dec 30 22:28:36 2003 UTC (8 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.324: preferred, colored
Changes since revision 1.324: +0 -2 lines
 - Modify vm_object_split() to expect a locked vm object on entry and
   return on a locked vm object on exit.  Remove GIANT_REQUIRED.
 - Eliminate some unnecessary local variables from vm_object_split().

Revision 1.324: download - view: text, markup, annotated - select for diffs
Fri Dec 26 21:54:45 2003 UTC (8 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.323: preferred, colored
Changes since revision 1.323: +1 -2 lines
Minor correction to revision 1.258: Use the proc pointer that is passed to
vm_map_growstack() in the RLIMIT_VMEM check rather than curthread.

Revision 1.323: download - view: text, markup, annotated - select for diffs
Wed Nov 19 18:48:45 2003 UTC (8 years, 2 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +4 -2 lines
 - Avoid a lock-order reversal between Giant and a system map mutex that
   occurs when kmem_malloc() fails to allocate a sufficient number of vm
   pages.  Specifically, we avoid the lock-order reversal by not grabbing
   Giant around pmap_remove() if the map is the kmem_map.

Approved by:	re (jhb)
Reported by:	Eugene <eugene3@web.de>

Revision 1.322: download - view: text, markup, annotated - select for diffs
Fri Nov 14 06:55:11 2003 UTC (8 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.321: preferred, colored
Changes since revision 1.321: +2 -2 lines
Changes to msync(2)
 - Return EBUSY if the region was wired by mlock(2) and MS_INVALIDATE
   is specified to msync(2).  This is required by the Open Group Base
   Specifications Issue 6.
 - vm_map_sync() doesn't return KERN_FAILURE.  Thus, msync(2) can't
   possibly return EIO.
 - The second major loop in vm_map_sync() handles sub maps.  Thus,
   failing on sub maps in the first major loop isn't necessary.

Revision 1.321: download - view: text, markup, annotated - select for diffs
Mon Nov 10 01:37:40 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.320: preferred, colored
Changes since revision 1.320: +6 -14 lines
 - The Open Group Base Specifications Issue 6 specifies that an munmap(2)
   must return EINVAL if size is zero.  Submitted by: tegge
 - In order to avoid a race condition in multithreaded applications, the
   check and removal operations by munmap(2) must be in the same critical
   section.  To accomodate this, vm_map_check_protection() is modified to
   require its caller to obtain at least a read lock on the map.

Revision 1.320: download - view: text, markup, annotated - select for diffs
Sun Nov 9 22:09:04 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.319: preferred, colored
Changes since revision 1.319: +10 -0 lines
 - Remove Giant from msync(2).  Giant is still acquired by the lower layers
   if we drop into the pmap or vnode layers.
 - Migrate the handling of zero-length msync(2)s into vm_map_sync() so that
   multithread applications can't change the map between implementing the
   zero-length hack in msync(2) and reacquiring the map lock in
   vm_map_sync().

Reviewed by:	tegge

Revision 1.319: download - view: text, markup, annotated - select for diffs
Sun Nov 9 05:25:34 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.318: preferred, colored
Changes since revision 1.318: +5 -59 lines
 - Rename vm_map_clean() to vm_map_sync().  This better reflects the fact
   that msync(2) is its only caller.
 - Migrate the parts of the old vm_map_clean() that examined the internals
   of a vm object to a new function vm_object_sync() that is implemented in
   vm_object.c.  At the same, introduce the necessary vm object locking so
   that vm_map_sync() and vm_object_sync() can be called without Giant.

Reviewed by:	tegge

Revision 1.318: download - view: text, markup, annotated - select for diffs
Wed Nov 5 05:48:22 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +24 -30 lines
 - Move the implementation of OBJ_ONEMAPPING from vm_map_delete() to
   vm_map_entry_delete() so that all of the vm object manipulation is
   performed in one place.

Revision 1.317: download - view: text, markup, annotated - select for diffs
Tue Nov 4 06:48:58 2003 UTC (8 years, 3 months ago) by marcel
Branches: MAIN
Diff to: previous 1.316: preferred, colored
Changes since revision 1.316: +1 -0 lines
Update avail_ssize for rstacks after growing them.

Revision 1.316: download - view: text, markup, annotated - select for diffs
Mon Nov 3 16:14:45 2003 UTC (8 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.315: preferred, colored
Changes since revision 1.315: +29 -29 lines
Whitespace cleanup.

Revision 1.315: download - view: text, markup, annotated - select for diffs
Mon Nov 3 00:59:54 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.314: preferred, colored
Changes since revision 1.314: +3 -5 lines
 - Increase the scope of the source object lock in vm_map_copy_entry().

Revision 1.314: download - view: text, markup, annotated - select for diffs
Sun Nov 2 21:30:10 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +1 -1 lines
 - Introduce and use vm_object_reference_locked().  Unlike
   vm_object_reference(), this function must not be used to reanimate dead
   vm objects.  This restriction simplifies locking.

Reviewed by:	tegge

Revision 1.313: download - view: text, markup, annotated - select for diffs
Fri Oct 31 07:29:28 2003 UTC (8 years, 3 months ago) by marcel
Branches: MAIN
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +2 -1 lines
Fix two bugs introduced with the rstack functionality and specific to
the rstack functionality:
1. Fix a KASSERT that tests for the address to be above the upward
   growable stack. Typically for rstack, the faulting address can be
   identical to the record end of the upward growable entry, and
   very likely is on ia64. The KASSERT tested for greater than, not
   greater equal, so whenever the register stack had to be grown
   the assertion fired.
2. When we grow the upward growable stack entry and adjust the
   unlying object, don't forget to adjust the size of the VM map.
   Not doing so would trigger an assert in vm_mapzdtor().

Pointy hat: marcel (for not testing with INVARIANTS).

Revision 1.312: download - view: text, markup, annotated - select for diffs
Sat Oct 18 18:48:17 2003 UTC (8 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +36 -22 lines
Corrections to revision 1.305
 - Specifying VM_MAP_WIRE_HOLESOK should not assume that the start
   address is the beginning of the map.  Instead, move to the first
   entry after the start address.
 - The implementation of VM_MAP_WIRE_HOLESOK was incomplete.  This
   caused the failure of mlockall(2) in some circumstances.

Revision 1.311: download - view: text, markup, annotated - select for diffs
Mon Oct 6 01:47:12 2003 UTC (8 years, 4 months ago) by bms
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +6 -0 lines
Move pmap_resident_count() from the MD pmap.h to the MI pmap.h.
Add a definition of pmap_wired_count().
Add a definition of vmspace_wired_count().

Reviewed by:	truckman
Discussed with:	peter

Revision 1.187.2.23: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:22:58 2003 UTC (8 years, 4 months ago) by silby
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE
Branch point for: RELENG_4_9
Diff to: previous 1.187.2.22: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.22: +1 -0 lines
Add an include I forgot in the previous commit.  Eeek.

Revision 1.187.2.22: download - view: text, markup, annotated - select for diffs
Wed Oct 1 19:39:42 2003 UTC (8 years, 4 months ago) by silby
Branches: RELENG_4
Diff to: previous 1.187.2.21: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.21: +2 -1 lines
MFC rev 1.309 ; increase the # of kmap entries allowed.

Approved by:	re (murray)

Revision 1.187.2.21: download - view: text, markup, annotated - select for diffs
Wed Oct 1 01:21:37 2003 UTC (8 years, 4 months ago) by gallatin
Branches: RELENG_4
Diff to: previous 1.187.2.20: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.20: +1 -0 lines
Fix a bug which was introduced in version 1.187.2.16 of
sys/vm/vm_map.c and affects the unwiring memory:

The map entries are processed in a loop, checking to make sure the
entry is wired and asserting it has a wired count. However, another
loop was inserted more-or-less in the middle of the of the unwiring
path.  This loop picks up the "entry" loop variable from the first loop
without first setting it to start_entry.  Naturally, the second loop
is never entered and the pages backing the entries are never unwired.
This can lead to a leak of wired pages.

Reviewed by: alc
Approved by: re (murray)

Revision 1.310: download - view: text, markup, annotated - select for diffs
Sat Sep 27 22:28:14 2003 UTC (8 years, 4 months ago) by marcel
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +56 -40 lines
Part 2 of implementing rstacks: add the ability to create rstacks and
use the ability on ia64 to map the register stack. The orientation of
the stack (i.e. its grow direction) is passed to vm_map_stack() in the
overloaded cow argument. Since the grow direction is represented by
bits, it is possible and allowed to create bi-directional stacks.
This is not an advertised feature, more of a side-effect.

Fix a bug in vm_map_growstack() that's specific to rstacks and which
we could only find by having the ability to create rstacks: when
the mapped stack ends at the faulting address, we have not actually
mapped the faulting address. we need to include or cover the faulting
address.

Note that at this time mmap(2) has not been extended to allow the
creation of rstacks by processes. If such a need arises, this can
be done.

Tested on: alpha, i386, ia64, sparc64

Revision 1.309: download - view: text, markup, annotated - select for diffs
Tue Sep 23 18:56:54 2003 UTC (8 years, 4 months ago) by silby
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +3 -1 lines
Adjust the kmapentzone limit so that it takes into account the size of
maxproc and maxfiles, as procs, pipes, and other structures cause allocations
from kmapentzone.

Submitted by:	tegge

Revision 1.308: download - view: text, markup, annotated - select for diffs
Tue Sep 23 04:28:04 2003 UTC (8 years, 4 months ago) by alc
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +18 -23 lines
Change the handling of the kernel and kmem objects in vm_map_delete():  In
order to use "unmanaged" pages in the kmem object, vm_map_delete() must
unconditionally perform pmap_remove().  Otherwise, sparc64 has problems.

Tested by:	jake

Revision 1.307: download - view: text, markup, annotated - select for diffs
Sat Aug 30 21:25:22 2003 UTC (8 years, 5 months ago) by marcel
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +147 -83 lines
Introduce MAP_ENTRY_GROWS_DOWN and MAP_ENTRY_GROWS_UP to allow for
growable (stack) entries that not only grow down, but also grow up.
Have vm_map_growstack() take these flags into account when growing
an entry.

This is the first step in adding support for upward growable stacks.
It is a required feature on ia64 to support the register stack (or
rstack as I like to call it -- it also means reverse stack). We do
not currently create rstacks, so the upward growing is not exercised
and the change should be a functional no-op.

Reviewed by: alc

Revision 1.306: download - view: text, markup, annotated - select for diffs
Wed Aug 13 19:23:51 2003 UTC (8 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +0 -1 lines
Remove GIANT_REQUIRED from vmspace_alloc().

Revision 1.305: download - view: text, markup, annotated - select for diffs
Mon Aug 11 07:14:07 2003 UTC (8 years, 6 months ago) by bms
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +39 -12 lines
Add the mlockall() and munlockall() system calls.
 - All those diffs to syscalls.master for each architecture *are*
   necessary. This needed clarification; the stub code generation for
   mlockall() was disabled, which would prevent applications from
   linking to this API (suggested by mux)
 - Giant has been quoshed. It is no longer held by the code, as
   the required locking has been pushed down within vm_map.c.
 - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES
   to express their intention explicitly.
 - Inspected at the vmstat, top and vm pager sysctl stats level.
   Paging-in activity is occurring correctly, using a test harness.
 - The RES size for a process may appear to be greater than its SIZE.
   This is believed to be due to mappings of the same shared library
   page being wired twice. Further exploration is needed.
 - Believed to back out of allocations and locks correctly
   (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC).

PR:             kern/43426, standards/54223
Reviewed by:    jake, alc
Approved by:    jake (mentor)
MFC after:	2 weeks

Revision 1.187.2.20: download - view: text, markup, annotated - select for diffs
Sun Aug 10 18:14:11 2003 UTC (8 years, 6 months ago) by tegge
Branches: RELENG_4
Diff to: previous 1.187.2.19: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.19: +2 -1 lines
MFC rev 1.302:
Check the address provided to vm_map_stack() against the vm map's maximum,
returning an error if the address is too high.

Revision 1.304: download - view: text, markup, annotated - select for diffs
Fri Jul 18 10:47:58 2003 UTC (8 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +0 -37 lines
Move the implementation of the vmspace_swap_count() (used only in
the "toss the largest process" emergency handling) from vm_map.c to
swap_pager.c.

The quantity calculated depends strongly on the internals of the
swap_pager and by moving it, we no longer need to expose the
internal metrics of the swap_pager to the world.

Revision 1.303: download - view: text, markup, annotated - select for diffs
Thu Jul 3 20:18:02 2003 UTC (8 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +74 -1 lines
Background: pmap_object_init_pt() premaps the pages of a object in
order to avoid the overhead of later page faults.  In general, it
implements two cases: one for vnode-backed objects and one for
device-backed objects.  Only the device-backed case is really
machine-dependent, belonging in the pmap.

This commit moves the vnode-backed case into the (relatively) new
function vm_map_pmap_enter().  On amd64 and i386, this commit only
amounts to code rearrangement.  On alpha and ia64, the new machine
independent (MI) implementation of the vnode case is smaller and more
efficient than their pmap-based implementations.  (The MI
implementation takes advantage of the fact that objects in -CURRENT
are ordered collections of pages.)  On sparc64, pmap_object_init_pt()
hadn't (yet) been implemented.

Revision 1.302: download - view: text, markup, annotated - select for diffs
Tue Jul 1 03:57:25 2003 UTC (8 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +2 -1 lines
Check the address provided to vm_map_stack() against the vm map's maximum,
returning an error if the address is too high.

Revision 1.301: download - view: text, markup, annotated - select for diffs
Sun Jun 29 23:32:55 2003 UTC (8 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +19 -7 lines
Introduce vm_map_pmap_enter().  Presently, this is a stub calling the MD
pmap_object_init_pt().

Revision 1.300: download - view: text, markup, annotated - select for diffs
Fri Jun 27 18:52:49 2003 UTC (8 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +0 -4 lines
Simple read-modify-write operations on a vm object's flags, ref_count, and
shadow_count can now rely on its mutex for synchronization.  Remove one use
of Giant from vm_map_insert().

Revision 1.299: download - view: text, markup, annotated - select for diffs
Wed Jun 25 05:31:02 2003 UTC (8 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +0 -2 lines
Remove a GIANT_REQUIRED on the kernel object that we no longer need.

Revision 1.298: download - view: text, markup, annotated - select for diffs
Wed Jun 11 23:50:50 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +3 -2 lines
Use __FBSDID().

Revision 1.297: download - view: text, markup, annotated - select for diffs
Sat Jun 7 02:29:17 2003 UTC (8 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +2 -2 lines
Pass the vm object to vm_object_collapse() with its lock held.

Revision 1.187.2.19: download - view: text, markup, annotated - select for diffs
Tue May 27 00:47:02 2003 UTC (8 years, 8 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.187.2.18: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.18: +2 -1 lines
MFC
 Make the reservation of KVA space for kernel map entries a function
 of the KVA space's size in addition to the amount of physical memory
 and reduce it by a factor of two.

Revision 1.187.2.18: download - view: text, markup, annotated - select for diffs
Mon May 26 19:17:56 2003 UTC (8 years, 8 months ago) by alc
Branches: RELENG_4
Diff to: previous 1.187.2.17: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.17: +5 -5 lines
MFC
 Reduce the size of a vm object by converting its shadow list from a TAILQ
 to a LIST.

Revision 1.296: download - view: text, markup, annotated - select for diffs
Wed Apr 30 19:18:09 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +13 -12 lines
Increase the scope of the vm_object lock in vm_map_delete().

Revision 1.295: download - view: text, markup, annotated - select for diffs
Wed Apr 30 00:43:17 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +6 -5 lines
Add vm_object locking to vmspace_swap_count().

Revision 1.294: download - view: text, markup, annotated - select for diffs
Sat Apr 26 05:30:56 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +1 -1 lines
 - Extend the scope of two existing vm_object locks to cover
   swap_pager_freespace().

Revision 1.293: download - view: text, markup, annotated - select for diffs
Thu Apr 24 04:31:25 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +2 -0 lines
 - Acquire the vm_object's lock when performing vm_object_page_clean().
 - Add a parameter to vm_pageout_flush() that tells vm_pageout_flush()
   whether its caller has locked the vm_object.  (This is a temporary
   measure to bootstrap vm_object locking.)

Revision 1.292: download - view: text, markup, annotated - select for diffs
Sun Apr 20 21:56:40 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +13 -8 lines
 - Update the vm_object locking in vm_map_insert().

Revision 1.291: download - view: text, markup, annotated - select for diffs
Sun Apr 20 04:35:47 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +9 -5 lines
Update vm_object locking in vm_map_delete().

Revision 1.290: download - view: text, markup, annotated - select for diffs
Sat Apr 19 01:43:32 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +2 -4 lines
 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().

Revision 1.289: download - view: text, markup, annotated - select for diffs
Sun Apr 13 20:22:01 2003 UTC (8 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +4 -4 lines
Lock some manipulations of the vm object's flags.

Revision 1.288: download - view: text, markup, annotated - select for diffs
Tue Mar 18 08:45:25 2003 UTC (8 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +0 -1 lines
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.

Revision 1.287: download - view: text, markup, annotated - select for diffs
Wed Mar 12 23:13:16 2003 UTC (8 years, 11 months ago) by das
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +13 -2 lines
- 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)

Revision 1.286: download - view: text, markup, annotated - select for diffs
Thu Mar 6 03:41:02 2003 UTC (8 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +0 -249 lines
Remove ENABLE_VFS_IOOPT.  It is a long unfinished work-in-progress.

Discussed on:	arch@

Revision 1.285: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:46 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +3 -3 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.284: download - view: text, markup, annotated - select for diffs
Sat Feb 15 20:01:09 2003 UTC (8 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +0 -2 lines
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.)

Revision 1.283: download - view: text, markup, annotated - select for diffs
Sat Jan 25 18:45:55 2003 UTC (9 years ago) by alc
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +2 -2 lines
Add MTX_DUPOK to the initialization of system map locks.

Revision 1.282: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:56:16 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +3 -3 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.281: download - view: text, markup, annotated - select for diffs
Mon Jan 20 17:46:48 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +8 -3 lines
Close the remaining user address mapping races for physical
I/O, CAM, and AIO.  Still TODO: streamline useracc() checks.

Reviewed by:	alc, tegge
MFC after:	7 days

Revision 1.280: download - view: text, markup, annotated - select for diffs
Mon Jan 13 23:04:32 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +8 -0 lines
It is possible for an active aio to prevent shared memory from being
dereferenced when a process exits due to the vmspace ref-count being
bumped.  Change shmexit() and shmexit_myhook() to take a vmspace instead
of a process and call it in vmspace_dofree().  This way if it is missed
in exit1()'s early-resource-free it will still be caught when the zombie is
reaped.

Also fix a potential race in shmexit_myhook() by NULLing out
vmspace->vm_shm prior to calling shm_delete_mapping() and free().

MFC after:	7 days

Revision 1.187.2.17: download - view: text, markup, annotated - select for diffs
Mon Jan 13 22:51:17 2003 UTC (9 years ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_8_BP, RELENG_4_8_0_RELEASE
Branch point for: RELENG_4_8
Diff to: previous 1.187.2.16: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.16: +43 -17 lines
primarily MFC vm_map.c 1.275.  Also pull-in vm_waitproc() and
cpu_wait() changes from current.  This should close reference
count races with the vmspace structure.  There is still a
shmexit() race (structure never freed) which will be addressed in
a day or two with a fix MFC from current.

Revision 1.279: download - view: text, markup, annotated - select for diffs
Fri Jan 3 09:15:43 2003 UTC (9 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +4 -0 lines
Lock the vm object when performing vm_object_clear_flag().

Revision 1.278: download - view: text, markup, annotated - select for diffs
Tue Dec 31 19:38:04 2002 UTC (9 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +38 -16 lines
Implement a variant locking scheme for vm maps: Access to system maps
is now synchronized by a mutex, whereas access to user maps is still
synchronized by a lockmgr()-based lock.  Why?  No single type of lock,
including sx locks, meets the requirements of both types of vm map.
Sometimes we sleep while holding the lock on a user map.  Thus, a
a mutex isn't appropriate.  On the other hand, both lockmgr()-based
and sx locks release Giant when a thread/process blocks during
contention for a lock.  This could lead to a race condition in a legacy
driver (that relies on Giant for synchronization) if it attempts to
kmem_malloc() and fails to immediately obtain the lock.  Fortunately,
we never sleep while holding a system map lock.

Revision 1.277: download - view: text, markup, annotated - select for diffs
Mon Dec 30 00:41:33 2002 UTC (9 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +11 -10 lines
 - Increment the vm_map's timestamp if _vm_map_trylock() succeeds.
 - Introduce map_sleep_mtx and use it to replace Giant in
   vm_map_unlock_and_wait() and vm_map_wakeup().  (Original
   version by: tegge.)

Revision 1.276: download - view: text, markup, annotated - select for diffs
Sun Dec 29 21:01:14 2002 UTC (9 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +0 -1 lines
 - Remove vm_object_init2().  It is unused.
 - Add a mtx_destroy() to vm_object_collapse().  (This allows a bzero()
   to migrate from _vm_object_allocate() to vm_object_zinit(), where it
   will be performed less often.)

Revision 1.273.2.1: download - view: text, markup, annotated - select for diffs
Sun Dec 22 03:30:33 2002 UTC (9 years, 1 month ago) by dillon
Branches: RELENG_5_0
CVS tags: RELENG_5_0_0_RELEASE
Diff to: previous 1.273: preferred, colored; next MAIN 1.274: preferred, colored
Changes since revision 1.273: +17 -6 lines
MFC to 5.0 refcount race fix for the vmspace structure.
kern/kern_exit.c 1.188, vm/vm_map.c 1.275, vm/vm_map.h 1.93.

Revision 1.275: download - view: text, markup, annotated - select for diffs
Sun Dec 15 18:50:04 2002 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +17 -6 lines
Fix a refcount race with the vmspace structure.  In order to prevent
resource starvation we clean-up as much of the vmspace structure as we
can when the last process using it exits.  The rest of the structure
is cleaned up when it is reaped.  But since exit1() decrements the ref
count it is possible for a double-free to occur if someone else, such as
the process swapout code, references and then dereferences the structure.
Additionally, the final cleanup of the structure should not occur until
the last process referencing it is reaped.

This commit solves the problem by introducing a secondary reference count,
calling 'vm_exitingcnt'.  The normal reference count is decremented on exit
and vm_exitingcnt is incremented.  vm_exitingcnt is decremented when the
process is reaped.  When both vm_exitingcnt and vm_refcnt are 0, the
structure is freed for real.

MFC after:	3 weeks

Revision 1.274: download - view: text, markup, annotated - select for diffs
Sun Dec 15 07:16:51 2002 UTC (9 years, 1 month ago) by alc
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +8 -2 lines
Perform vm_object_lock() and vm_object_unlock() around
vm_object_page_remove().

Revision 1.273: download - view: text, markup, annotated - select for diffs
Sun Dec 1 18:57:56 2002 UTC (9 years, 2 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_0_BP
Branch point for: RELENG_5_0
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +22 -7 lines
Hold the page queues lock when calling pmap_protect(); it updates fields
of the vm_page structure.  Make the style of the pmap_protect() calls
consistent.

Approved by:	re (blanket)

Revision 1.272: download - view: text, markup, annotated - select for diffs
Mon Nov 25 22:00:31 2002 UTC (9 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +4 -0 lines
Acquire and release the page queues lock around calls to pmap_protect()
because it updates flags within the vm page.

Approved by:	re (blanket)

Revision 1.271: download - view: text, markup, annotated - select for diffs
Sat Nov 9 21:26:49 2002 UTC (9 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +2 -2 lines
Fix an error case in vm_map_wire(): unwiring of an entry during cleanup
after a user wire error fails when the entry is already system wired.

Reported by:	tegge

Revision 1.270: download - view: text, markup, annotated - select for diffs
Thu Nov 7 22:49:07 2002 UTC (9 years, 3 months ago) by mux
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +5 -6 lines
Correctly print vm_offset_t types.

Revision 1.269: download - view: text, markup, annotated - select for diffs
Wed Oct 16 10:52:15 2002 UTC (9 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +2 -2 lines
Properly put macro args in ().

Spotted by:	FlexeLint.

Revision 1.187.2.16: download - view: text, markup, annotated - select for diffs
Thu Oct 10 19:28:21 2002 UTC (9 years, 4 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187.2.15: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.15: +530 -297 lines
MFC fix vm_map_entry collisions and buffer_map collisions that can occur
under very heavy memory pressure.  There are places where the kernel can
block where it normally does not block which were not properly handled.  These
fixes have been heavily tested.  They are based on work Alan and Tor
have done in -current but are not a direct MFC.  They are not entirely
optimal but they should be solid.

Add a new sysctl counter, vm.v_intrans_coll and vm.v_intrans_wait
which indicates how many times a vm_map_entry collision has been
detected and how many times vm_map code had to block waiting for
a collision to clear.
Reviewed by:	alc, tegge
Testing by: "Marc G. Fournier" <scrappy@hub.org> (note: there are
	still unresolved bugs on Marc's boxes unrelated to this
	patch).

Revision 1.187.2.15: download - view: text, markup, annotated - select for diffs
Thu Sep 26 17:32:01 2002 UTC (9 years, 4 months ago) by mdodd
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7
Diff to: previous 1.187.2.14: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.14: +10 -7 lines
MFC:	1.268
Modify vm_map_clean() (and thus the msync(2) system call) to support
invalidation of cached pages for objects of type OBJT_DEVICE.

Submitted by:	 Christian Zander <zander@minion.de>
Reviewed by:	 alc
Approved by:	 re (jhb)

Revision 1.268: download - view: text, markup, annotated - select for diffs
Sun Sep 22 08:22:32 2002 UTC (9 years, 4 months ago) by mdodd
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +10 -7 lines
Modify vm_map_clean() (and thus the msync(2) system call) to support
invalidation of cached pages for objects of type OBJT_DEVICE.

Submitted by:	Christian Zander <zander@minion.de>
Approved by:	alc

Revision 1.267: download - view: text, markup, annotated - select for diffs
Sat Sep 21 22:07:17 2002 UTC (9 years, 4 months ago) by jake
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +3 -4 lines
Use the fields in the sysentvec and in the vm map header in place of the
constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS.
This is mainly so that they can be variable even for the native abi, based
on different machine types.  Get stack protections from the sysentvec too.
This makes it trivial to map the stack non-executable for certain abis, on
machines that support it.

Revision 1.266: download - view: text, markup, annotated - select for diffs
Sat Aug 24 17:52:08 2002 UTC (9 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +2 -2 lines
 o Use vm_object_lock() in place of Giant when manipulating a vm object
   in vm_map_insert().

Revision 1.265: download - view: text, markup, annotated - select for diffs
Wed Jul 24 19:47:56 2002 UTC (9 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +2 -5 lines
 o Merge vm_fault_wire() and vm_fault_user_wire() by adding a new parameter,
   user_wire.

Revision 1.264: download - view: text, markup, annotated - select for diffs
Sat Jul 20 02:56:12 2002 UTC (9 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +2 -3 lines
Infrastructure tweaks to allow having both an Elf32 and an Elf64 executable
handler in the kernel at the same time.  Also, allow for the
exec_new_vmspace() code to build a different sized vmspace depending on
the executable environment.  This is a big help for execing i386 binaries
on ia64.   The ELF exec code grows the ability to map partial pages when
there is a page size difference, eg: emulating 4K pages on 8K or 16K
hardware pages.

Flesh out the i386 emulation support for ia64.  At this point, the only
binary that I know of that fails is cvsup, because the cvsup runtime
tries to execute code in pages not marked executable.

Obtained from:  dfr (mostly, many tweaks from me).

Revision 1.263: download - view: text, markup, annotated - select for diffs
Thu Jul 18 10:28:00 2002 UTC (9 years, 6 months ago) by peter
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +1 -1 lines
(VM_MAX_KERNEL_ADDRESS - KERNBASE) / PAGE_SIZE  may not fit in an integer.
Use lmin(long, long), not min(u_int, u_int).  This is a problem here on
ia64 which has *way* more than 2^32 pages of KVA.  281474976710655 pages
to be precice.

Revision 1.262: download - view: text, markup, annotated - select for diffs
Fri Jul 12 23:20:06 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +6 -0 lines
 o Assert GIANT_REQUIRED on system maps in _vm_map_lock(),
   _vm_map_lock_read(), and _vm_map_trylock().  Submitted by: tegge
 o Remove GIANT_REQUIRED from kmem_alloc_wait() and kmem_free_wakeup().
   (This clears the way for exec_map accesses to move outside of Giant.
   The exec_map is not a system map.)
 o Remove some premature MPSAFE comments.

Reviewed by:	tegge

Revision 1.261: download - view: text, markup, annotated - select for diffs
Thu Jul 11 02:39:24 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +3 -2 lines
 o Add a "needs wakeup" flag to the vm_map for use by kmem_alloc_wait()
   and kmem_free_wakeup().  Previously, kmem_free_wakeup() always
   called wakeup().  In general, no one was sleeping.
 o Export vm_map_unlock_and_wait() and vm_map_wakeup() from vm_map.c
   for use in vm_kern.c.

Revision 1.260: download - view: text, markup, annotated - select for diffs
Wed Jul 3 19:16:37 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +2 -1 lines
 o Make the reservation of KVA space for kernel map entries a function
   of the KVA space's size in addition to the amount of physical memory
   and reduce it by a factor of two.

Under the old formula, our reservation amounted to one kernel map entry
per virtual page in the KVA space on a 4GB i386.

Revision 1.187.2.14: download - view: text, markup, annotated - select for diffs
Tue Jul 2 20:06:18 2002 UTC (9 years, 7 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187.2.13: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.13: +14 -0 lines
MFC RLIMIT_VMEM resource Stage I - limit the total virtual memory use for
a process (exec() to be handled in Stage II).

Revision 1.259: download - view: text, markup, annotated - select for diffs
Wed Jun 26 20:32:48 2002 UTC (9 years, 7 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +3 -2 lines
Avoid using the 64-bit vm_pindex_t in a few places where 64-bit
types are not required, as the overhead is unnecessary:

 o In the i386 pmap_protect(), `sindex' and `eindex' represent page
   indices within the 32-bit virtual address space.
 o In swp_pager_meta_build() and swp_pager_meta_ctl(), use a temporary
   variable to store the low few bits of a vm_pindex_t that gets used
   as an array index.
 o vm_uiomove() uses `osize' and `idx' for page offsets within a
   map entry.
 o In vm_object_split(), `idx' is a page offset within a map entry.

Revision 1.258: download - view: text, markup, annotated - select for diffs
Wed Jun 26 03:13:46 2002 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +14 -0 lines
Enforce RLIMIT_VMEM on growable mappings (aka the primary stack or any
MAP_STACK mapping).

Suggested by:	alc

Revision 1.257: download - view: text, markup, annotated - select for diffs
Sat Jun 22 17:47:12 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +6 -5 lines
 o In vm_map_insert(), replace GIANT_REQUIRED by the acquisition and
   release of Giant around the direct manipulation of the vm_object and
   the optional call to pmap_object_init_pt().
 o In vm_map_findspace(), remove GIANT_REQUIRED.  Instead, acquire and
   release Giant around the occasional call to pmap_growkernel().
 o In vm_map_find(), remove GIANT_REQUIRED.

Revision 1.256: download - view: text, markup, annotated - select for diffs
Fri Jun 21 06:03:47 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +0 -2 lines
 o Remove GIANT_REQUIRED from vm_map_stack().

Revision 1.255: download - view: text, markup, annotated - select for diffs
Wed Jun 19 06:02:02 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +2 -2 lines
 o Replace GIANT_REQUIRED in vm_object_coalesce() by the acquisition and
   release of Giant.
 o Reduce the scope of GIANT_REQUIRED in vm_map_insert().

These changes will enable us to remove the acquisition and release
of Giant from obreak().

Revision 1.254: download - view: text, markup, annotated - select for diffs
Tue Jun 18 18:31:35 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +2 -2 lines
 o Remove LK_CANRECURSE from the vm_map lock.

Revision 1.253: download - view: text, markup, annotated - select for diffs
Mon Jun 17 22:02:41 2002 UTC (9 years, 7 months ago) by jeff
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +2 -1 lines
- Introduce the new M_NOVM option which tells uma to only check the currently
  allocated slabs and bucket caches for free items.  It will not go ask the vm
  for pages.  This differs from M_NOWAIT in that it not only doesn't block, it
  doesn't even ask.

- Add a new zcreate option ZONE_VM, that sets the BUCKETCACHE zflag.  This
  tells uma that it should only allocate buckets out of the bucket cache, and
  not from the VM.  It does this by using the M_NOVM option to zalloc when
  getting a new bucket.  This is so that the VM doesn't recursively enter
  itself while trying to allocate buckets for vm_map_entry zones.  If there
  are already allocated buckets when we get here we'll still use them but
  otherwise we'll skip it.

- Use the ZONE_VM flag on vm map entries and pv entries on x86.

Revision 1.252: download - view: text, markup, annotated - select for diffs
Mon Jun 17 13:27:40 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +7 -0 lines
 o Acquire and release Giant in vm_map_wakeup() to prevent
   a lost wakeup().

Reviewed by:	tegge

Revision 1.251: download - view: text, markup, annotated - select for diffs
Fri Jun 14 18:21:00 2002 UTC (9 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +0 -397 lines
 o Use vm_map_wire() and vm_map_unwire() in place of vm_map_pageable() and
   vm_map_user_pageable().
 o Remove vm_map_pageable() and vm_map_user_pageable().
 o Remove vm_map_clear_recursive() and vm_map_set_recursive().  (They were
   only used by vm_map_pageable() and vm_map_user_pageable().)

Reviewed by:	tegge

Revision 1.250: download - view: text, markup, annotated - select for diffs
Wed Jun 12 08:15:52 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +5 -3 lines
 o Acquire and release Giant in vm_map_unlock_and_wait().

Submitted by:	tegge

Revision 1.249: download - view: text, markup, annotated - select for diffs
Tue Jun 11 19:13:59 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +20 -4 lines
 o Properly handle a failure by vm_fault_wire() or vm_fault_user_wire()
   in vm_map_wire().
 o Make two white-space changes in vm_map_wire().

Reviewed by:	tegge

Revision 1.248: download - view: text, markup, annotated - select for diffs
Tue Jun 11 05:24:22 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +31 -0 lines
 o Teach vm_map_delete() to respect the "in-transition" flag
   on a vm_map_entry by sleeping until the flag is cleared.

Submitted by:	tegge

Revision 1.247: download - view: text, markup, annotated - select for diffs
Mon Jun 10 06:11:45 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +6 -5 lines
 o In vm_map_entry_create(), call uma_zalloc() with M_NOWAIT on system maps.
   Submitted by: tegge
 o Eliminate the "!mapentzone" check from vm_map_entry_create() and
   vm_map_entry_dispose().  Reviewed by: tegge
 o Fix white-space usage in vm_map_entry_create().

Revision 1.246: download - view: text, markup, annotated - select for diffs
Sun Jun 9 20:25:18 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +159 -1 lines
 o Add vm_map_wire() for wiring contiguous regions of either kernel
   or user vm_maps.  This implementation has two key benefits when compared
   to vm_map_{user_,}pageable(): (1) it avoids a race condition through
   the use of "in-transition" vm_map entries and (2) it eliminates lock
   recursion on the vm_map.

Note: there is still an error case that requires clean up.

Reviewed by:	tegge

Revision 1.245: download - view: text, markup, annotated - select for diffs
Sat Jun 8 19:00:40 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +11 -17 lines
 o Simplify vm_map_unwire() by merging the second and third passes
   over the caller-specified region.

Revision 1.244: download - view: text, markup, annotated - select for diffs
Sat Jun 8 07:32:38 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +15 -6 lines
 o Remove an unnecessary call to vm_map_wakeup() from vm_map_unwire().
 o Add a stub for vm_map_wire().

Note: the description of the previous commit had an error.  The in-
transition flag actually blocks the deallocation of a vm_map_entry by
vm_map_delete() and vm_map_simplify_entry().

Revision 1.243: download - view: text, markup, annotated - select for diffs
Fri Jun 7 18:34:23 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +163 -1 lines
 o Add vm_map_unwire() for unwiring contiguous regions of either kernel
   or user vm_maps.  In accordance with the standards for munlock(2),
   and in contrast to vm_map_user_pageable(), this implementation does not
   allow holes in the specified region.  This implementation uses the
   "in transition" flag described below.
 o Introduce a new flag, "in transition," to the vm_map_entry.
   Eventually, vm_map_delete() and vm_map_simplify_entry() will respect
   this flag by deallocating in-transition vm_map_entrys, allowing
   the vm_map lock to be safely released in vm_map_unwire() and (the
   forthcoming) vm_map_wire().
 o Modify vm_map_simplify_entry() to respect the in-transition flag.

In collaboration with:	tegge

Revision 1.242: download - view: text, markup, annotated - select for diffs
Sun Jun 2 23:54:08 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +1 -90 lines
 o Migrate vm_map_split() from vm_map.c to vm_object.c, renaming it
   to vm_object_split().  Its interface should still be changed
   to resemble vm_object_shadow().

Revision 1.241: download - view: text, markup, annotated - select for diffs
Sun Jun 2 19:32:05 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +1 -8 lines
 o Style fixes to vm_map_split(), including the elimination of one variable
   declaration that shadows another.

Note: This function should really be vm_object_split(), not vm_map_split().

Reviewed by:	md5

Revision 1.240: download - view: text, markup, annotated - select for diffs
Sat Jun 1 22:41:43 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +7 -24 lines
 o Remove GIANT_REQUIRED from vm_map_zfini(), vm_map_zinit(),
   vm_map_create(), and vm_map_submap().
 o Make further use of a local variable in vm_map_entry_splay()
   that caches a reference to one of a vm_map_entry's children.
   (This reduces code size somewhat.)
 o Revert a part of revision 1.66, deinlining vmspace_pmap().
   (This function is MPSAFE.)

Revision 1.239: download - view: text, markup, annotated - select for diffs
Sat Jun 1 16:59:30 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +13 -14 lines
 o Revert a part of revision 1.66, contrary to what that commit message says,
   deinlining vm_map_entry_behavior() and vm_map_entry_set_behavior()
   actually increases the kernel's size.
 o Make vm_map_entry_set_behavior() static and add a comment describing
   its purpose.
 o Remove an unnecessary initialization statement from vm_map_entry_splay().

Revision 1.238: download - view: text, markup, annotated - select for diffs
Fri May 31 03:48:55 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +2 -3 lines
Further work on pushing Giant out of the vm_map layer and down
into the vm_object layer:
 o Acquire and release Giant in vm_object_shadow() and
   vm_object_page_remove().
 o Remove the GIANT_REQUIRED assertion preceding vm_map_delete()'s call
   to vm_object_page_remove().
 o Remove the acquisition and release of Giant around vm_map_lookup()'s
   call to vm_object_shadow().

Revision 1.237: download - view: text, markup, annotated - select for diffs
Sun May 26 04:54:56 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +3 -4 lines
 o Acquire and release Giant around pmap operations in vm_fault_unwire()
   and vm_map_delete().  Assert GIANT_REQUIRED in vm_map_delete()
   only if operating on the kernel_object or the kmem_object.
 o Remove GIANT_REQUIRED from vm_map_remove().
 o Remove the acquisition and release of Giant from munmap().

Revision 1.236: download - view: text, markup, annotated - select for diffs
Fri May 24 01:33:24 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +103 -80 lines
 o Replace the vm_map's hint by the root of a splay tree.  By design,
   the last accessed datum is moved to the root of the splay tree.
   Therefore, on lookups in which the hint resulted in O(1) access,
   the splay tree still achieves O(1) access.  In contrast, on lookups
   in which the hint failed miserably, the splay tree achieves amortized
   logarithmic complexity, resulting in dramatic improvements on vm_maps
   with a large number of entries.  For example, the execution time
   for replaying an access log from www.cs.rice.edu against the thttpd
   web server was reduced by 23.5% due to the large number of files
   simultaneously mmap()ed by this server.  (The machine in question has
   enough memory to cache most of this workload.)

   Nothing comes for free: At present, I see a 0.2% slowdown on "buildworld"
   due to the overhead of maintaining the splay tree.  I believe that
   some or all of this can be eliminated through optimizations
   to the code.

Developed in collaboration with: Juan E Navarro <jnavarro@cs.rice.edu>
Reviewed by:	jeff

Revision 1.235: download - view: text, markup, annotated - select for diffs
Sat May 18 07:48:06 2002 UTC (9 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +2 -2 lines
 o Remove GIANT_REQUIRED from vm_map_madvise().  Instead, acquire and
   release Giant around vm_map_madvise()'s call to pmap_object_init_pt().
 o Replace GIANT_REQUIRED in vm_object_madvise() with the acquisition
   and release of Giant.
 o Remove the acquisition and release of Giant from madvise().

Revision 1.234: download - view: text, markup, annotated - select for diffs
Sun May 12 18:42:05 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +0 -10 lines
 o Remove GIANT_REQUIRED and an excessive number of blank lines
   from vm_map_inherit().  (minherit() need not acquire Giant
   anymore.)

Revision 1.233: download - view: text, markup, annotated - select for diffs
Sun May 12 05:22:56 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +2 -3 lines
 o Acquire and release Giant in vm_object_reference() and
   vm_object_deallocate(), replacing the assertion GIANT_REQUIRED.
 o Remove GIANT_REQUIRED from vm_map_protect() and vm_map_simplify_entry().
 o Acquire and release Giant around vm_map_protect()'s call to pmap_protect().

Altogether, these changes eliminate the need for mprotect() to acquire
and release Giant.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Mon May 6 00:12:47 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +0 -77 lines
 o Move vm_freeze_copyopts() from vm_map.{c.h} to vm_object.{c,h}.  It's plainly
   an operation on a vm_object and belongs in the latter place.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Sun May 5 22:42:40 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +4 -0 lines
 o Condition the compilation of uiomoveco() and vm_uiomove()
   on ENABLE_VFS_IOOPT.
 o Add a comment to the effect that this code is experimental
   support for zero-copy I/O.

Revision 1.230: download - view: text, markup, annotated - select for diffs
Sun May 5 05:36:28 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +2 -2 lines
 o Remove GIANT_REQUIRED from vm_map_lookup() and vm_map_lookup_done().
 o Acquire and release Giant around vm_map_lookup()'s call
   to vm_object_shadow().

Revision 1.229: download - view: text, markup, annotated - select for diffs
Sat May 4 02:07:36 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +0 -3 lines
 o Remove GIANT_REQUIRED from vm_map_lookup_entry() and
   vm_map_check_protection().
 o Call vm_map_check_protection() without Giant held in munmap().

Revision 1.228: download - view: text, markup, annotated - select for diffs
Thu May 2 17:32:27 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +24 -26 lines
 o Change the implementation of vm_map locking to use exclusive locks
   exclusively.  The interface still, however, distinguishes
   between a shared lock and an exclusive lock.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Thu May 2 02:32:09 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +0 -6 lines
 o Remove dead and lockmgr()-specific debugging code.

Revision 1.226: download - view: text, markup, annotated - select for diffs
Mon Apr 29 23:45:41 2002 UTC (9 years, 9 months ago) by jeff
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +1 -1 lines
Add a new zone flag UMA_ZONE_MTXCLASS.  This puts the zone in it's own
mutex class.  Currently this is only used for kmapentzone because kmapents
are are potentially allocated when freeing memory.  This is not dangerous
though because no other allocations will be done while holding the
kmapentzone lock.

Revision 1.225: download - view: text, markup, annotated - select for diffs
Sun Apr 28 23:12:52 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +11 -11 lines
Pass the caller's file name and line number to the vm_map locking functions.

Revision 1.224: download - view: text, markup, annotated - select for diffs
Sun Apr 28 06:07:54 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +10 -0 lines
 o Introduce and use vm_map_trylock() to replace several direct uses
   of lockmgr().
 o Add missing synchronization to vmspace_swap_count(): Obtain a read lock
   on the vm_map before traversing it.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Sat Apr 27 22:01:37 2002 UTC (9 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +0 -19 lines
 o Begin documenting the (existing) locking protocol on the vm_map
   in the same style as sys/proc.h.
 o Undo the de-inlining of several trivial, MPSAFE methods on the vm_map.
   (Contrary to the commit message for vm_map.h revision 1.66 and vm_map.c
   revision 1.206, de-inlining these methods increased the kernel's size.)

Revision 1.222: download - view: text, markup, annotated - select for diffs
Wed Apr 17 05:26:42 2002 UTC (9 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +7 -3 lines
Do not free the vmspace until p->p_vmspace is set to null.  Otherwise
statclock can access it in the tail end of statclock_process() at an
unfortunate time.  This bit me several times on an SMP alpha (UP2000)
and the problem went away with this change.  I'm not sure why it doesn't
break x86 as well.  Maybe it's because the clocks are much faster
on alpha (HZ=1024 by default).

Revision 1.187.2.9.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 15 17:18:12 2002 UTC (9 years, 9 months ago) by nectar
Branches: RELENG_4_4
Diff to: previous 1.187.2.9: preferred, colored; next MAIN 1.187.2.10: preferred, colored
Changes since revision 1.187.2.9: +5 -2 lines
MFC 1.213: Fix mmap/msync bug which can panic the kernel.

Revision 1.187.2.12.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 15 17:14:28 2002 UTC (9 years, 9 months ago) by nectar
Branches: RELENG_4_5
Diff to: previous 1.187.2.12: preferred, colored; next MAIN 1.187.2.13: preferred, colored
Changes since revision 1.187.2.12: +4 -1 lines
MFC 1.213: Fix mmap/msync bug which can panic the kernel.

Revision 1.221: download - view: text, markup, annotated - select for diffs
Mon Apr 15 16:00:01 2002 UTC (9 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +1 -1 lines
Pass vm_page_t instead of physical addresses to pmap_zero_page[_area]()
and pmap_copy_page().  This gets rid of a couple more physical addresses
in upper layers, with the eventual aim of supporting PAE and dealing with
the physical addressing mostly within pmap.  (We will need either 64 bit
physical addresses or page indexes, possibly both depending on the
circumstances.  Leaving this to pmap itself gives more flexibilitly.)

Reviewed by:	jake
Tested on:	i386, ia64 and (I believe) sparc64. (my alpha was hosed)

Revision 1.220: download - view: text, markup, annotated - select for diffs
Wed Mar 20 04:02:59 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +6 -2 lines
Remove references to vm_zone.h and switch over to the new uma API.

Revision 1.219: download - view: text, markup, annotated - select for diffs
Tue Mar 19 11:49:10 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +1 -1 lines
Quit a warning introduced by UMA.  This only occurs on machines where
vm_size_t != unsigned long.

Reviewed by:	phk

Revision 1.218: download - view: text, markup, annotated - select for diffs
Tue Mar 19 09:11:48 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +122 -43 lines
This is the first part of the new kernel memory allocator.  This replaces
malloc(9) and vm_zone with a slab like allocator.

Reviewed by:	arch@

Revision 1.217: download - view: text, markup, annotated - select for diffs
Mon Mar 18 15:08:08 2002 UTC (9 years, 10 months ago) by green
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +58 -60 lines
Back out the modification of vm_map locks from lockmgr to sx locks.  The
best path forward now is likely to change the lockmgr locks to simple
sleep mutexes, then see if any extra contention it generates is greater
than removed overhead of managing local locking state information,
cost of extra calls into lockmgr, etc.

Additionally, making the vm_map lock a mutex and respecting it properly
will put us much closer to not needing Giant magic in vm.

Revision 1.216: download - view: text, markup, annotated - select for diffs
Sun Mar 17 03:19:31 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +6 -0 lines
Acquire a read lock on the map inside of vm_map_check_protection() rather
than expecting the caller to do so.  This (1) eliminates duplicated code in
kernacc() and useracc() and (2) fixes missing synchronization in munmap().

Revision 1.215: download - view: text, markup, annotated - select for diffs
Wed Mar 13 23:48:08 2002 UTC (9 years, 11 months ago) by green
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +60 -58 lines
Rename SI_SUB_MUTEX to SI_SUB_MTX_POOL to make the name at all accurate.
While doing this, move it earlier in the sysinit boot process so that the
VM system can use it.

After that, the system is now able to use sx locks instead of lockmgr
locks in the VM system.  To accomplish this, some of the more
questionable uses of the locks (such as testing whether they are
owned or not, as well as allowing shared+exclusive recursion) are
removed, and simpler logic throughout is used so locks should also be
easier to understand.

This has been tested on my laptop for months, and has not shown any
problems on SMP systems, either, so appears quite safe.  One more
user of lockmgr down, many more to go :)

Revision 1.214: download - view: text, markup, annotated - select for diffs
Sun Mar 10 21:52:46 2002 UTC (9 years, 11 months ago) by eivind
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +18 -78 lines
- Remove a number of extra newlines that do not belong here according to
  style(9)
- Minor space adjustment in cases where we have "( ", " )", if(), return(),
  while(), for(), etc.
- Add /* SYMBOL */ after a few #endifs.

Reviewed by:	alc

Revision 1.187.2.13: download - view: text, markup, annotated - select for diffs
Fri Mar 8 17:22:20 2002 UTC (9 years, 11 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6
Diff to: previous 1.187.2.12: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.12: +4 -1 lines
MFC 1.213, fix mmap/msync bug which can panic the kernel

Revision 1.213: download - view: text, markup, annotated - select for diffs
Thu Mar 7 03:54:56 2002 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +4 -1 lines
Fix a bug in the vm_map_clean() procedure.  msync()ing an area of memory
that has just been mapped MAP_ANON|MAP_NOSYNC and has not yet been accessed
will panic the machine.

MFC after:	1 day

Revision 1.212: download - view: text, markup, annotated - select for diffs
Tue Feb 5 21:23:05 2002 UTC (10 years ago) by alfred
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +30 -17 lines
Fix a race with free'ing vmspaces at process exit when vmspaces are
shared.

Also introduce vm_endcopy instead of using pointer tricks when
initializing new vmspaces.

The race occured because of how the reference was utilized:
  test vmspace reference,
  possibly block,
  decrement reference

When sharing a vmspace between multiple processes it was possible
for two processes exiting at the same time to test the reference
count, possibly block and neither one free because they wouldn't
see the other's update.

Submitted by: green

Revision 1.187.2.12: download - view: text, markup, annotated - select for diffs
Sat Nov 10 22:27:09 2001 UTC (10 years, 3 months ago) by tegge
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE
Branch point for: RELENG_4_5
Diff to: previous 1.187.2.11: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.11: +32 -3 lines
MFC: Fix locking violations during page wiring.
     Fix cleanup after page wiring failure.

Revision 1.187.2.11: download - view: text, markup, annotated - select for diffs
Sat Nov 3 01:41:10 2001 UTC (10 years, 3 months ago) by ps
Branches: RELENG_4
Diff to: previous 1.187.2.10: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.10: +3 -3 lines
MFC:
- Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
  tunable.
- Change TUNABLE_*_FETCH to have a return value of 0 if the variable
  was not found or successfully converted and true otherwise.
- Use vm_offset_t instead of caddr_t to fix a warning and remove
  two casts in kern_exec.c.

Revision 1.187.2.10: download - view: text, markup, annotated - select for diffs
Sat Nov 3 00:59:14 2001 UTC (10 years, 3 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187.2.9: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.9: +2 -2 lines
MFC don't let pmap_object_init_pt() exhaust all available free
pages (madvise kernel panic fix).

Submitted by:	ps, peter

Revision 1.211: download - view: text, markup, annotated - select for diffs
Wed Oct 31 03:06:32 2001 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +1 -1 lines
Don't let pmap_object_init_pt() exhaust all available free pages
(allocating pv entries w/ zalloci) when called in a loop due to
an madvise().  It is possible to completely exhaust the free page list and
cause a system panic when an expected allocation fails.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Sun Oct 14 20:47:08 2001 UTC (10 years, 3 months ago) by tegge
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +33 -4 lines
Fix locking violations during page wiring:

 - vm map entries are not valid after the map has been unlocked.

 - An exclusive lock on the map is needed before calling
   vm_map_simplify_entry().

Fix cleanup after page wiring failure to unwire all pages that had been
successfully wired before the failure was detected.

Reviewed by:	dillon

Revision 1.209: download - view: text, markup, annotated - select for diffs
Thu Oct 11 17:53:43 2001 UTC (10 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +2 -1 lines
Add missing includes of sys/ktr.h.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Wed Oct 10 23:06:54 2001 UTC (10 years, 4 months ago) by ps
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +4 -4 lines
Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks

Revision 1.207: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:38:11 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +15 -15 lines
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha

Revision 1.206: download - view: text, markup, annotated - select for diffs
Wed Jul 4 20:15:16 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +184 -107 lines
Change inlines back into mainline code in preparation for mutexing.  Also,
most of these inlines had been bloated in -current far beyond their
original intent.  Normalize prototypes and function declarations to be ANSI
only (half already were).  And do some general cleanup.

(kernel size also reduced by 50-100K, but that isn't the prime intent)

Revision 1.205: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:20:27 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +53 -60 lines
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.

Revision 1.204: download - view: text, markup, annotated - select for diffs
Fri Jun 22 06:35:22 2001 UTC (10 years, 7 months ago) by bmilekic
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +6 -6 lines
Introduce numerous SMP friendly changes to the mbuf allocator. Namely,
introduce a modified allocation mechanism for mbufs and mbuf clusters; one
which can scale under SMP and which offers the possibility of resource
reclamation to be implemented in the future. Notable advantages:

 o Reduce contention for SMP by offering per-CPU pools and locks.
 o Better use of data cache due to per-CPU pools.
 o Much less code cache pollution due to excessively large allocation macros.
 o Framework for `grouping' objects from same page together so as to be able
   to possibly free wired-down pages back to the system if they are no longer
   needed by the network stacks.

 Additional things changed with this addition:

  - Moved some mbuf specific declarations and initializations from
    sys/conf/param.c into mbuf-specific code where they belong.
  - m_getclr() has been renamed to m_get_clrd() because the old name is really
    confusing. m_getclr() HAS been preserved though and is defined to the new
    name. No tree sweep has been done "to change the interface," as the old
    name will continue to be supported and is not depracated. The change was
    merely done because m_getclr() sounds too much like "m_get a cluster."
  - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and
    systat(1) (see TODO below).
  - Fixed systat(1) to display number of "free mbufs" based on new per-CPU
    stat structures.
  - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported
    per-CPU stat structures. All infos are fetched via sysctl.

 TODO (in order of priority):

  - Re-enable mbtypes statistics in both netstat(1) and systat(1) after
    introducing an SMP friendly way to collect the mbtypes stats under the
    already introduced per-CPU locks (i.e. hopefully don't use atomic() - it
    seems too costly for a mere stat update, especially when other locks are
    already present).
  - Optionally have systat(1) display not only "total free mbufs" but also
    "total free mbufs per CPU pool."
  - Fix minor length-fetching issues in netstat(1) related to recently
    re-enabled option to read mbuf stats from a core file.
  - Move reference counters at least for mbuf clusters into an unused portion
    of the cluster itself, to save space and need to allocate a counter.
  - Look into introducing resource freeing possibly from a kproc.

Reviewed by (in parts): jlemon, jake, silby, terry
Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha)
Preliminary performance measurements: jlemon (and me, obviously)
URL: http://people.freebsd.org/~bmilekic/mb_alloc/

Revision 1.187.2.9: download - view: text, markup, annotated - select for diffs
Wed Jun 13 07:26:58 2001 UTC (10 years, 8 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE
Branch point for: RELENG_4_4
Diff to: previous 1.187.2.8: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.8: +36 -1 lines
MFC the two out-of-swap fixes (kill the correct process and start blasting
away at processes a little earlier, before the machine begins to lockup)

Revision 1.203: download - view: text, markup, annotated - select for diffs
Mon Jun 11 19:17:05 2001 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +20 -21 lines
Cleanup the tabbing

Revision 1.202: download - view: text, markup, annotated - select for diffs
Sat Jun 9 18:06:57 2001 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +36 -1 lines
Two fixes to the out-of-swap process termination code.   First, start killing
processes a little earlier to avoid a deadlock.  Second, when calculating
the 'largest process' do not just count RSS.  Instead count the RSS + SWAP
used by the process.  Without this the code tended to kill small
inconsequential processes like, oh, sshd, rather then one of the many
'eatmem 200MB' I run on a whim :-).  This fix has been extensively tested on
-stable and somewhat tested on -current and will be MFCd in a few days.

Shamed into fixing this by: ps

Revision 1.201: download - view: text, markup, annotated - select for diffs
Wed May 23 22:38:00 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +40 -3 lines
- Add lots of vm_mtx assertions.
- Add a few KTR tracepoints to track the addition and removal of
  vm_map_entry's and the creation adn free'ing of vmspace's.
- Adjust a few portions of code so that we update the process' vmspace
  pointer to its new vmspace before freeing the old vmspace.

Revision 1.200: download - view: text, markup, annotated - select for diffs
Sat May 19 01:28:09 2001 UTC (10 years, 8 months ago) by alfred
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +34 -9 lines
Introduce a global lock for the vm subsystem (vm_mtx).

vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb

Revision 1.199: download - view: text, markup, annotated - select for diffs
Tue May 1 08:13:20 2001 UTC (10 years, 9 months ago) by markm
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +3 -2 lines
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)

Revision 1.198: download - view: text, markup, annotated - select for diffs
Thu Apr 12 21:50:03 2001 UTC (10 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +2 -2 lines
remove truncated part from commment

Revision 1.187.2.8: download - view: text, markup, annotated - select for diffs
Wed Mar 14 07:05:05 2001 UTC (10 years, 11 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.187.2.7: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.7: +4 -1 lines
MFC lock reversal fix related to threaded programs.

Submitted by: tegge
Tested by: tegge
Approved: jkh

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Mar 14 06:48:53 2001 UTC (10 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +4 -1 lines
Fix a lock reversal problem in the VM subsystem related to threaded
programs.   There is a case during a fork() which can cause a deadlock.

From Tor -
The workaround that consists of setting a flag in the vm map that
indicates that a fork is in progress and using that mark in the page
fault handling to force a revalidation failure.  That change will only
affect (pessimize) page fault handling during fork for threaded
(linuxthreads style) applications and applications using aio_*().

Submited by: tegge

Revision 1.187.2.7: download - view: text, markup, annotated - select for diffs
Wed Mar 14 06:14:08 2001 UTC (10 years, 11 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187.2.6: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.6: +8 -1 lines
MFC 1.196 - undo a small piece of 1.194 to temporarily work around
longstanding problems with vm_map_growstack().

Reported by: tegge
Tested by: tegge
Approved: jkh

Revision 1.196: download - view: text, markup, annotated - select for diffs
Wed Mar 14 06:09:42 2001 UTC (10 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +8 -1 lines
Temporarily remove the vm_map_simplify() call from vm_map_insert().  The
call is correct, but it interferes with the massive hack called
vm_map_growstack().  The call will be returned after our stack handling
code is fixed.

Reported by: tegge

Revision 1.187.2.6: download - view: text, markup, annotated - select for diffs
Fri Mar 9 22:18:13 2001 UTC (10 years, 11 months ago) by iedowse
Branches: RELENG_4
Diff to: previous 1.187.2.5: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.5: +5 -1 lines
MFC: 1.195 Fix panic that occurs when mmap(2) is used with MAP_INHERIT.

Approved by:	jkh

Revision 1.195: download - view: text, markup, annotated - select for diffs
Fri Mar 9 18:25:54 2001 UTC (10 years, 11 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +5 -1 lines
When creating a shadow vm_object in vmspace_fork(), only one
reference count was transferred to the new object, but both the
new and the old map entries had pointers to the new object.
Correct this by transferring the second reference.

This fixes a panic that can occur when mmap(2) is used with the
MAP_INHERIT flag.

PR:		i386/25603
Reviewed by:	dillon, alc

Revision 1.187.2.5: download - view: text, markup, annotated - select for diffs
Fri Feb 9 02:58:49 2001 UTC (11 years ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187.2.4: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.4: +32 -11 lines
MFC Tor's buffer cache fixes.  This turns buffer_map into a system map,
gets rid of bogus allocations of backing VM objects for it, and makes
a minor bug fix to the buffer cache KVM hysteresis.

Revision 1.194: download - view: text, markup, annotated - select for diffs
Sun Feb 4 06:19:28 2001 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +24 -8 lines
This commit represents work mainly submitted by Tor and slightly modified
by myself.  It solves a serious vm_map corruption problem that can occur
with the buffer cache when block sizes > 64K are used.  This code has been
heavily tested in -stable but only tested somewhat on -current.  An MFC
will occur in a few days.  My additions include the vm_map_simplify_entry()
and minor buffer cache boundry case fix.

Make the buffer cache use a system map for buffer cache KVM rather then a
normal map.

Ensure that VM objects are not allocated for system maps.  There were cases
where a buffer map could wind up with a backing VM object -- normally
harmless, but this could also result in the buffer cache blocking in places
where it assumes no blocking will occur, possibly resulting in corrupted
maps.

Fix a minor boundry case in the buffer cache size limit is reached that
could result in non-optimal code.

Add vm_map_simplify_entry() calls to prevent 'creeping proliferation'
of vm_map_entry's in the buffer cache's vm_map.  Previously only a simple
linear optimization was made.  (The buffer vm_map typically has only a
handful of vm_map_entry's.  This stabilizes it at that level permanently).

PR: 20609
Submitted by: (Tor Egge) tegge

Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Dec 13 10:00:57 2000 UTC (11 years, 1 month ago) by tanimura
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +2 -2 lines
- If swap metadata does not fit into the KVM, reduce the number of
struct swblock entries by dividing the number of the entries by 2
until the swap metadata fits.

- Reject swapon(2) upon failure of swap_zone allocation.

This is just a temporary fix. Better solutions include:
(suggested by:	dillon)

o reserving swap in SWAP_META_PAGES chunks, and
o swapping the swblock structures themselves.

Reviewed by:	alfred, dillon

Revision 1.187.2.4: download - view: text, markup, annotated - select for diffs
Mon Nov 20 21:15:48 2000 UTC (11 years, 2 months ago) by tegge
Branches: RELENG_4
Diff to: previous 1.187.2.3: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.3: +3 -1 lines
MFC: Clear the MAP_ENTRY_USER_WIRED flag from cloned vm_map entries.

PR:		2840

Revision 1.192: download - view: text, markup, annotated - select for diffs
Thu Nov 2 21:38:18 2000 UTC (11 years, 3 months ago) by tegge
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +3 -1 lines
Clear the MAP_ENTRY_USER_WIRED flag from cloned vm_map entries.
PR:		2840

Revision 1.191: download - view: text, markup, annotated - select for diffs
Wed Oct 4 01:29:17 2000 UTC (11 years, 4 months ago) by jasone
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +9 -1 lines
Convert lockmgr locks from using simple locks to using mutexes.

Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.

Revision 1.187.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 2 22:04:30 2000 UTC (11 years, 6 months ago) by peter
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE
Diff to: previous 1.187.2.2: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.2: +2 -2 lines
MFC: various minor spelling fixes

Revision 1.187.2.2: download - view: text, markup, annotated - select for diffs
Mon May 15 16:48:12 2000 UTC (11 years, 8 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_1_0_RELEASE
Diff to: previous 1.187.2.1: preferred, colored; branchpoint 1.187: preferred, colored
Changes since revision 1.187.2.1: +1 -1 lines
    Correction: testing was done by "Paul H. Anderson" <pha@pdq.com>.  Sean
    helped with another bug.

Revision 1.187.2.1: download - view: text, markup, annotated - select for diffs
Mon May 15 16:45:40 2000 UTC (11 years, 8 months ago) by dillon
Branches: RELENG_4
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +6 -2 lines
    MFC 1.190 - fix bug in madvise MADV_WILLNEED

Reviewd by: alc
Tested by: "Sean O'Connell" <sean@stat.Duke.EDU>

Revision 1.190: download - view: text, markup, annotated - select for diffs
Sun May 14 18:46:40 2000 UTC (11 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +6 -2 lines
    Fixed bug in madvise() / MADV_WILLNEED.  When the request is offset
    from the base of the first map_entry the call to pmap_object_init_pt()
    uses the wrong start VA.  MFC to follow.

PR: i386/18095

Revision 1.189: download - view: text, markup, annotated - select for diffs
Mon Mar 27 20:41:15 2000 UTC (11 years, 10 months ago) by charnier
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +2 -2 lines
Revert spelling mistake I made in the previous commit
Requested by: Alan and Bruce

Revision 1.188: download - view: text, markup, annotated - select for diffs
Sun Mar 26 15:20:21 2000 UTC (11 years, 10 months ago) by charnier
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +3 -3 lines
Spelling

Revision 1.187: download - view: text, markup, annotated - select for diffs
Mon Feb 28 04:10:35 2000 UTC (11 years, 11 months ago) by ps
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +12 -2 lines
Add MAP_NOCORE to mmap(2), and MADV_NOCORE and MADV_CORE to madvise(2).
This
This feature allows you to specify if mmap'd data is included in
an application's corefile.

Change the type of eflags in struct vm_map_entry from u_char to
vm_eflags_t (an unsigned int).

Reviewed by:	dillon,jdp,alfred
Approved by:	jkh

Revision 1.186: download - view: text, markup, annotated - select for diffs
Wed Feb 16 21:11:32 2000 UTC (11 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +8 -2 lines
    Fix null-pointer dereference crash when the system is intentionally
    run out of KVM through a mmap()/fork() bomb that allocates hundreds
    of thousands of vm_map_entry structures.

    Add panic to make null-pointer dereference crash a little more verbose.

    Add a new sysctl, vm.max_proc_mmap, which specifies the maximum number
    of mmap()'d spaces (discrete vm_map_entry's in the process).  The value
    defaults to around 9000 for a 128MB machine.  The test is scaled for the
    number of processes sharing a vmspace (aka linux threads).  Setting
    the value to 0 disables the feature.

PR: kern/16573
Approved by: jkh

Revision 1.139.2.11: download - view: text, markup, annotated - select for diffs
Mon Jan 24 21:11:40 2000 UTC (12 years ago) by dillon
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE
Diff to: previous 1.139.2.10: preferred, colored; branchpoint 1.139: preferred, colored; next MAIN 1.140: preferred, colored
Changes since revision 1.139.2.10: +30 -26 lines
    MFC vm_map.c 1.185, fix deadlock between msync() and vm_fault().

Reviewed by:	 Paul Saab <ps@yahoo-inc.com>

Revision 1.185: download - view: text, markup, annotated - select for diffs
Fri Jan 21 20:17:01 2000 UTC (12 years ago) by dillon
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +30 -26 lines
    Fix a deadlock between msync(..., MS_INVALIDATE) and vm_fault.  The
    invalidation code cannot wait for paging to complete while holding a
    vnode lock, so we don't wait.  Instead we simply allow the lower level
    code to simply block on any busy pages it encounters.  I think Yahoo
    may be the only entity in the entire world that actually uses this
    msync feature :-).

Bug reported by:  Paul Saab <paul@mu.org>

Revision 1.184: download - view: text, markup, annotated - select for diffs
Sun Dec 12 03:19:28 1999 UTC (12 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +16 -3 lines
    Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC to
    madvise().

    This feature prevents the update daemon from gratuitously flushing
    dirty pages associated with a mapped file-backed region of memory.  The
    system pager will still page the memory as necessary and the VM system
    will still be fully coherent with the filesystem.  Modifications made
    by other means to the same area of memory, for example by write(), are
    unaffected.  The feature works on a page-granularity basis.

    MAP_NOSYNC allows one to use mmap() to share memory between processes
    without incuring any significant filesystem overhead, putting it in
    the same performance category as SysV Shared memory and anonymous memory.

Reviewed by: julian, alc, dg

Revision 1.183: download - view: text, markup, annotated - select for diffs
Thu Nov 25 20:21:52 1999 UTC (12 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +1 -4 lines
Remove nonsensical vm_map_{clear,set}_recursive() calls
from vm_map_pageable().  At the point they called, vm_map_pageable()
holds a read (or shared) lock on the map.  The purpose
of vm_map_{clear,set}_recursive() is to disable/enable repeated
write (or exclusive) lock requests by the same process.

Revision 1.182: download - view: text, markup, annotated - select for diffs
Tue Nov 23 06:51:28 1999 UTC (12 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +6 -5 lines
Correct the following error: vm_map_pageable() on a COW'ed (post-fork)
 vm_map always failed because vm_map_lookup() looked at
 "vm_map_entry->wired_count" instead of "(vm_map_entry->eflags &
 MAP_ENTRY_USER_WIRED)".  The effect was that many page
 wiring operations by sysctl were (silently) failing.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Sun Nov 7 20:03:53 1999 UTC (12 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +1 -2 lines
Remove unused #include's.

Submitted by:	phk

Revision 1.180: download - view: text, markup, annotated - select for diffs
Sun Nov 7 06:46:48 1999 UTC (12 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +1 -2 lines
The functions declared by this header file no longer exist.

Submitted by:	phk (in part)

Revision 1.179: download - view: text, markup, annotated - select for diffs
Fri Oct 29 18:09:30 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +1 -3 lines
useracc() the prequel:

Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Sep 21 05:00:48 1999 UTC (12 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +73 -49 lines
    cleanup madvise code, add a few more sanity checks.

Reviewed by:	Alan Cox <alc@cs.rice.edu>,  dg@root.com

Revision 1.22.4.6: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:39:09 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.22.4.5: preferred, colored; branchpoint 1.22: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22.4.5: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.57.2.8: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:24:28 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.57.2.7: preferred, colored; branchpoint 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57.2.7: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.139.2.10: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:33:33 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.139.2.9: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.9: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.177: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:52:38 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.176: download - view: text, markup, annotated - select for diffs
Fri Aug 13 17:45:34 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +86 -61 lines
vm_map_madvise:
	A complete rewrite by dillon and myself to separate
	the implementation of behaviors that effect the vm_map_entry
	from those that effect the vm_object.

	A result of this change is that madvise(..., MADV_FREE);
	is much cheaper.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Tue Aug 10 04:50:20 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +3 -17 lines
vm_map_madvise:
	Now that behaviors are stored in the vm_map_entry rather than
	the vm_object, it's no longer necessary to instantiate a vm_object
	just to hold the behavior.

Reviewed by:	dillon

Revision 1.174: download - view: text, markup, annotated - select for diffs
Sun Aug 1 06:05:08 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +7 -7 lines
Move the memory access behavior information provided by madvise
from the vm_object to the vm_map.

Submitted by:	dillon

Revision 1.139.2.9: download - view: text, markup, annotated - select for diffs
Wed Jul 28 07:40:01 1999 UTC (12 years, 6 months ago) by alc
Branches: RELENG_3
Diff to: previous 1.139.2.8: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.8: +3 -1 lines
MFC: Fix a race condition between pmap_growkernel and
process creation.
 [pmap.h: rev 1.31, vm_glue.c: rev 1.87, vm_map.c: rev 1.173]

Hide access to vmspace::vm_pmap behind inline function vmspace_pmap.
(This function is assumed by the above patch.)
 [vm_map.h: rev 1.36]

Revision 1.173: download - view: text, markup, annotated - select for diffs
Wed Jul 21 18:02:27 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +3 -1 lines
Fix the following problem:

When creating new processes (or performing exec), the new page
directory is initialized too early.  The kernel might grow before
p_vmspace is initialized for the new process.  Since pmap_growkernel
doesn't yet know about the new page directory, it isn't updated, and
subsequent use causes a failure.

The fix is (1) to clear p_vmspace early, to stop pmap_growkernel
from stomping on memory, and (2) to defer part of the initialization
of new page directories until p_vmspace is initialized.

PR:		kern/12378
Submitted by:	tegge
Reviewed by:	dfr

Revision 1.172: download - view: text, markup, annotated - select for diffs
Sun Jul 11 18:30:31 1999 UTC (12 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +1 -13 lines
Cleanup OBJ_ONEMAPPING management.

vm_map.c:
	Don't set OBJ_ONEMAPPING on arbitrary vm objects.  Only default
	and swap type vm objects should have it set.  vm_object_deallocate
	already handles these cases.

vm_object.c:
	If OBJ_ONEMAPPING isn't already clear in vm_object_shadow,
	we are in trouble.  Instead of clearing it, make it
	an assertion that it is already clear.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Thu Jul 1 19:53:41 1999 UTC (12 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +2 -2 lines
Fix some int/long printf problems for the Alpha

Revision 1.139.2.8: download - view: text, markup, annotated - select for diffs
Sun Jun 20 19:17:16 1999 UTC (12 years, 7 months ago) by alc
Branches: RELENG_3
Diff to: previous 1.139.2.7: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.7: +208 -204 lines
MFC: [rev 1.168, 1.169, and 1.170] Fix two panics and an accounting error
 in the growable stack code.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Thu Jun 17 21:29:38 1999 UTC (12 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +6 -6 lines
vm_map_growstack uses vmspace::vm_ssize as though it contained
the stack size in bytes when in fact it is the stack size in pages.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Thu Jun 17 05:49:00 1999 UTC (12 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +7 -3 lines
vm_map_insert sometimes extends an existing vm_map entry, rather than
creating a new entry.  vm_map_stack and vm_map_growstack can panic when
a new entry isn't created.  Fixed vm_map_stack and vm_map_growstack.

Also, when extending the stack, always set the protection to VM_PROT_ALL.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Thu Jun 17 00:39:26 1999 UTC (12 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +204 -204 lines
Move vm_map_stack and vm_map_growstack after the definition
of the vm_map_clip_end macro.  (The next commit will modify
vm_map_stack and vm_map_growstack to use vm_map_clip_end.)

Revision 1.167: download - view: text, markup, annotated - select for diffs
Thu Jun 17 00:27:39 1999 UTC (12 years, 7 months ago) by alc
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +2 -6 lines
Remove some unused declarations and duplicate initialization.

Revision 1.139.2.7: download - view: text, markup, annotated - select for diffs
Sun Jun 13 04:06:41 1999 UTC (12 years, 8 months ago) by alc
Branches: RELENG_3
Diff to: previous 1.139.2.6: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.6: +2 -2 lines
MFC: rev 1.166
	The wrong vm_map_entry is used in vm_map_protect to determine
	if writes must not be allowed due to COW.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Sat Jun 12 23:10:38 1999 UTC (12 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +2 -2 lines
vm_map_protect:
	The wrong vm_map_entry is used to determine if writes must not be
	allowed due to COW.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Fri May 28 03:39:43 1999 UTC (12 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +9 -3 lines
Avoid the creation of unnecessary shadow objects.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Tue May 18 05:38:48 1999 UTC (12 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +38 -47 lines
vm_map_insert:
	General cleanup.  Eliminate coalescing checks that are duplicated
	by vm_object_coalesce.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Mon May 17 00:53:53 1999 UTC (12 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +6 -1 lines
Add the options MAP_PREFAULT and MAP_PREFAULT_PARTIAL to vm_map_find/insert,
eliminating the need for the pmap_object_init_pt calls in imgact_* and
mmap.

Reviewed by:	David Greenman <dg@root.com>

Revision 1.162: download - view: text, markup, annotated - select for diffs
Sun May 16 05:07:31 1999 UTC (12 years, 8 months ago) by alc
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +4 -7 lines
Remove prototypes for functions that don't exist anymore (vm_map.h).

Remove a useless argument from vm_map_madvise's interface (vm_map.c,
	vm_map.h, and vm_mmap.c).

Remove a redundant test in vm_uiomove (vm_map.c).

Make two changes to vm_object_coalesce:

1. Determine whether the new range of pages actually overlaps
the existing object's range of pages before calling vm_object_page_remove.
(Prior to this change almost 90% of the calls to vm_object_page_remove
were to remove pages that were beyond the end of the object.)

2. Free any swap space allocated to removed pages.

Revision 1.161: download - view: text, markup, annotated - select for diffs
Fri May 14 23:09:32 1999 UTC (12 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +3 -5 lines
Simplify vm_map_find/insert's interface: remove the MAP_COPY_NEEDED option.

It never makes sense to specify MAP_COPY_NEEDED without also specifying
MAP_COPY_ON_WRITE, and vice versa.  Thus, MAP_COPY_ON_WRITE suffices.

Reviewed by:	David Greenman <dg@root.com>

Revision 1.139.2.6: download - view: text, markup, annotated - select for diffs
Sun May 9 23:22:18 1999 UTC (12 years, 9 months ago) by alc
Branches: RELENG_3
CVS tags: RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE
Diff to: previous 1.139.2.5: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.5: +15 -27 lines
MFC:
	Two OBJ_ONEMAPPING maintenance changes:  1. Fix a non-fatal bug
	in vm_map_insert (from 1.149).  2. Remove pointless maintenance
	in vm_map_remove (from 1.160).

	Remove pointless comparisons from vm_map_simplify_entry (from
	1.146).

	Remove an incorrect comment (from 1.159) and
	an unused variable (from 1.155).

Revision 1.160: download - view: text, markup, annotated - select for diffs
Sun Apr 4 07:11:02 1999 UTC (12 years, 10 months ago) by alc
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, PRE_SMP_VMSHARE, PRE_NEWBUS, POST_VFS_BIO_NFS_PATCH, POST_SMP_VMSHARE, POST_NEWBUS
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +10 -13 lines
Two changes to vm_map_delete:

1. Don't bother checking object->ref_count == 1 in order to set
OBJ_ONEMAPPING.  It's a waste of time.  If object->ref_count == 1,
vm_map_entry_delete will "run-down" the object and its pages.

2. If object->ref_count == 1, ignore OBJ_ONEMAPPING.  Wait for
vm_map_entry_delete to "run-down" the object and its pages.
Otherwise, we're calling two different procedures to delete
the object's pages.

Note: "vmstat -s" will once again show a non-zero value
for "pages freed by exiting processes".

Revision 1.159: download - view: text, markup, annotated - select for diffs
Sat Mar 27 23:46:04 1999 UTC (12 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +7 -33 lines
Mainly, eliminate the comments about share maps.  (We don't have share maps
any more.)  Also, eliminate an incorrect comment that says that we don't
coalesce vm_map_entry's.  (We do.)

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sun Mar 21 23:37:00 1999 UTC (12 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +24 -19 lines
Two changes:

Remove more (redundant) map timestamp increments from properly
synchronized routines.  (Changed: vm_map_entry_link, vm_map_entry_unlink,
and vm_map_pageable.)

Micro-optimize vm_map_entry_link and vm_map_entry_unlink, eliminating
unnecessary dereferences.  At the same time, converted them from macros
to inline functions.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Mar 15 06:24:52 1999 UTC (12 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +5 -10 lines
Two changes:

In general, vm_map_simplify_entry should be performed INSIDE
the loop that traverses the map, not outside.  (Changed:
vm_map_inherit, vm_map_pageable.)

vm_fault_unwire doesn't acquire the map lock (or block holding
it).  Thus, vm_map_set/clear_recursive shouldn't be called.
(Changed: vm_map_user_pageable, vm_map_pageable.)

Revision 1.139.2.5: download - view: text, markup, annotated - select for diffs
Thu Mar 11 05:56:49 1999 UTC (12 years, 11 months ago) by alc
Branches: RELENG_3
Diff to: previous 1.139.2.4: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.4: +17 -11 lines
MFC:

Change vm_map_growstack to acquire and hold a read lock (instead of a write
lock) until it actually needs to modify the vm_map.

Upgrading a map's lock to exclusive status should increment
the map's timestamp.  In general, whenever an exclusive lock is
acquired the timestamp should be incremented.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Tue Mar 9 08:00:17 1999 UTC (12 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +1 -6 lines
Remove (redundant) map timestamp increments from some properly
synchronized routines.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Mon Mar 8 03:53:07 1999 UTC (12 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +1 -3 lines
Remove an unused variable from vmspace_fork.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Sun Mar 7 21:25:42 1999 UTC (12 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +17 -11 lines
Change vm_map_growstack to acquire and hold a read lock (instead of a write
lock) until it actually needs to modify the vm_map.

Note: it is legal to modify vm_map::hint without holding a write lock.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com> with minor changes
		by myself.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Tue Mar 2 05:43:17 1999 UTC (12 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +9 -13 lines
Remove the last of the share map code: struct vm_map::is_main_map.

Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>

Revision 1.152: download - view: text, markup, annotated - select for diffs
Wed Feb 24 21:26:25 1999 UTC (12 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +4 -2 lines
    Remove unnecessary page protects on map_split and collapse operations.
    Fix bug where an object's OBJ_WRITEABLE/OBJ_MIGHTBEDIRTY flags do
    not get set under certain circumstances ( page rename case ).

Reviewed by:	Alan Cox <alc@cs.rice.edu>, John Dyson

Revision 1.151: download - view: text, markup, annotated - select for diffs
Fri Feb 19 14:25:36 1999 UTC (12 years, 11 months ago) by luoqi
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +6 -6 lines
Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This
is the preparation step for moving pmap storage out of vmspace proper.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		Matthew Dillion	<dillon@apollo.backplane.com>

Revision 1.150: download - view: text, markup, annotated - select for diffs
Fri Feb 19 03:11:37 1999 UTC (12 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +8 -57 lines
Submitted by:	Alan Cox <alc@cs.rice.edu>

    Remove remaining share map garbage from vm_map_lookup() and clean out
    old #if 0 stuff.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Fri Feb 12 09:51:42 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +37 -42 lines
    Fix non-fatal bug in vm_map_insert() which improperly cleared
    OBJ_ONEMAPPING in the case where an object is extended by an
    additional vm_map_entry must be allocated.

    In vm_object_madvise(), remove calll to vm_page_cache() in MADV_FREE
    case in order to avoid a page fault on page reuse.  However, we still
    mark the page as clean and destroy any swap backing store.

Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.148: download - view: text, markup, annotated - select for diffs
Sun Feb 7 21:48:22 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +25 -90 lines
    Remove MAP_ENTRY_IS_A_MAP 'share' maps.  These maps were once used to
    attempt to optimize forks but were essentially given-up on due to
    problems and replaced with an explicit dup of the vm_map_entry structure.
    Prior to the removal, they were entirely unused.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Wed Feb 3 01:57:16 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +8 -7 lines
Submitted by:	Alan Cox

    The vm_map_insert()/vm_object_coalesce() optimization has been extended
    to include OBJT_SWAP objects as well as OBJT_DEFAULT objects.  This is
    possible because it costs nothing to extend an OBJT_SWAP object with
    the new swapper.  We can't do this with the old swapper.  The old swapper
    used a linear array that would have had to have been reallocated, costing
    time as well as a potential low-memory deadlock.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon Feb 1 08:49:30 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +1 -5 lines
    This patch eliminates a pointless test from appearing twice
    in vm_map_simplify_entry.  Basically, once you've verified that
    the objects in the adjacent vm_map_entry's are the same, either
    NULL or the same vm_object, there's no point in checking that the
    objects have the same behavior.

Obtained from:  Alan Cox <alc@cs.rice.edu>

Revision 1.139.2.4: download - view: text, markup, annotated - select for diffs
Sun Jan 31 14:12:13 1999 UTC (13 years ago) by julian
Branches: RELENG_3
CVS tags: RELENG_3_1_0_RELEASE
Diff to: previous 1.139.2.3: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.3: +4 -3 lines
MFC: fix inconsistancy in accounting for stack sizes.
matches 1.144->1.145

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sun Jan 31 14:09:25 1999 UTC (13 years ago) by julian
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +4 -3 lines
Submitted by: Alan Cox <alc@cs.rice.edu>
Checked by: "Richard Seaman, Jr." <dick@tar.com>
Fix the following problem:
As the code stands now, growing any stack, and not just the process's
main stack, modifies vm->vm_ssize.  This is inconsistent with the code
earlier in the same procedure.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Thu Jan 28 00:57:57 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +4 -4 lines
    Fix warnings in preparation for adding -Wall -Wcast-qual to the
    kernel compile

Revision 1.139.2.3: download - view: text, markup, annotated - select for diffs
Wed Jan 27 20:51:44 1999 UTC (13 years ago) by julian
Branches: RELENG_3
Diff to: previous 1.139.2.2: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.2: +1 -7 lines
MFC: Linux threads support is now default, to match -current
	Recompile the usual suspects!

Revision 1.143: download - view: text, markup, annotated - select for diffs
Tue Jan 26 02:49:52 1999 UTC (13 years ago) by julian
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +1 -7 lines
Mostly remove the VM_STACK OPTION.
This changes the definitions of a few items so that structures are the
same whether or not the option itself is enabled. This allows
people to enable and disable the option without recompilng the world.

As the author says:

|I ran into a problem pulling out the VM_STACK option.  I was aware of this
|when I first did the work, but then forgot about it.  The VM_STACK stuff
|has some code changes in the i386 branch.  There need to be corresponding
|changes in the alpha branch before it can come out completely.

what is done:
|
|1) Pull the VM_STACK option out of the header files it appears in.  This
|really shouldn't affect anything that executes with or without the rest
|of the VM_STACK patches.  The vm_map_entry will then always have one
|extra element (avail_ssize).  It just won't be used if the VM_STACK
|option is not turned on.
|
|I've also pulled the option out of vm_map.c.  This shouldn't harm anything,
|since the routines that are enabled as a result are not called unless
|the VM_STACK option is enabled elsewhere.
|
|2) Add what appears to be appropriate code the the alpha branch, still
|protected behind the VM_STACK switch.  I don't have an alpha machine,
|so we would need to get some testers with alpha machines to try it out.
|
|Once there is some testing, we can consider making the change permanent
|for both i386 and alpha.
|
[..]
|
|Once the alpha code is adequately tested, we can pull VM_STACK out
|everywhere.
|

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>

Revision 1.139.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 24 06:20:12 1999 UTC (13 years ago) by dillon
Branches: RELENG_3
Diff to: previous 1.139.2.1: preferred, colored; branchpoint 1.139: preferred, colored
Changes since revision 1.139.2.1: +7 -1 lines
    Backport to -3.x from -4.x - do not leave dirty pages in PQ_CACHE.
    If we dirty a PQ_CACHE page, we have to [de]activate it as well.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sun Jan 24 06:04:52 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +3 -5 lines
    Change all manual settings of vm_page_t->dirty = VM_PAGE_BITS_ALL
    to use the vm_page_dirty() inline.

    The inline can thus do sanity checks ( or not ) over all cases.

Revision 1.139.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 22 05:53:39 1999 UTC (13 years ago) by dillon
Branches: RELENG_3
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +7 -3 lines
    Backport from -4.x

    PG_BUSY was being tested without splvm() protection.  We have to test
    it again with splvm() protection before we can actually sleep.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Thu Jan 21 09:40:48 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: POST_MATT_SWAPPER
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +1 -1 lines
    General cleanup related to the new pager.  We no longer have to worry
    about conversions of objects to OBJT_SWAP, it is done automatically
    now.

    Replaced manually inserted code with inline calls for busy waiting on
    pages, which also incidently fixes a potential PG_BUSY race due to
    the code not running at splvm().

    vm_objects no longer have a paging_offset field ( see vm/vm_object.c )

Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Jan 21 08:29:10 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +41 -10 lines
    This is a rather large commit that encompasses the new swapper,
    changes to the VM system to support the new swapper, VM bug
    fixes, several VM optimizations, and some additional revamping of the
    VM code.  The specific bug fixes will be documented with additional
    forced commits.  This commit is somewhat rough in regards to code
    cleanup issues.

Reviewed by:	"John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:05:41 1999 UTC (13 years, 1 month ago) by julian
Branches: MAIN
CVS tags: RELENG_3_BP, PRE_MATT_SWAPPER
Branch point for: RELENG_3
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +206 -1 lines
Add (but don't activate) code for a special VM option to make
downward growing stacks more general.
Add (but don't activate) code to use the new stack facility
when running threads, (specifically the linux threads support).
This allows people to use both linux compiled linuxthreads, and also the
native FreeBSD linux-threads port.

The code is conditional on VM_STACK. Not using this will
produce the old heavily tested system.

Submitted by: Richard Seaman <dick@tar.com>

Revision 1.138: download - view: text, markup, annotated - select for diffs
Sun Oct 25 17:44:58 1998 UTC (13 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +4 -8 lines
Nitpicking and dusting performed on a train.  Removes trivial warnings
about unused variables, labels and other lint.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Tue Oct 13 08:24:43 1998 UTC (13 years, 4 months ago) by dg
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +2 -2 lines
Fixed two potentially serious classes of bugs:

1) The vnode pager wasn't properly tracking the file size due to
   "size" being page rounded in some cases and not in others.
   This sometimes resulted in corrupted files. First noticed by
   Terry Lambert.
   Fixed by changing the "size" pager_alloc parameter to be a 64bit
   byte value (as opposed to a 32bit page index) and changing the
   pagers and their callers to deal with this properly.
2) Fixed a bogus type cast in round_page() and trunc_page() that
   caused some 64bit offsets and sizes to be scrambled. Removing
   the cast required adding casts at a few dozen callers.
   There may be problems with other bogus casts in close-by
   macros. A quick check seemed to indicate that those were okay,
   however.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Thu Oct 1 20:46:41 1998 UTC (13 years, 4 months ago) by jdp
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +2 -2 lines
Fix a bug in which a page index was used where a byte offset was
expected.  This bug caused builds of Modula-3 to fail in mysterious
ways on SMP kernels.  More precisely, such builds failed on systems
with kern.fast_vfork equal to 0, the default and only supported
value for SMP kernels.

PR:		kern/7468
Submitted by:	tegge (Tor Egge)

Revision 1.57.2.7: download - view: text, markup, annotated - select for diffs
Tue Sep 22 05:00:48 1998 UTC (13 years, 4 months ago) by jdp
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE
Diff to: previous 1.57.2.6: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.6: +3 -2 lines
MFC 1.89 -> 1.90: Do not consider VM_PROT_OVERRIDE_WRITE to be part
of the protection entry when handling a fault.  My recent procfs
merge for the "GDB touches executables" problem requires this fix
as well.

Revision 1.57.2.6: download - view: text, markup, annotated - select for diffs
Tue Sep 22 01:30:54 1998 UTC (13 years, 4 months ago) by jdp
Branches: RELENG_2_2
Diff to: previous 1.57.2.5: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.5: +11 -3 lines
Merge in the fix for the "GDB touches executables" problem.  The
following revisions are included in this merge:

  1.89      src/sys/i386/i386/trap.c
  1.24,1.25 src/sys/miscfs/procfs/procfs_mem.c
  1.32      src/sys/vm/vm_extern.h
  1.67      src/sys/vm/vm_fault.c
  1.73      src/sys/vm/vm_map.c
  1.25      src/sys/vm/vm_map.h
  1.8       src/sys/vm/vm_prot.h

PR:		kern/3475, kern/7858

Revision 1.135: download - view: text, markup, annotated - select for diffs
Fri Sep 4 08:06:57 1998 UTC (13 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +7 -7 lines
Cosmetic changes to the PAGE_XXX macros to make them consistent with
the other objects in vm.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Mon Aug 24 08:39:37 1998 UTC (13 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +20 -18 lines
Change various syscalls to use size_t arguments instead of u_int.

Add some overflow checks to read/write (from bde).

Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags
and vm_object::paging_in_progress to use operations which are not
interruptable.

Reviewed by: Bruce Evans <bde@zeta.org.au>

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Aug 6 08:33:19 1998 UTC (13 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +3 -3 lines
Protect all modifications to paging_in_progress with splvm().  The i386
managed to avoid corruption of this variable by luck (the compiler used a
memory read-modify-write instruction which wasn't interruptable) but other
architectures cannot.

With this change, I am now able to 'make buildworld' on the alpha (sfx: the
crowd goes wild...)

Revision 1.132: download - view: text, markup, annotated - select for diffs
Tue Jul 14 12:14:58 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +17 -14 lines
Print pointers using %p instead of attempting to print them by
casting them to long, etc.  Fixed some nearby printf bogons (sign
errors not warned about by gcc, and style bugs, but not truncation
of vm_ooffset_t's).

Use slightly less bogus casts for passing pointers to ddb command
functions.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Sat Jul 11 11:30:43 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +3 -3 lines
Fixed printf format errors.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Jul 11 07:46:12 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +4 -3 lines
Fixed printf format errors.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Sun Jun 21 14:53:43 1998 UTC (13 years, 7 months ago) by bde
Branches: MAIN
CVS tags: PRE_NOBDEV
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +1 -3 lines
Removed unused includes.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Sun Jun 7 17:13:10 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +14 -14 lines
This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Thu May 21 07:47:55 1998 UTC (13 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +7 -5 lines
Make flushing dirty pages work correctly on filesystems that
unexpectedly do not complete writes even with sync I/O requests.
This should help the behavior of mmaped files when using
softupdates (and perhaps in other circumstances also.)

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sat May 16 23:03:20 1998 UTC (13 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +15 -2 lines
An important fix for proper inheritance of backing objects for
object splits.  Another excellent detective job by Tor.
Submitted by:	Tor Egge <Tor.Egge@idi.ntnu.no>

Revision 1.125: download - view: text, markup, annotated - select for diffs
Mon May 4 17:12:52 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -3 lines
Fix the shm panic.  I mistakenly used the shadow_count to keep the object
from being split, and instead added an OBJ_NOSPLIT.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Mon May 4 03:01:44 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +25 -15 lines
Work around some VM bugs, the worst being an overly aggressive
swap space free calculation.  More complete fixes will be forthcoming,
in a week.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sat May 2 06:36:16 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +15 -2 lines
Another minor cleanup of the split code.  Make sure that pages are
busied during the entire time, so that the waits for pages being
unbusy don't make the objects inconsistant.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Fri May 1 02:25:29 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +2 -1 lines
Fix minor bug with new over used swap fix.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Apr 29 06:59:08 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +4 -1 lines
Add a needed prototype, and fix a panic problem with the new
memory code.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Wed Apr 29 04:28:04 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +185 -110 lines
Tighten up management of memory and swap space during map allocation,
deallocation cycles.  This should provide a measurable improvement
on swap and memory allocation on loaded systems.  It is unlikely a
complete solution.  Also, provide more map info with procfs.
Chuck Cranor spurred on this improvement.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Apr 28 05:54:47 1998 UTC (13 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +35 -14 lines
Fix a pseudo-swap leak problem.  This mitigates "leaks" due to
freeing partial objects, not freeing entire objects didn't
free any of it.  Simple fix to the map code.
Reviewed by:	dg

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Mar 7 21:36:58 1998 UTC (13 years, 11 months ago) by dyson
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, PRE_DEVFS_SLICE, POST_SOFTUPDATE, POST_DEVFS_SLICE
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +6 -3 lines
This mega-commit is meant to fix numerous interrelated problems.  There
has been some bitrot and incorrect assumptions in the vfs_bio code.  These
problems have manifest themselves worse on NFS type filesystems, but can
still affect local filesystems under certain circumstances.  Most of
the problems have involved mmap consistancy, and as a side-effect broke
the vfs.ioopt code.  This code might have been committed seperately, but
almost everything is interrelated.

1)	Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that
	are fully valid.
2)	Rather than deactivating erroneously read initial (header) pages in
	kern_exec, we now free them.
3)	Fix the rundown of non-VMIO buffers that are in an inconsistent
	(missing vp) state.
4)	Fix the disassociation of pages from buffers in brelse.  The previous
	code had rotted and was faulty in a couple of important circumstances.
5)	Remove a gratuitious buffer wakeup in vfs_vmio_release.
6)	Remove a crufty and currently unused cluster mechanism for VBLK
	files in vfs_bio_awrite.  When the code is functional, I'll add back
	a cleaner version.
7)	The page busy count wakeups assocated with the buffer cache usage were
	incorrectly cleaned up in a previous commit by me.  Revert to the
	original, correct version, but with a cleaner implementation.
8)	The cluster read code now tries to keep data associated with buffers
	more aggressively (without breaking the heuristics) when it is presumed
	that the read data (buffers) will be soon needed.
9)	Change to filesystem lockmgr locks so that they use LK_NOPAUSE.  The
	delay loop waiting is not useful for filesystem locks, due to the
	length of the time intervals.
10)	Correct and clean-up spec_getpages.
11)	Implement a fully functional nfs_getpages, nfs_putpages.
12)	Fix nfs_write so that modifications are coherent with the NFS data on
	the server disk (at least as well as NFS seems to allow.)
13)	Properly support MS_INVALIDATE on NFS.
14)	Properly pass down MS_INVALIDATE to lower levels of the VM code from
	vm_map_clean.
15)	Better support the notion of pages being busy but valid, so that
	fewer in-transit waits occur.  (use p->busy more for pageouts instead
	of PG_BUSY.)  Since the page is fully valid, it is still usable for
	reads.
16)	It is possible (in error) for cached pages to be busy.  Make the
	page allocation code handle that case correctly.  (It should probably
	be a printf or panic, but I want the system to handle coding errors
	robustly.  I'll probably add a printf.)
17)	Correct the design and usage of vm_page_sleep.  It didn't handle
	consistancy problems very well, so make the design a little less
	lofty.  After vm_page_sleep, if it ever blocked, it is still important
	to relookup the page (if the object generation count changed), and
	verify it's status (always.)
18)	In vm_pageout.c, vm_pageout_clean had rotted, so clean that up.
19)	Push the page busy for writes and VM_PROT_READ into vm_pageout_flush.
20)	Fix vm_pager_put_pages and it's descendents to support an int flag
	instead of a boolean, so that we can pass down the invalidate bit.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Wed Feb 25 03:55:49 1998 UTC (13 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -7 lines
Fix page prezeroing for SMP, and fix some potential paging-in-progress
hangs.  The paging-in-progress diagnosis was a result of Tor Egge's
excellent detective work.
Submitted by:	Partially from Tor Egge.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Mon Feb 23 08:22:33 1998 UTC (13 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +2 -2 lines
Significantly improve the efficiency of the swap pager, which appears to
have declined due to code-rot over time.  The swap pager rundown code
has been clean-up, and unneeded wakeups removed.  Lots of splbio's
are changed to splvm's.  Also, set the dynamic tunables for the
pageout daemon to be more sane for larger systems (thereby decreasing
the daemon overheadla.)

Revision 1.115: download - view: text, markup, annotated - select for diffs
Fri Feb 20 13:11:54 1998 UTC (13 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +1 -2 lines
Removed unused #includes.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Mon Feb 9 06:11:26 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +4 -4 lines
Staticize.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Feb 8 14:55:13 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +2 -2 lines
Fix an argument to vn_lock.  It appears that alot of the vn_lock usage
is a bit undisciplined, and should be checked carefully.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:14:24 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +1 -3 lines
Back out DIAGNOSTIC changes.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Thu Feb 5 03:32:41 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +11 -65 lines
1)	Start using a cleaner and more consistant page allocator instead
	of the various ad-hoc schemes.
2)	When bringing in UPAGES, the pmap code needs to do another vm_page_lookup.
3)	When appropriate, set the PG_A or PG_M bits a-priori to both avoid some
	processor errata, and to minimize redundant processor updating of page
	tables.
4)	Modify pmap_protect so that it can only remove permissions (as it
	originally supported.)  The additional capability is not needed.
5)	Streamline read-only to read-write page mappings.
6)	For pmap_copy_page, don't enable write mapping for source page.
7)	Correct and clean-up pmap_incore.
8)	Cluster initial kern_exec pagin.
9)	Removal of some minor lint from kern_malloc.
10)	Correct some ioopt code.
11)	Remove some dead code from the MI swapout routine.
12)	Correct vm_object_deallocate (to remove backing_object ref.)
13)	Fix dead object handling, that had problems under heavy memory load.
14)	Add minor vm_page_lookup improvements.
15)	Some pages are not in objects, and make sure that the vm_page.c can
	properly support such pages.
16)	Add some more page deficit handling.
17)	Some minor code readability improvements.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:33:47 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -1 lines
Turn DIAGNOSTIC into a new-style option.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sat Jan 31 11:56:38 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +5 -3 lines
Change the busy page mgmt, so that when pages are freed, they
MUST be PG_BUSY.  It is bogus to free a page that isn't busy,
because it is in a state of being "unavailable" when being
freed.  The additional advantage is that the page_remove code
has a better cross-check that the page should be busy and
unavailable for other use.  There were some minor problems
with the collapse code, and this plugs those subtile "holes."

Also, the vfs_bio code wasn't checking correctly for PG_BUSY
pages.  I am going to develop a more consistant scheme for
grabbing pages, busy or otherwise.  For now, we are stuck
with the current morass.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Jan 22 17:30:37 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +104 -179 lines
VM level code cleanups.

1)	Start using TSM.
	Struct procs continue to point to upages structure, after being freed.
	Struct vmspace continues to point to pte object and kva space for kstack.
	u_map is now superfluous.
2)	vm_map's don't need to be reference counted.  They always exist either
	in the kernel or in a vmspace.  The vmspaces are managed by reference
	counts.
3)	Remove the "wired" vm_map nonsense.
4)	No need to keep a cache of kernel stack kva's.
5)	Get rid of strange looking ++var, and change to var++.
6)	Change more data structures to use our "zone" allocator.  Added
	struct proc, struct vmspace and struct vnode.  This saves a significant
	amount of kva space and physical memory.  Additionally, this enables
	TSM for the zone managed memory.
7)	Keep ioopt disabled for now.
8)	Remove the now bogus "single use" map concept.
9)	Use generation counts or id's for data structures residing in TSM, where
	it allows us to avoid unneeded restart overhead during traversals, where
	blocking might occur.
10)	Account better for memory deficits, so the pageout daemon will be able
	to make enough memory available (experimental.)
11)	Fix some vnode locking problems. (From Tor, I think.)
12)	Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp.
	(experimental.)
13)	Significantly shrink, cleanup, and make slightly faster the vm_fault.c
	code.  Use generation counts, get rid of unneded collpase operations,
	and clean up the cluster code.
14)	Make vm_zone more suitable for TSM.

This commit is partially as a result of discussions and contributions from
other people, including DG, Tor Egge, PHK, and probably others that I
have forgotten to attribute (so let me know, if I forgot.)

This is not the infamous, final cleanup of the vnode stuff, but a necessary
step.  Vnode mgmt should be correct, but things might still change, and
there is still some missing stuff (like ioopt, and physical backing of
non-merged cache files, debugging of layering concepts.)

Revision 1.107: download - view: text, markup, annotated - select for diffs
Wed Jan 21 12:18:00 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +6 -4 lines
Allow gdb to work again.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Jan 17 09:16:51 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +121 -135 lines
Tie up some loose ends in vnode/object management.  Remove an unneeded
config option in pmap.  Fix a problem with faulting in pages.  Clean-up
some loose ends in swap pager memory management.

The system should be much more stable, but all subtile bugs aren't fixed yet.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Jan 12 01:44:31 1998 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +115 -39 lines
Fix some vnode management problems, and better mgmt of vnode free list.
Fix the UIO optimization code.
Fix an assumption in vm_map_insert regarding allocation of swap pagers.
Fix an spl problem in the collapse handling in vm_object_deallocate.
When pages are freed from vnode objects, and the criteria for putting
the associated vnode onto the free list is reached, either put the
vnode onto the list, or put it onto an interrupt safe version of the
list, for further transfer onto the actual free list.
Some minor syntax changes changing pre-decs, pre-incs to post versions.
Remove a bogus timeout (that I added for debugging) from vn_lock.

PHK will likely still have problems with the vnode list management, and
so do I, but it is better than it was.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Jan 6 05:25:58 1998 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +82 -32 lines
Make our v_usecount vnode reference count work identically to the
original BSD code.  The association between the vnode and the vm_object
no longer includes reference counts.  The major difference is that
vm_object's are no longer freed gratuitiously from the vnode, and so
once an object is created for the vnode, it will last as long as the
vnode does.

When a vnode object reference count is incremented, then the underlying
vnode reference count is incremented also.  The two "objects" are now
more intimately related, and so the interactions are now much less
complex.

When vnodes are now normally placed onto the free queue with an object still
attached.  The rundown of the object happens at vnode rundown time, and
happens with exactly the same filesystem semantics of the original VFS
code.  There is absolutely no need for vnode_pager_uncache and other
travesties like that anymore.

A side-effect of these changes is that SMP locking should be much simpler,
the I/O copyin/copyout optimizations work, NFS should be more ponderable,
and further work on layered filesystems should be less frustrating, because
of the totally coherent management of the vnode objects and vnodes.

Please be careful with your system while running this code, but I would
greatly appreciate feedback as soon a reasonably possible.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Mon Dec 29 01:03:34 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +1 -2 lines
Fix the decl of vfs_ioopt, allow LFS to compile again, fix a minor problem
with the object cache removal.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Mon Dec 29 00:24:43 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +9 -5 lines
Lots of improvements, including restructring the caching and management
of vnodes and objects.  There are some metadata performance improvements
that come along with this.  There are also a few prototypes added when
the need is noticed.  Changes include:

1) Cleaning up vref, vget.
2) Removal of the object cache.
3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore.
4) Correct some missing LK_RETRY's in vn_lock.
5) Correct the page range in the code for msync.

Be gentle, and please give me feedback asap.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Dec 25 20:55:15 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -2 lines
The ioopt code is still buggy, but wasn't fully disabled.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Dec 19 15:31:13 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +12 -13 lines
Change bogus usage of btoc to atop.  The incorrect usage of btoc was
pointed out by bde.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Dec 19 09:03:11 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +302 -12 lines
Some performance improvements, and code cleanups (including changing our
expensive OFF_TO_IDX to btoc whenever possible.)

Revision 1.98: download - view: text, markup, annotated - select for diffs
Mon Nov 24 15:03:13 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +2 -4 lines
Don't #define max() to get a version that works with vm_ooffset's.
Just use qmax().

This should be fixed more generally using overloaded functions.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri Nov 14 23:42:10 1997 UTC (14 years, 2 months ago) by tegge
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +18 -14 lines
Simplify map entries during user page wire and user page unwire operations in
vm_map_user_pageable().

Check return value of vm_map_lock_upgrade() during a user page wire operation.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri Nov 7 08:53:44 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +1 -3 lines
Remove a bunch of variables which were unused both in GENERIC and LINT.

Found by:	-Wunused

Revision 1.57.2.5: download - view: text, markup, annotated - select for diffs
Tue Nov 4 09:02:38 1997 UTC (14 years, 3 months ago) by dyson
Branches: RELENG_2_2
CVS tags: RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE
Diff to: previous 1.57.2.4: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.4: +40 -5 lines
Bring some fixes from -current into -stable.  A couple of them are
map optims from Alan Cox (alc@cs.rice.edu.)  Also, there is an incorrectly
handled panic and inefficient/improper map upgrade fixed.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue Oct 28 15:59:26 1997 UTC (14 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +1 -5 lines
Removed unused #includes.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Fri Oct 24 23:41:00 1997 UTC (14 years, 3 months ago) by dyson
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +4 -4 lines
Decrease the initial allocation for the zone allocations.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Oct 12 20:26:30 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
Last major round (Unless Bruce thinks of somthing :-) of malloc changes.

Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sat Oct 11 18:31:39 1997 UTC (14 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +3 -1 lines
Distribute and statizice a lot of the malloc M_* types.

Substantial input from:	bde

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sun Sep 21 04:24:20 1997 UTC (14 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +9 -4 lines
Change the M_NAMEI allocations to use the zone allocator.  This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Fri Sep 12 15:58:47 1997 UTC (14 years, 5 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +3 -2 lines
Do not consider VM_PROT_OVERRIDE_WRITE to be part of the protection
entry when handling a fault.  This is set by procfs whenever it wants
to write to a page, as a means of overriding `r-x COW' entries, but
causes failures in the `rwx' case.

Submitted by:	 bde

Revision 1.89: download - view: text, markup, annotated - select for diffs
Mon Sep 1 03:17:18 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +1 -3 lines
Removed unused #includes.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Aug 25 22:15:22 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +23 -46 lines
Fixed type mismatches for functions with args of type vm_prot_t and/or
vm_inherit_t.  These types are smaller than ints, so the prototypes
should have used the promoted type (int) to match the old-style function
definitions.  They use just vm_prot_t and/or vm_inherit_t.  This depends
on gcc features to work.  I fixed the definitions since this is easiest.
The correct fix may be to change the small types to u_int, to optimize
for time instead of space.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Mon Aug 18 03:29:21 1997 UTC (14 years, 5 months ago) by fsmp
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +5 -1 lines
Added includes of smp.h for SMP.
This eliminates a bazillion warnings about implicit s_lock & friends.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Mon Aug 18 02:06:22 1997 UTC (14 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +8 -13 lines
Fix kern_lock so that it will work.  Additionally, clean-up some of the
VM systems usage of the kernel lock (lockmgr) code.  This is a first
pass implementation, and is expected to evolve as needed.  The API
for the lock manager code has not changed, but the underlying implementation
has changed significantly.  This change should not materially affect
our current SMP or UP code without non-standard parameters being used.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Aug 6 04:58:03 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +3 -3 lines
Add exposure of some vm_zone allocation stats by sysctl.  Also, change
the initialization parameters of some zones in VM map.  This contains
only optimizations and not bugfixes.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Aug 5 23:03:23 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -1 lines
Fixed the commit botch that was causing crashes soon after system
startup.  Due to the error, the initialization of the zone for
pv_entries was missing.  The system should be usable again.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Tue Aug 5 22:24:28 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +9 -9 lines
Another attempt at cleaning up the new memory allocator.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Aug 5 22:07:27 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -4 lines
Fix some bugs, document vm_zone better.  Add copyright to vm_zone.h.  Use
the new zone code in pmap.c so that we can get rid of the ugly ad-hoc
allocations in pmap.c.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Aug 5 01:32:52 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +4 -3 lines
Modify pmap to use our new memory allocator.  Also, change the vm_map_entry
allocations to be interrupt safe.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Aug 5 00:01:56 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +33 -132 lines
Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu of
a simple, clean zone type allocator.  This new allocator will also be
used for machine dependent pmap PV entries.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Jul 27 04:44:12 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +48 -17 lines
Fix a very subtile problem that causes unnessary numbers of objects backing
a single logical object.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Jun 23 21:51:03 1997 UTC (14 years, 7 months ago) by tegge
Branches: MAIN
CVS tags: WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +3 -16 lines
Don't try upgrading an existing exclusive lock in vm_map_user_pageable.
This should close PR kern/3180.
Also remove a bogus unconditional call to vm_map_unlock_read in
vm_map_lookup.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sun Jun 15 23:33:52 1997 UTC (14 years, 7 months ago) by dyson
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +5 -1 lines
Fix a reference problem with maps.  Only appears to manifest itself when
sharing address spaces.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sun Apr 13 01:48:35 1997 UTC (14 years, 10 months ago) by dyson
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +53 -1 lines
Fully implement vfork.  Vfork is now much much faster than even our
	fork. (On my machine, fork is about 240usecs, vfork is 78usecs.)

Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory
	from the other threads of a group.

Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating
	possible existing shares with other threads/processes.

Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a
	thread from the rest of the group.

Fix the case where a thread does an exec.  It is almost nonsense for a thread
	to modify the other threads address space by an exec, so we
	now automatically divorce the address space before modifying it.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon Apr 7 07:16:05 1997 UTC (14 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +1 -4 lines
The biggie: Get rid of the UPAGES from the top of the per-process address
space. (!)

Have each process use the kernel stack and pcb in the kvm space.  Since
the stacks are at a different address, we cannot copy the stack at fork()
and allow the child to return up through the function call tree to return
to user mode - create a new execution context and have the new process
begin executing from cpu_switch() and go to user mode directly.
In theory this should speed up fork a bit.

Context switch the tss_esp0 pointer in the common tss.  This is a lot
simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer
to each process's tss since the esp0 pointer is a 32 bit pointer, and the
sd_base setting is split into three different bit sections at non-aligned
boundaries and requires a lot of twiddling to reset.

The 8K of memory at the top of the process space is now empty, and unmapped
(and unmappable, it's higher than VM_MAXUSER_ADDRESS).

Simplity the pmap code to manage process contexts, we no longer have to
double map the UPAGES, this simplifies and should measuably speed up fork().

The following parts came from John Dyson:

Set PG_G on the UPAGES that are now in kernel context, and invalidate
them when swapping them out.

Move the upages object (upobj) from the vmspace to the proc structure.

Now that the UPAGES (pcb and kernel stack) are out of user space, make
rfork(..RFMEM..) do what was intended by sharing the vmspace
entirely via reference counting rather than simply inheriting the mappings.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Sun Apr 6 03:04:31 1997 UTC (14 years, 10 months ago) by dyson
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +4 -2 lines
Make vm_map_protect be more complete about map simplification.  This
is useful when a process changes it's page range protections very
much.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.73: download - view: text, markup, annotated - select for diffs
Sun Apr 6 02:29:43 1997 UTC (14 years, 10 months ago) by dyson
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +11 -3 lines
Fix the gdb executable modify problem.  Thanks to the detective work
by Alan Cox <alc@cs.rice.edu>, and his description of the problem.

The bug was primarily in procfs_mem, but the mistake likely happened
due to the lack of vm system support for the operation.  I added
better support for selective marking of page dirty flags so that
vm_map_pageable(wiring) will not cause this problem again.

The code in procfs_mem is now less bogus (but maybe still a little
so.)

Revision 1.57.2.4: download - view: text, markup, annotated - select for diffs
Tue Mar 25 04:54:26 1997 UTC (14 years, 10 months ago) by dyson
Branches: RELENG_2_2
CVS tags: RELENG_2_2_5_RELEASE, RELENG_2_2_2_RELEASE, RELENG_2_2_1_RELEASE
Diff to: previous 1.57.2.3: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.3: +241 -172 lines
1.  Fix the vm_page_zero_count accounting.  This should improve the
    performance of the pre-zero loop.
2.  Fix madvise.  It had a myriad of bugs, including the potential
    for system crashes.
3.  Improve vm_map handling.  This is a result of work done by both
    <alc@cs.rice.edu> (Alan Cox) and me.  Earlier versions of the
    map handling code was very unintelligent about map coalescing.
4.  Support a working and closer to POSIX mlock.
5.  A couple of performance enhancements that came along for the ride,
    including changing certain bitfields to flags in vm_map.
6.  Bring procfs up to date with respect to the changes.

This code has been carefully extracted from -current.

Reviewed by:	David Greenman <dg@freebsd.org>

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:48:23 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Feb 10 02:22:22 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +38 -21 lines
This is the kernel Lite/2 commit.  There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>

Revision 1.57.2.3: download - view: text, markup, annotated - select for diffs
Fri Jan 31 04:17:20 1997 UTC (15 years ago) by dyson
Branches: RELENG_2_2
CVS tags: RELENG_2_2_0_RELEASE
Diff to: previous 1.57.2.2: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.2: +10 -2 lines
Move forward the inherit fix from copy on write segs from -current.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.70: download - view: text, markup, annotated - select for diffs
Fri Jan 31 04:10:41 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +9 -1 lines
Another fix to inheriting shared segments.  Do the copy on write
thing if needed.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.57.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 26 03:14:59 1997 UTC (15 years ago) by dyson
Branches: RELENG_2_2
Diff to: previous 1.57.2.1: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.1: +13 -2 lines
Move a missing object (panic fix) in vmspace_fork from -current
into 2.2.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Jan 22 01:34:48 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +28 -4 lines
Fix two problems where a NULL object is dereferenced.  One problem
was in the VM_INHERIT_SHARE case of vmspace_fork, and also in vm_map_madvise.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Jan 16 04:15:58 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +61 -82 lines
Change the map entry flags from bitfields to bitmasks.  Allows
for some code simplification.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:57:31 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Fri Jan 3 17:02:26 1997 UTC (15 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +1 -3 lines
Undo the collapse breakage (swap space usage problem.)

Revision 1.65: download - view: text, markup, annotated - select for diffs
Wed Jan 1 04:45:03 1997 UTC (15 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +2 -0 lines
Guess what?  We left alot of the old collapse code that is not needed
anymore with the "full" collapse fix that we added about 1yr ago!!!  The
code has been removed by optioning it out for now, so we can put it back
in ASAP if any problems are found.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Tue Dec 31 16:23:34 1996 UTC (15 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +38 -40 lines
A very significant improvement in the management of process maps
and objects.  Previously, "fancy" memory management techniques
such as that used by the M3 RTS would have the tendancy of chopping
up processes allocated memory into lots of little objects.  Alan
has come up with some improvements to migtigate the sitution to
the point where even the M3 RTS only has one object for bss and
it's managed memory (when running CVSUP.)  (There are still cases where the
situation isn't improved when the system pages -- but this is much much
better for the vast majority of cases.)  The system will now be able
to much more effectively merge map entries.

Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.63: download - view: text, markup, annotated - select for diffs
Sat Dec 28 23:07:48 1996 UTC (15 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +13 -76 lines
Eliminate the redundancy due to the similarity between the routines
vm_map_simplify and vm_map_simplify_entry.  Make vm_map_simplify_entry
handle wired maps so that we can get rid of vm_map_simplify.  Modify
the callers of vm_map_simplify to properly use vm_map_simplify_entry.
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.57.2.1: download - view: text, markup, annotated - select for diffs
Sun Dec 15 09:57:13 1996 UTC (15 years, 1 month ago) by davidg
Branches: RELENG_2_2
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +32 -14 lines
Merge from -current: vm_map_entry leak fix, John's vm_map coallesce fixes,
and changes for dynamically-sized buffers.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sat Dec 14 17:54:15 1996 UTC (15 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +132 -1 lines
Implement closer-to POSIX mlock semantics.  The major difference is
that we do allow mlock to span unallocated regions (of course, not
mlocking them.)  We also allow mlocking of RO regions (which the old
code couldn't.)  The restriction there is that once a RO region is
wired (mlocked), it cannot be debugged (or EVER written to.)

Under normal usage, the new mlock code will be a significant improvement
over our old stuff.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Dec 7 07:44:05 1996 UTC (15 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +4 -4 lines
Expunge inlines...

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Dec 7 06:19:37 1996 UTC (15 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +5 -3 lines
Fix a map entry leak problem found by DG.  Also, de-inline a function
vm_map_entry_dispose, because it won't help being inlined.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sat Dec 7 00:03:42 1996 UTC (15 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +27 -5 lines
Make vm_map_insert much more intelligent in the MAP_NOFAULT case so
that map entries are coalesced when appropriate.  Also, conditionalize
some code that is currently not used in vm_map_insert.  This mod
has been added to eliminate unnecessary map entries in buffer map.

Additionally, there were some cases where map coalescing could be done
when it shouldn't.  That problem has been resolved.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Nov 30 22:41:47 1996 UTC (15 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +6 -1 lines
Implement a new totally dynamic (up to MAXPHYS) buffer kva allocation
scheme.  Additionally, add the capability for checking for unexpected
kernel page faults.  The maximum amount of kva space for buffers hasn't
been decreased from where it is, but it will now be possible to do so.

This scheme manages the kva space similar to the buffers themselves.  If
there isn't enough kva space because of usage or fragementation, buffers
will be reclaimed until a buffer allocation is successful.  This scheme
should be very resistant to fragmentation problems until/if the LFS code
is fixed and uses the bogus buffer locking scheme -- but a 'fixed' LFS
is not likely to use such a scheme.

Now there should be NO problem allocating buffers up to MAXPHYS.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Sep 14 11:54:55 1996 UTC (15 years, 4 months ago) by bde
Branches: MAIN
CVS tags: RELENG_2_2_BP
Branch point for: RELENG_2_2
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +27 -25 lines
Attached vm ddb commands `show map', `show vmochk', `show object',
`show vmopag', `show page' and `show pageq'.  Moved all vm ddb stuff
to the ends of the vm source files.

Changed printf() to db_printf(), `indent' to db_indent, and iprintf()
to db_iprintf() in ddb commands.  Moved db_indent and db_iprintf()
from vm to ddb.

vm_page.c:
Don't use __pure.  Staticized.

db_output.c:
Reduced page width from 80 to 79 to inhibit double spacing for long
lines (there are still some problems if words are printed across
column 79).

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sun Sep 8 23:49:47 1996 UTC (15 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +4 -4 lines
Fixed the use of the wrong variable in vm_map_madvise.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Sep 8 16:57:53 1996 UTC (15 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +1 -2 lines
Improve the scalability of certain pmap operations.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Tue Jul 30 03:08:09 1996 UTC (15 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +68 -77 lines
Backed out the recent changes/enhancements to the VM code.  The
problem with the 'shell scripts' was found, but there was a 'strange'
problem found with a 486 laptop that we could not find.  This commit
backs the code back to 25-jul, and will be re-entered after the snapshot
in smaller (more easily tested) chunks.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Jul 27 03:23:56 1996 UTC (15 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +77 -68 lines
This commit is meant to solve a couple of VM system problems or
performance issues.

	1) The pmap module has had too many inlines, and so the
	   object file is simply bigger than it needs to be.
	   Some common code is also merged into subroutines.
	2) Removal of some *evil* PHYS_TO_VM_PAGE macro calls.
	   Unfortunately, a few have needed to be added also.
	   The removal caused the need for more vm_page_lookups.
	   I added lookup hints to minimize the need for the
	   page table lookup operations.
	3) Removal of some bogus performance improvements, that
	   mostly made the code more complex (tracking individual
	   page table page updates unnecessarily).  Those improvements
	   actually hurt 386 processors perf (not that people who
	   worry about perf use 386 processors anymore :-)).
	4) Changed pv queue manipulations/structures to be TAILQ's.
	5) The pv queue code has had some performance problems since
	   day one.  Some significant scalability issues are resolved
	   by threading the pv entries from the pmap AND the physical
	   address instead of just the physical address.  This makes
	   certain pmap operations run much faster.  This does
	   not affect most micro-benchmarks, but should help loaded system
	   performance *significantly*.  DG helped and came up with most
	   of the solution for this one.
	6) Most if not all pmap bit operations follow the pattern:
		pmap_test_bit();
		pmap_clear_bit();
	   That made for twice the necessary pv list traversal.   The
	   pmap interface now supports only pmap_tc_bit type operations:
	   pmap_[test/clear]_modified, pmap_[test/clear]_referenced.
	   Additionally, the modified routine now takes a vm_page_t arg
	   instead of a phys address.  This eliminates a PHYS_TO_VM_PAGE
	   operation.
	7) Several rewrites of routines that contain redundant code to
	   use common routines, so that there is a greater likelihood of
	   keeping the cache footprint smaller.

Revision 1.22.4.5: download - view: text, markup, annotated - select for diffs
Sun Jul 7 03:29:44 1996 UTC (15 years, 7 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE
Diff to: previous 1.22.4.4: preferred, colored; branchpoint 1.22: preferred, colored
Changes since revision 1.22.4.4: +8 -8 lines
Applied changes similar to rev 1.52: treat kmem_map and mb_map equally
in special cases.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sun Jul 7 03:27:41 1996 UTC (15 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +8 -8 lines
In all special cases for spl or page_alloc where kmem_map is check for,
mb_map (a submap of kmem_map) must also be checked.
Thanks to wcarchive (err...sort of) for demonstrating this bug.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun Jun 16 20:37:29 1996 UTC (15 years, 7 months ago) by dyson
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +14 -21 lines
Various bugfixes/cleanups from me and others:
1) Remove potential race conditions on waking up in vm_page_free_wakeup
   by making sure that it is at splvm().
2) Fix another bug in vm_map_simplify_entry.
3) Be more complete about converting from default to swap pager
   when an object grows to be large enough that there can be
   a problem with data structure allocation under low memory
   conditions.
4) Make some madvise code more efficient.
5) Added some comments.

Revision 1.22.4.4: download - view: text, markup, annotated - select for diffs
Sat Jun 15 14:03:33 1996 UTC (15 years, 7 months ago) by davidg
Branches: RELENG_2_1_0
Diff to: previous 1.22.4.3: preferred, colored; branchpoint 1.22: preferred, colored
Changes since revision 1.22.4.3: +5 -1 lines
vm_map_entry_dispose() needs splimp protection, too, so add it.

Revision 1.22.4.3: download - view: text, markup, annotated - select for diffs
Sat Jun 15 12:29:19 1996 UTC (15 years, 7 months ago) by davidg
Branches: RELENG_2_1_0
Diff to: previous 1.22.4.2: preferred, colored; branchpoint 1.22: preferred, colored
Changes since revision 1.22.4.2: +11 -15 lines
Protect map entry allocations with splimp. This is necessary since malloc
can/will allocate map entries at interrupt time. This is similar to a
(splvm) change that was made in the main branch, but much simpler. The
code in the main branch is broken (the thresholds are of such that
freed map entries will accumulate on the non-kernel pool)...so the fix
was re-implemented with just the spl protection and minor algorithmic
simplification.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Jun 12 04:03:21 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +7 -6 lines
Fix some serious errors in vm_map_simplify_entries.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri May 31 00:37:58 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -8 lines
This commit is dual-purpose, to fix more of the pageout daemon
queue corruption problems, and to apply Gary Palmer's code cleanups.
David Greenman helped with these problems also.  There is still
a hang problem using X in small memory machines.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Wed May 29 05:12:21 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +18 -2 lines
Make sure that pageout deadlocks cannot occur.  There is a problem
that the datastructures needed to support the swap pager can take
enough space to fully deplete system memory, and cause a deadlock.
This change keeps large objects from being filled with dirty pages
without the appropriate swap pager datastructures.  Right now,
default objects greater than 1/4 the size of available system memory
are converted to swap objects, thereby eliminating the risk of deadlock.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu May 23 00:45:54 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -1 lines
Initial support for MADV_FREE, support for pages that we don't care
about the contents anymore.  This gives us alot of the advantage of
freeing individual pages through munmap, but with almost none of the
overhead.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sun May 19 07:36:46 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +92 -1 lines
Initial support for mincore and madvise.  Both are almost fully
supported, except madvise does not page in with MADV_WILLNEED, and
MADV_DONTNEED doesn't force dirty pages out.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sat May 18 03:37:43 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +112 -131 lines
This set of commits to the VM system does the following, and contain
contributions or ideas from Stephen McKay <syssgm@devetir.qld.gov.au>,
Alan Cox <alc@cs.rice.edu>, David Greenman <davidg@freebsd.org> and me:

	More usage of the TAILQ macros.  Additional minor fix to queue.h.
	Performance enhancements to the pageout daemon.
		Addition of a wait in the case that the pageout daemon
		has to run immediately.
		Slightly modify the pageout algorithm.
	Significant revamp of the pmap/fork code:
		1) PTE's and UPAGES's are NO LONGER in the process's map.
		2) PTE's and UPAGES's reside in their own objects.
		3) TOTAL elimination of recursive page table pagefaults.
		4) The page directory now resides in the PTE object.
		5) Implemented pmap_copy, thereby speeding up fork time.
		6) Changed the pv entries so that the head is a pointer
		   and not an entire entry.
		7) Significant cleanup of pmap_protect, and pmap_remove.
		8) Removed significant amounts of machine dependent
		   fork code from vm_glue.  Pushed much of that code into
		   the machine dependent pmap module.
		9) Support more completely the reuse of already zeroed
		   pages (Page table pages and page directories) as being
		   already zeroed.
	Performance and code cleanups in vm_map:
		1) Improved and simplified allocation of map entries.
		2) Improved vm_map_copy code.
		3) Corrected some minor problems in the simplify code.
	Implemented splvm (combo of splbio and splimp.)  The VM code now
		seldom uses splhigh.
	Improved the speed of and simplified kmem_malloc.
	Minor mod to vm_fault to avoid using pre-zeroed pages in the case
		of objects with backing objects along with the already
		existant condition of having a vnode.  (If there is a backing
		object, there will likely be a COW...  With a COW, it isn't
		necessary to start with a pre-zeroed page.)
	Minor reorg of source to perhaps improve locality of ref.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri May 3 21:01:49 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
Another sweep over the pmap/vm macros, this time with more focus on
the usage.  I'm not satisfied with the naming, but now at least there is
less bogus stuff around.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Apr 29 22:04:57 1996 UTC (15 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +4 -4 lines
Move the map entry allocations from the kmem_map to the kernel_map.  As
a side effect, correct the associated object offset.

Revision 1.22.4.2: download - view: text, markup, annotated - select for diffs
Fri Apr 26 04:12:18 1996 UTC (15 years, 9 months ago) by davidg
Branches: RELENG_2_1_0
Diff to: previous 1.22.4.1: preferred, colored; branchpoint 1.22: preferred, colored
Changes since revision 1.22.4.1: +11 -10 lines
Fixes for a couple of minor bugs:

1) allocate map VM from the kernel_map, not the kmem_map.
2) update map hint properly when simplifying a map and remove unnecessary
   restriction on object->paging_in_progress.

   The above problems wouldn't have caused any panics, and it's unlikely
that there were any noticeable effects due to the bugs...but they're bugs
nonetheless.

Submitted by:	dyson

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Apr 3 05:23:38 1996 UTC (15 years, 10 months ago) by dyson
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +3 -7 lines
Fixed a problem that the UPAGES of a process were being run down
in a suboptimal manner.  I had also noticed some panics that appeared
to be at least superficially caused by this problem.  Also, included
are some minor mods to support more general handling of page table page
faulting.  More details in a future commit.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Thu Mar 28 04:53:24 1996 UTC (15 years, 10 months ago) by dyson
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +106 -99 lines
VM performance improvements, and reorder some operations in VM fault
in anticipation of a fix in pmap that will allow the mlock system call to work
without panicing the system.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu Mar 28 04:22:17 1996 UTC (15 years, 10 months ago) by dyson
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +28 -29 lines
More map_simplify fixes from Alan Cox.  This very significanly improves the
performance when the map has been chopped up.  The map simplify operations
really work now.
Reviewed by: dyson
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Mar 13 01:18:14 1996 UTC (15 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +53 -36 lines
This commit is as a result of a comment by Alan Cox (alc@cs.rice.edu)
regarding the "real" problem with maps that we have been having
over the last few weeks.  He noted that the first_free pointer was
left dangling in certain circumstances -- and he was right!!!   This
should fix the map problems that we were having, and also give us the
advantage of being able to simplify maps more aggressively.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Tue Mar 12 13:46:13 1996 UTC (15 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +3 -25 lines
Fix the map corruption problem that appears as a u_map allocation
error.

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Mar 11 19:54:07 1996 UTC (15 years, 11 months ago) by peter
Branches: CSRG
CVS tags: bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +63 -41 lines
Import 4.4BSD-Lite2 onto the vendor branch, note that in the kernel, all
files are off the vendor branch, so this should not change anything.

A "U" marker generally means that the file was not changed in between
the 4.4Lite and Lite-2 releases, and does not need a merge.  "C" generally
means that there was a change.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Mar 9 06:52:05 1996 UTC (15 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +3 -2 lines
Fix two problems:
	The pmap_remove in vm_map_clean incorrectly unmapped the entire
	map entry.
	The new vm_map_simplify_entry code had an error (the offset
	of the combined map entry was not set correctly.)
Submitted by:	Alan Cox <alc@cs.rice.edu>

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Mar 4 02:04:24 1996 UTC (15 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +17 -1 lines
Fix a problem that pages in a mapped region were not always
properly invalidated.  Now we traverse the object shadow chain
properly.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sun Mar 3 18:53:10 1996 UTC (15 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -3 lines
Remove the #ifdef notyet from the prototype of vm_map_simplify.  John
re-enabled the function but missed the prototype, causing a warning.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat Mar 2 02:54:20 1996 UTC (15 years, 11 months ago) by dyson
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +52 -39 lines
1) Eliminate unnecessary bzero of UPAGES.
2) Eliminate unnecessary copying of pages during/after forks.
3) Add user map simplification.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Feb 11 22:03:49 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +9 -8 lines
Fixed a really bogus problem with msync ripping pages away from
objects before they were written.  Also, don't allow processes
without write access to remove pages from vm_objects.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Jan 19 03:59:52 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +36 -26 lines
Eliminated many redundant vm_map_lookup operations for vm_mmap.
Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish
	overhead for merged cache.
Efficiency improvement for vfs_cluster.  It used to do alot of redundant
	calls to cluster_rbuild.
Correct the ordering for vrele of .text and release of credentials.
Use the selective tlb update for 486/586/P6.
Numerous fixes to the size of objects allocated for files.  Additionally,
	fixes in the various pagers.
Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs.
Fixes in the swap pager for exhausted resources.  The pageout code
	will not as readily thrash.
Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into
	page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE),
	thereby improving efficiency of several routines.
Eliminate even more unnecessary vm_page_protect operations.
Significantly speed up process forks.
Make vm_object_page_clean more efficient, thereby eliminating the pause
	that happens every 30seconds.
Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the
	case of filesystems mounted async.
Fix a panic with busy pages when write clustering is done for non-VMIO
	buffers.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jan 4 21:13:17 1996 UTC (16 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -1 lines
Convert DDB to new-style option.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Thu Dec 14 09:54:59 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +21 -10 lines
Another mega commit to staticize things.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Dec 11 04:58:12 1995 UTC (16 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +38 -32 lines
Changes to support 1Tb filesizes.  Pages are now named by an
(object,index) pair instead of (object,offset) pair.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu Dec 7 12:48:15 1995 UTC (16 years, 2 months ago) by davidg
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +10 -1 lines
Untangled the vm.h include file spaghetti.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Nov 20 12:19:49 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -3 lines
Remove unused vars & funcs, make things static, protoize a little bit.

Revision 1.22.4.1: download - view: text, markup, annotated - select for diffs
Sun Nov 12 08:59:56 1995 UTC (16 years, 3 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_0_RELEASE
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -2 lines
Brought in change from rev 1.26: moved vm_map_lock call to close window.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Nov 12 08:58:58 1995 UTC (16 years, 3 months ago) by davidg
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
Moved vm_map_lock call to inside the splhigh protection in vm_map_find().
This closes a probably rare but nonetheless real window that would result
in a process hanging or the system panicing.

Reviewed by:	dyson, davidg
Submitted by:	kato@eclogite.eps.nagoya-u.ac.jp (KATO Takenori)

Revision 1.25: download - view: text, markup, annotated - select for diffs
Mon Oct 23 05:35:44 1995 UTC (16 years, 3 months ago) by dyson
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -3 lines
Get rid of machine-dependent NBPG and replace with PAGE_SIZE.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Aug 26 23:18:38 1995 UTC (16 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +10 -5 lines
Change vm_map_print() to have the correct number and type of args for
a ddb command.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Jul 13 08:48:26 1995 UTC (16 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +20 -393 lines
NOTE: libkvm, w, ps, 'top', and any other utility which depends on struct
      proc or any VM system structure will have to be rebuilt!!!

Much needed overhaul of the VM system. Included in this first round of
changes:

1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages,
   haspage, and sync operations are supported. The haspage interface now
   provides information about clusterability. All pager routines now take
   struct vm_object's instead of "pagers".

2) Improved data structures. In the previous paradigm, there is constant
   confusion caused by pagers being both a data structure ("allocate a
   pager") and a collection of routines. The idea of a pager structure has
   escentially been eliminated. Objects now have types, and this type is
   used to index the appropriate pager. In most cases, items in the pager
   structure were duplicated in the object data structure and thus were
   unnecessary. In the few cases that remained, a un_pager structure union
   was created in the object to contain these items.

3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now
   be removed. For instance, vm_object_enter(), vm_object_lookup(),
   vm_object_remove(), and the associated object hash list were some of the
   things that were removed.

4) simple_lock's removed. Discussion with several people reveals that the
   SMP locking primitives used in the VM system aren't likely the mechanism
   that we'll be adopting. Even if it were, the locking that was in the code
   was very inadequate and would have to be mostly re-done anyway. The
   locking in a uni-processor kernel was a no-op but went a long way toward
   making the code difficult to read and debug.

5) Places that attempted to kludge-up the fact that we don't have kernel
   thread support have been fixed to reflect the reality that we are really
   dealing with processes, not threads. The VM system didn't have complete
   thread support, so the comments and mis-named routines were just wrong.
   We now use tsleep and wakeup directly in the lock routines, for instance.

6) Where appropriate, the pagers have been improved, especially in the
   pager_alloc routines. Most of the pager_allocs have been rewritten and
   are now faster and easier to maintain.

7) The pagedaemon pageout clustering algorithm has been rewritten and
   now tries harder to output an even number of pages before and after
   the requested page. This is sort of the reverse of the ideal pagein
   algorithm and should provide better overall performance.

8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup
   have been removed. Some other unnecessary casts have also been removed.

9) Some almost useless debugging code removed.

10) Terminology of shadow objects vs. backing objects straightened out.
    The fact that the vm_object data structure escentially had this
    backwards really confused things. The use of "shadow" and "backing
    object" throughout the code is now internally consistent and correct
    in the Mach terminology.

11) Several minor bug fixes, including one in the vm daemon that caused
    0 RSS objects to not get purged as intended.

12) A "default pager" has now been created which cleans up the transition
    of objects to the "swap" type. The previous checks throughout the code
    for swp->pg_data != NULL were really ugly. This change also provides
    the rudiments for future backing of "anonymous" memory by something
    other than the swap pager (via the vnode pager, for example), and it
    allows the decision about which of these pagers to use to be made
    dynamically (although will need some additional decision code to do
    this, of course).

13) (dyson) MAP_COPY has been deprecated and the corresponding "copy
    object" code has been removed. MAP_COPY was undocumented and non-
    standard. It was furthermore broken in several ways which caused its
    behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will
    continue to work correctly, but via the slightly different semantics
    of MAP_PRIVATE.

14) (dyson) Sharing maps have been removed. It's marginal usefulness in a
    threads design can be worked around in other ways. Both #12 and #13
    were done to simplify the code and improve readability and maintain-
    ability. (As were most all of these changes)

TODO:

1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing
   this will reduce the vnode pager to a mere fraction of its current size.

2) Rewrite vm_fault and the swap/vnode pagers to use the clustering
   information provided by the new haspage pager interface. This will
   substantially reduce the overhead by eliminating a large number of
   VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be
   improved to provide both a "behind" and "ahead" indication of
   contiguousness.

3) Implement the extended features of pager_haspage in swap_pager_haspage().
   It currently just says 0 pages ahead/behind.

4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps
   via a much more general mechanism that could also be used for disk
   striping of regular filesystems.

5) Do something to improve the architecture of vm_object_collapse(). The
   fact that it makes calls into the swap pager and knows too much about
   how the swap pager operates really bothers me. It also doesn't allow
   for collapsing of non-swap pager objects ("unnamed" objects backed by
   other pagers).

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue May 30 08:16:07 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5
Branch point for: RELENG_2_1_0
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +32 -32 lines
Remove trailing whitespace.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Apr 16 12:56:17 1995 UTC (16 years, 9 months ago) by davidg
Branches: MAIN
CVS tags: RELENG_2_0_5_ALPHA
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +5 -3 lines
Moved some zero-initialized variables into .bss. Made code intended to be
called only from DDB #ifdef DDB. Removed some completely unused globals.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Mar 25 17:36:57 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +1 -4 lines
Pass syncio flag to vm_object_clean(). It remains unimplemented, however.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Mar 22 12:24:08 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +10 -8 lines
Removed unused fifth argument to vm_object_page_clean(). Fixed bug with
VTEXT not always getting cleared when it is supposed to. Added check to
make sure that vm_object_remove() isn't called with a NULL pager or for
a pager for an OBJ_INTERNAL object (neither of which will be on the hash
list). Clear OBJ_CANPERSIST if we decide to terminate it because of no
resident pages.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Mar 21 01:11:40 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -3 lines
Added a new boolean argument to vm_object_page_clean that causes it to
only toss out clean pages if TRUE.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Mar 16 18:17:14 1995 UTC (16 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +2 -2 lines
Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Wed Mar 1 23:29:56 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -1 lines
Various changes from John and myself that do the following:

New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that
are used to reduce the actual number of wakeups.
New function vm_page_protect which is used in conjuction with some new
page flags to reduce the number of calls to pmap_page_protect.
Minor changes to reduce unnecessary spl nesting.
Rewrote vm_page_alloc() to improve readability.
Various other mostly cosmetic changes.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Feb 21 01:13:05 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +2 -1 lines
Set page alloced for map entries as valid.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Feb 14 04:00:17 1995 UTC (17 years ago) by davidg
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +19 -17 lines
Fixed problem with msync causing a panic.

Submitted by:	John Dyson

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Feb 2 09:08:40 1995 UTC (17 years ago) by davidg
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +23 -6 lines
swap_pager.c:
Fixed long standing bug in freeing swap space during object collapses.
Fixed 'out of space' messages from printing out too often.
Modified to use new kmem_malloc() calling convention.
Implemented an additional stat in the swap pager struct to count the
amount of space allocated to that pager. This may be removed at some
point in the future.
Minimized unnecessary wakeups.

vm_fault.c:
Don't try to collect fault stats on 'swapped' processes - there aren't
any upages to store the stats in.
Changed read-ahead policy (again!).

vm_glue.c:
Be sure to gain a reference to the process's map before swapping.
Be sure to lose it when done.

kern_malloc.c:
Added the ability to specify if allocations are at interrupt time or
are 'safe'; this affects what types of pages can be allocated.

vm_map.c:
Fixed a variety of map lock problems; there's still a lurking bug that
will eventually bite.

vm_object.c:
Explicitly initialize the object fields rather than bzeroing the struct.
Eliminated the 'rcollapse' code and folded it's functionality into the
"real" collapse routine.
Moved an object_unlock() so that the backing_object is protected in
the qcollapse routine.
Make sure nobody fools with the backing_object when we're destroying it.
Added some diagnostic code which can be called from the debugger that
looks through all the internal objects and makes certain that they
all belong to someone.

vm_page.c:
Fixed a rather serious logic bug that would result in random system
crashes. Changed pagedaemon wakeup policy (again!).

vm_pageout.c:
Removed unnecessary page rotations on the inactive queue.
Changed the number of pages to explicitly free to just free_reserved
level.

Submitted by:	John Dyson

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Jan 24 10:13:02 1995 UTC (17 years ago) by davidg
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -2 lines
Added ability to detect sequential faults and DTRT. (swap_pager.c)
Added hook for pmap_prefault() and use symbolic constant for new third
argument to vm_page_alloc() (vm_fault.c, various)
Changed the way that upages and page tables are held. (vm_glue.c)
Fixed architectural flaw in allocating pages at interrupt time that was
introduced with the merged cache changes. (vm_page.c, various)
Adjusted some algorithms to acheive better paging performance and to
accomodate the fix for the architectural flaw mentioned above. (vm_pageout.c)
Fixed pbuf handling problem, changed policy on handling read-behind page.
(vnode_pager.c)

Submitted by:	John Dyson

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Jan 10 07:32:46 1995 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -3 lines
Fixed some formatting weirdness that I overlooked in the previous commit.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Jan 9 16:05:45 1995 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +760 -823 lines
These changes embody the support of the fully coherent merged VM buffer cache,
much higher filesystem I/O performance, and much better paging performance. It
represents the culmination of over 6 months of R&D.

The majority of the merged VM/cache work is by John Dyson.

The following highlights the most significant changes. Additionally, there are
(mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to
support the new VM/buffer scheme.

vfs_bio.c:
Significant rewrite of most of vfs_bio to support the merged VM buffer cache
scheme.  The scheme is almost fully compatible with the old filesystem
interface.  Significant improvement in the number of opportunities for write
clustering.

vfs_cluster.c, vfs_subr.c
Upgrade and performance enhancements in vfs layer code to support merged
VM/buffer cache.  Fixup of vfs_cluster to eliminate the bogus pagemove stuff.

vm_object.c:
Yet more improvements in the collapse code.  Elimination of some windows that
can cause list corruption.

vm_pageout.c:
Fixed it, it really works better now.  Somehow in 2.0, some "enhancements"
broke the code.  This code has been reworked from the ground-up.

vm_fault.c, vm_page.c, pmap.c, vm_object.c
Support for small-block filesystems with merged VM/buffer cache scheme.

pmap.c vm_map.c
Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of
kernel PTs.

vm_glue.c
Much simpler and more effective swapping code.  No more gratuitous swapping.

proc.h
Fixed the problem that the p_lock flag was not being cleared on a fork.

swap_pager.c, vnode_pager.c
Removal of old vfs_bio cruft to support the past pseudo-coherency.  Now the
code doesn't need it anymore.

machdep.c
Changes to better support the parameter values for the merged VM/buffer cache
scheme.

machdep.c, kern_exec.c, vm_glue.c
Implemented a seperate submap for temporary exec string space and another one
to contain process upages. This eliminates all map fragmentation problems
that previously existed.

ffs_inode.c, ufs_inode.c, ufs_readwrite.c
Changes for merged VM/buffer cache.  Add "bypass" support for sneaking in on
busy buffers.

Submitted by:	John Dyson and David Greenman

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Dec 18 13:58:41 1994 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +8 -8 lines
Fixed multiple bogons with the map entry handling.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Dec 18 10:28:40 1994 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +7 -4 lines
Fixed bug where statically allocated map entries might be freed to the
malloc pool...causing a panic.

Submitted by:	John Dyson

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Dec 15 22:47:11 1994 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +19 -3 lines
Protect kmem_map modifications with splhigh() to work around a problem with
the map being locked at interrupt time.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Oct 9 01:52:10 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +14 -11 lines
Cosmetics:  unused vars, ()'s, #include's &c &c to silence gcc.
Reviewed by:	davidg

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Aug 18 22:36:04 1994 UTC (17 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -5 lines
Fix up some sloppy coding practices:

- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
  header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Aug 4 19:40:47 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +10 -1 lines
Added some code that was accidently left out early in the 1.x -> 2.0 VM
system conversion.
Submitted by:	John Dyson

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:55:25 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +3 -1 lines
Added $Id$

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed May 25 09:19:30 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +91 -36 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue May 24 10:09:47 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: CSRG
CVS tags: bsd_44_lite, REL_before_johndavid_2_0_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite Kernel Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue May 24 10:09:46 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options