The NetBSD Project

CVS log for src/sys/uvm/uvm_map.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / uvm

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.362.2.6: download - view: text, markup, annotated - select for diffs
Sat Aug 24 08:24:36 2024 UTC (3 months, 1 week ago) by martin
Branches: netbsd-9
Diff to: previous 1.362.2.5: preferred, colored; branchpoint 1.362: preferred, colored; next MAIN 1.363: preferred, colored
Changes since revision 1.362.2.5: +5 -4 lines
Pull up following revision(s) (requested by riastradh in ticket #804):

	sys/uvm/uvm_map.c: revision 1.423 (patch)
	sys/uvm/uvm_map.c: revision 1.425 (patch)

uvm_map(9): Make sure search in the nearest gap is monotonic.

The algorithm, on a hint clamped to the VM bounds, works as follows
(assuming topdown VM):

1. Make sure the hint is aligned, by subtracting the remainderin
   uvm_map_align_va.
2. If the hint is equal to the VM max, try the first free gap.
3. If the hint is not equal to the VM max, but is already in use, try
   the next gap _below_ the entry covering hint.
4. If the hint is not equal to the VM max and is not already in use,
   try gap between the entry below hint and the next entry after it,
   above hint.

In the last case, `entry' is the one below hint, and `entry->next' is
the one above it.  We would take
        entry->next->start - length
as the next candidate hint.

However, this algorithm is supposed to be a monotonic search through
the address space, and we might wind up with something like:

[0x7defb000,0x7defc000)         entry above hint (entry->next)
0x77895000                      hint
[0x77894000,0x77895000)         entry below hint (entry)

In this case, if length=0x1000, we would take
        0x7defb000 - 0x1000 = 0x7defa000
as the next candidate hint, but this violates monotonicity of the
search.

Instead, take the _smallest_ of orig_hint or entry->next->start -
length, to avoid violating monotonicity, so hint <= orig_hint.

I didn't commit this change before because it didn't seem to fix all
the manifestations of the problem, but we have more diagnostics now
so maybe we will find there is a _different_ violation of the same
invariants once this is committed -- and I'm pretty sure this change
is necessary to guarantee monotonicity in some cases (but I'm still
not sure why we're only hitting the problem on sh3).

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed
uvm_map(9): Apply the same orig_hint clamp again to the same entry.

Previous change dealt with case like length=0x1000 and:

[0x7defb000,0x7defc000)         entry above orig_hint (entry->next)
0x77895000                      orig_hint
[0x77894000,0x77895000)         entry below orig_hint (entry)

by changing
        entry->next->start - length
to
        MIN(orig_hint, entry->next->start - length)

in order to enforce monotonicity of search.

In this case, if the tree search for a gap has failed, we retry with
a list search with exactly the same orig_hint and entry -- nothing
has changed them (only hint and tmp).  So apply the same clamping.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.403.2.3: download - view: text, markup, annotated - select for diffs
Sat Aug 24 08:22:16 2024 UTC (3 months, 1 week ago) by martin
Branches: netbsd-10
Diff to: previous 1.403.2.2: preferred, colored; branchpoint 1.403: preferred, colored; next MAIN 1.404: preferred, colored
Changes since revision 1.403.2.2: +5 -4 lines
Pull up following revision(s) (requested by riastradh in ticket #804):

	sys/uvm/uvm_map.c: revision 1.423
	sys/uvm/uvm_map.c: revision 1.425

uvm_map(9): Make sure search in the nearest gap is monotonic.

The algorithm, on a hint clamped to the VM bounds, works as follows
(assuming topdown VM):

1. Make sure the hint is aligned, by subtracting the remainderin
   uvm_map_align_va.
2. If the hint is equal to the VM max, try the first free gap.
3. If the hint is not equal to the VM max, but is already in use, try
   the next gap _below_ the entry covering hint.
4. If the hint is not equal to the VM max and is not already in use,
   try gap between the entry below hint and the next entry after it,
   above hint.

In the last case, `entry' is the one below hint, and `entry->next' is
the one above it.  We would take
        entry->next->start - length
as the next candidate hint.

However, this algorithm is supposed to be a monotonic search through
the address space, and we might wind up with something like:

[0x7defb000,0x7defc000)         entry above hint (entry->next)
0x77895000                      hint
[0x77894000,0x77895000)         entry below hint (entry)

In this case, if length=0x1000, we would take
        0x7defb000 - 0x1000 = 0x7defa000
as the next candidate hint, but this violates monotonicity of the
search.

Instead, take the _smallest_ of orig_hint or entry->next->start -
length, to avoid violating monotonicity, so hint <= orig_hint.

I didn't commit this change before because it didn't seem to fix all
the manifestations of the problem, but we have more diagnostics now
so maybe we will find there is a _different_ violation of the same
invariants once this is committed -- and I'm pretty sure this change
is necessary to guarantee monotonicity in some cases (but I'm still
not sure why we're only hitting the problem on sh3).

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed
uvm_map(9): Apply the same orig_hint clamp again to the same entry.

Previous change dealt with case like length=0x1000 and:

[0x7defb000,0x7defc000)         entry above orig_hint (entry->next)
0x77895000                      orig_hint
[0x77894000,0x77895000)         entry below orig_hint (entry)

by changing
        entry->next->start - length
to
        MIN(orig_hint, entry->next->start - length)

in order to enforce monotonicity of search.

In this case, if the tree search for a gap has failed, we retry with
a list search with exactly the same orig_hint and entry -- nothing
has changed them (only hint and tmp).  So apply the same clamping.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.403.2.2: download - view: text, markup, annotated - select for diffs
Thu Aug 22 19:28:40 2024 UTC (3 months, 1 week ago) by martin
Branches: netbsd-10
Diff to: previous 1.403.2.1: preferred, colored; branchpoint 1.403: preferred, colored
Changes since revision 1.403.2.1: +22 -13 lines
Pull up following revision(s) (requested by rin in ticket #783):

	sys/uvm/uvm_map.c: revision 1.407
	sys/uvm/uvm_map.c: revision 1.412
	sys/uvm/uvm_map.c: revision 1.413

uvm_findspace(): For sh3, convert a KASSERTMSG(9) into printf(9)
XXX

Work around for PR kern/51254 until it gets fixed.

With this change, landisk survives full ATF with DIAGNOSTIC enabled.
uvm_map.c: Fix kassertmsg/printf newline mismatch in PR 51254 note.
uvm_findspace_invariants: don't repeat the message three times

The topdown and bottomup messages were exactly the same and sh3 printf
hack added the third copy.  Restructure the code so that there's only
one message and make the message more obvious - the topdown condition
in the assertions was confusing b/c it's inverted (!topdown || ...
means it's the topdown map).

PR 51254

Revision 1.426: download - view: text, markup, annotated - select for diffs
Fri Aug 16 11:28:01 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.425: preferred, colored
Changes since revision 1.425: +3 -15 lines
uvm_map(9): Make KASSERTMSG unconditional for findspace invariants.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.425: download - view: text, markup, annotated - select for diffs
Thu Aug 15 11:33:21 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.424: preferred, colored
Changes since revision 1.424: +4 -3 lines
uvm_map(9): Apply the same orig_hint clamp again to the same entry.

Previous change dealt with case like length=0x1000 and:

[0x7defb000,0x7defc000)		entry above orig_hint (entry->next)
0x77895000			orig_hint
[0x77894000,0x77895000)		entry below orig_hint (entry)

by changing

	entry->next->start - length

to

	MIN(orig_hint, entry->next->start - length)

in order to enforce monotonicity of search.

In this case, if the tree search for a gap has failed, we retry with
a list search with exactly the same orig_hint and entry -- nothing
has changed them (only hint and tmp).  So apply the same clamping.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.424: download - view: text, markup, annotated - select for diffs
Wed Aug 14 22:24:09 2024 UTC (3 months, 2 weeks ago) by rin
Branches: MAIN
Diff to: previous 1.423: preferred, colored
Changes since revision 1.423: +3 -3 lines
uvm_map: Fix build failure with DIAGNOSTIC for rev 1.422

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.423: download - view: text, markup, annotated - select for diffs
Wed Aug 14 21:05:11 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.422: preferred, colored
Changes since revision 1.422: +3 -3 lines
uvm_map(9): Make sure search in the nearest gap is monotonic.

The algorithm, on a hint clamped to the VM bounds, works as follows
(assuming topdown VM):

1. Make sure the hint is aligned, by subtracting the remainderin
   uvm_map_align_va.

2. If the hint is equal to the VM max, try the first free gap.

3. If the hint is not equal to the VM max, but is already in use, try
   the next gap _below_ the entry covering hint.

4. If the hint is not equal to the VM max and is not already in use,
   try gap between the entry below hint and the next entry after it,
   above hint.

In the last case, `entry' is the one below hint, and `entry->next' is
the one above it.  We would take

	entry->next->start - length

as the next candidate hint.

However, this algorithm is supposed to be a monotonic search through
the address space, and we might wind up with something like:

[0x7defb000,0x7defc000)         entry above hint (entry->next)
0x77895000                      hint
[0x77894000,0x77895000)         entry below hint (entry)

In this case, if length=0x1000, we would take

	0x7defb000 - 0x1000 = 0x7defa000

as the next candidate hint, but this violates monotonicity of the
search.

Instead, take the _smallest_ of orig_hint or entry->next->start -
length, to avoid violating monotonicity, so hint <= orig_hint.

I didn't commit this change before because it didn't seem to fix all
the manifestations of the problem, but we have more diagnostics now
so maybe we will find there is a _different_ violation of the same
invariants once this is committed -- and I'm pretty sure this change
is necessary to guarantee monotonicity in some cases (but I'm still
not sure why we're only hitting the problem on sh3).

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.422: download - view: text, markup, annotated - select for diffs
Wed Aug 14 20:58:25 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.421: preferred, colored
Changes since revision 1.421: +6 -2 lines
uvm_map(9): Show the next entry when findspace invariants fail too.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.421: download - view: text, markup, annotated - select for diffs
Wed Aug 14 01:26:25 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.420: preferred, colored
Changes since revision 1.420: +7 -3 lines
uvm_map(9): Take vm map lock around uvm_unmap_remove.

This was tripping one of the assertions I added.  While it is safe
here not to hold the lock -- caller has exclusive access to the map
at this point -- it is better if we can annotate the functions in
question with executable notes about locking rules, and taking a
single uncontended lock in the vm map destruction path is probably a
tiny cost worth those executable notes.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.420: download - view: text, markup, annotated - select for diffs
Wed Aug 14 00:42:02 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.419: preferred, colored
Changes since revision 1.419: +6 -4 lines
uvm_map(9): Show the entry in findspace invariants.

No functional change intended in the non-crash3 case.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.419: download - view: text, markup, annotated - select for diffs
Wed Aug 14 00:41:46 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.418: preferred, colored
Changes since revision 1.418: +10 -7 lines
uvm_map(9): Avoid potential arithmetic overflow.

Should be harmless in this case because vaddr_t is unsigned, so
there's no undefined behaviour here, but let's make it unnecessary to
wonder whether overflow is a problem.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.418: download - view: text, markup, annotated - select for diffs
Wed Aug 14 00:41:30 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.417: preferred, colored
Changes since revision 1.417: +3 -2 lines
uvm_map(9): Assert another loop invariant in entry lookup.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.417: download - view: text, markup, annotated - select for diffs
Tue Aug 13 20:52:52 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.416: preferred, colored
Changes since revision 1.416: +67 -21 lines
Redo uvm_map.c 1.414 without the null pointer dereference.

uvm_map(9): Sprinkle assertions and interface contract comments.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.416: download - view: text, markup, annotated - select for diffs
Tue Aug 13 20:23:23 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.415: preferred, colored
Changes since revision 1.415: +21 -67 lines
Revert uvm_map.c 1.414.

This was:

   uvm_map(9): Sprinkle assertions and interface contract comments.

Apparently, you have to actually test changes, not just prove they
are correct.  Who knew??

(And the incantation `No functional change intended.' didn't work
either!)

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.415: download - view: text, markup, annotated - select for diffs
Tue Aug 13 17:54:59 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.414: preferred, colored
Changes since revision 1.414: +25 -3 lines
uvm_map(9): Sprinkle invariant assertions into uvm_map_space_avail.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.414: download - view: text, markup, annotated - select for diffs
Tue Aug 13 17:54:44 2024 UTC (3 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.413: preferred, colored
Changes since revision 1.413: +67 -21 lines
uvm_map(9): Sprinkle assertions and interface contract comments.

No functional change intended.

PR kern/51254: uvm assertion "!topdown || hint <= orig_hint" failed

Revision 1.413: download - view: text, markup, annotated - select for diffs
Tue Jul 16 16:48:54 2024 UTC (4 months, 2 weeks ago) by uwe
Branches: MAIN
Diff to: previous 1.412: preferred, colored
Changes since revision 1.412: +22 -24 lines
uvm_findspace_invariants: don't repeat the message three times

The topdown and bottomup messages were exactly the same and sh3 printf
hack added the third copy.  Restructure the code so that there's only
one message and make the message more obvious - the topdown condition
in the assertions was confusing b/c it's inverted (!topdown || ...
means it's the topdown map).

PR 51254

Revision 1.412: download - view: text, markup, annotated - select for diffs
Mon Jul 15 12:51:50 2024 UTC (4 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.411: preferred, colored
Changes since revision 1.411: +12 -6 lines
uvm_map.c: Fix kassertmsg/printf newline mismatch in PR 51254 note.

Revision 1.411: download - view: text, markup, annotated - select for diffs
Fri Feb 9 22:08:38 2024 UTC (9 months, 3 weeks ago) by andvar
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.410: preferred, colored
Changes since revision 1.410: +3 -3 lines
fix spelling mistakes, mainly in comments and log messages.

Revision 1.410: download - view: text, markup, annotated - select for diffs
Sat Sep 23 18:21:12 2023 UTC (14 months, 1 week ago) by ad
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Diff to: previous 1.409: preferred, colored
Changes since revision 1.409: +4 -12 lines
Repply this change with a couple of bugs fixed:

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead. On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.409: download - view: text, markup, annotated - select for diffs
Tue Sep 12 16:17:22 2023 UTC (14 months, 3 weeks ago) by ad
Branches: MAIN
Diff to: previous 1.408: preferred, colored
Changes since revision 1.408: +12 -4 lines
Back out recent change to replace pool_cache with then general allocator.
Will return to this when I have time again.

Revision 1.408: download - view: text, markup, annotated - select for diffs
Sun Sep 10 14:45:53 2023 UTC (14 months, 3 weeks ago) by ad
Branches: MAIN
Diff to: previous 1.407: preferred, colored
Changes since revision 1.407: +4 -12 lines
- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead.  On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.351.2.6: download - view: text, markup, annotated - select for diffs
Fri Aug 4 13:15:25 2023 UTC (16 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE
Diff to: previous 1.351.2.5: preferred, colored; branchpoint 1.351: preferred, colored; next MAIN 1.352: preferred, colored
Changes since revision 1.351.2.5: +17 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1880):

	sys/uvm/uvm_map.c: revision 1.403 (patch)

mmap(2): Avoid arithmetic overflow in search for free space.

PR kern/56900

Revision 1.407: download - view: text, markup, annotated - select for diffs
Thu Aug 3 03:15:48 2023 UTC (16 months ago) by rin
Branches: MAIN
Diff to: previous 1.406: preferred, colored
Changes since revision 1.406: +7 -2 lines
uvm_findspace(): For sh3, convert a KASSERTMSG(9) into printf(9)

XXX
Work around for PR kern/51254 until it gets fixed.

With this change, landisk survives full ATF with DIAGNOSTIC enabled.

Revision 1.403.2.1: download - view: text, markup, annotated - select for diffs
Mon May 15 10:32:53 2023 UTC (18 months, 3 weeks ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Diff to: previous 1.403: preferred, colored
Changes since revision 1.403: +13 -12 lines
Pull up following revision(s) (requested by chs in ticket #167):

	sys/uvm/uvm_map.c: revision 1.406

uvm: avoid a deadlock in uvm_map_clean()

The locking order between map locks and page "busy" locks
is that the page "busy" lock comes first, but uvm_map_clean()
breaks this rule by holding a map locked (as reader) while
waiting for page "busy" locks.

If another thread is in the page-fault path holding a page
"busy" lock while waiting for the map lock (as a reader)
and at the same time a third thread is blocked waiting for
the map lock as a writer (which blocks the page-fault thread),
then these three threads will all deadlock with each other.

Fix this by marking the map "busy" (to block any modifications)
and unlocking the map lock before possibly waiting for any
page "busy" locks.

Martin Pieuchot reported that the same problem existed in OpenBSD
he applied this fix there after several people tested it.

fixes PR 56952

Revision 1.406: download - view: text, markup, annotated - select for diffs
Mon May 15 01:42:42 2023 UTC (18 months, 3 weeks ago) by chs
Branches: MAIN
Diff to: previous 1.405: preferred, colored
Changes since revision 1.405: +13 -12 lines
uvm: avoid a deadlock in uvm_map_clean()

The locking order between map locks and page "busy" locks
is that the page "busy" lock comes first, but uvm_map_clean()
breaks this rule by holding a map locked (as reader) while
waiting for page "busy" locks.

If another thread is in the page-fault path holding a page
"busy" lock while waiting for the map lock (as a reader)
and at the same time a third thread is blocked waiting for
the map lock as a writer (which blocks the page-fault thread),
then these three threads will all deadlock with each other.

Fix this by marking the map "busy" (to block any modifications)
and unlocking the map lock before possibly waiting for any
page "busy" locks.

Martin Pieuchot reported that the same problem existed in OpenBSD
he applied this fix there after several people tested it.

fixes PR 56952

Revision 1.362.2.5: download - view: text, markup, annotated - select for diffs
Sat Apr 1 16:22:14 2023 UTC (20 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.362.2.4: preferred, colored; branchpoint 1.362: preferred, colored
Changes since revision 1.362.2.4: +17 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1625):

	sys/uvm/uvm_map.c: revision 1.403

mmap(2): Avoid arithmetic overflow in search for free space.

PR kern/56900

Revision 1.351.2.5: download - view: text, markup, annotated - select for diffs
Sat Apr 1 16:05:00 2023 UTC (20 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.351.2.4: preferred, colored; branchpoint 1.351: preferred, colored
Changes since revision 1.351.2.4: +32 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1816):

	sys/uvm/uvm_map.c: revision 1.396

uvm(9): Fix mmap optimization for topdown case.

PR kern/51393

Revision 1.362.2.4: download - view: text, markup, annotated - select for diffs
Sat Apr 1 16:03:48 2023 UTC (20 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.362.2.3: preferred, colored; branchpoint 1.362: preferred, colored
Changes since revision 1.362.2.3: +32 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1623):

	sys/uvm/uvm_map.c: revision 1.396

uvm(9): Fix mmap optimization for topdown case.

PR kern/51393

Revision 1.351.2.4: download - view: text, markup, annotated - select for diffs
Sat Apr 1 16:01:52 2023 UTC (20 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.351.2.3: preferred, colored; branchpoint 1.351: preferred, colored
Changes since revision 1.351.2.3: +13 -7 lines
Pull up following revision(s) (requested by riastradh in ticket #1815):

	sys/uvm/uvm_map.c: revision 1.395

uvm(9): Fix 19-year-old bug in assertion about mmap hint.

Previously this would _first_ remember the original hint, and _then_
clamp the hint to the VM map's range:

        orig_hint = hint;
        if (hint < vm_map_min(map)) {   /* check ranges ... */
                if (flags & UVM_FLAG_FIXED) {
                        UVMHIST_LOG(maphist,"<- VA below map range",0,0,0,0);
                        return (NULL);
                }
                hint = vm_map_min(map);
        ...
        KASSERTMSG(!topdown || hint <= orig_hint, "hint: %#jx, orig_hint: %#jx",
            (uintmax_t)hint, (uintmax_t)orig_hint);

Even if nothing else happens in the ellipsis, taking the branch
guarantees the assertion will fail in the topdown case.

Revision 1.362.2.3: download - view: text, markup, annotated - select for diffs
Sat Apr 1 16:00:28 2023 UTC (20 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.362.2.2: preferred, colored; branchpoint 1.362: preferred, colored
Changes since revision 1.362.2.2: +13 -7 lines
Pull up following revision(s) (requested by riastradh in ticket #1622):

	sys/uvm/uvm_map.c: revision 1.395

uvm(9): Fix 19-year-old bug in assertion about mmap hint.

Previously this would _first_ remember the original hint, and _then_
clamp the hint to the VM map's range:

        orig_hint = hint;
        if (hint < vm_map_min(map)) {   /* check ranges ... */
                if (flags & UVM_FLAG_FIXED) {
                        UVMHIST_LOG(maphist,"<- VA below map range",0,0,0,0);
                        return (NULL);
                }
                hint = vm_map_min(map);
        ...
        KASSERTMSG(!topdown || hint <= orig_hint, "hint: %#jx, orig_hint: %#jx",
            (uintmax_t)hint, (uintmax_t)orig_hint);

Even if nothing else happens in the ellipsis, taking the branch
guarantees the assertion will fail in the topdown case.

Revision 1.405: download - view: text, markup, annotated - select for diffs
Fri Mar 24 07:26:21 2023 UTC (20 months, 1 week ago) by skrll
Branches: MAIN
Diff to: previous 1.404: preferred, colored
Changes since revision 1.404: +3 -4 lines
Unwrap. NFCI.

Revision 1.404: download - view: text, markup, annotated - select for diffs
Mon Feb 27 16:24:45 2023 UTC (21 months, 1 week ago) by riastradh
Branches: MAIN
Diff to: previous 1.403: preferred, colored
Changes since revision 1.403: +8 -4 lines
uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B)

While here, print some of the inputs with KASSERTMSG.

Revision 1.403: download - view: text, markup, annotated - select for diffs
Wed Nov 23 23:53:53 2022 UTC (2 years ago) by riastradh
Branches: MAIN
CVS tags: netbsd-10-base
Branch point for: netbsd-10
Diff to: previous 1.402: preferred, colored
Changes since revision 1.402: +16 -3 lines
mmap(2): Avoid arithmetic overflow in search for free space.

PR kern/56900

Reported-by: syzbot+3833ae1d38037a263d05@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e542bcf59b2564cca1cb38c12f076fb08dcac37e

Revision 1.402: download - view: text, markup, annotated - select for diffs
Wed Jun 8 16:55:00 2022 UTC (2 years, 5 months ago) by macallan
Branches: MAIN
CVS tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.401: preferred, colored
Changes since revision 1.401: +3 -3 lines
initialize a variable to appease clang

Revision 1.401: download - view: text, markup, annotated - select for diffs
Mon Jun 6 07:00:02 2022 UTC (2 years, 6 months ago) by rin
Branches: MAIN
Diff to: previous 1.400: preferred, colored
Changes since revision 1.400: +8 -8 lines
PR kern/51254
uvm_map_findspace(): Output current value of "entry" when KASSERT fires.

Revision 1.400: download - view: text, markup, annotated - select for diffs
Sun Jun 5 13:45:28 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.399: preferred, colored
Changes since revision 1.399: +65 -29 lines
uvm(9): Sprinkle assertions into uvm_map_findspace.

May help to diagnose PR kern/51254.

Revision 1.399: download - view: text, markup, annotated - select for diffs
Sun Jun 5 01:45:45 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.398: preferred, colored
Changes since revision 1.398: +2 -4 lines
uvm(9): Don't duplicate vm_map_min/max in `show map' output.

Didn't notice these were already there, oops!

Revision 1.398: download - view: text, markup, annotated - select for diffs
Sat Jun 4 23:26:05 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.397: preferred, colored
Changes since revision 1.397: +16 -6 lines
uvm(9): Sprinkle more info into hint/orig_hint assertions.

May help to diagnose PR kern/51254.

Revision 1.397: download - view: text, markup, annotated - select for diffs
Sat Jun 4 23:09:57 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.396: preferred, colored
Changes since revision 1.396: +7 -4 lines
uvm(9): Print min/max address and first_free entry in ddb `show map'.

May help to diagnose PR kern/51254.

Revision 1.396: download - view: text, markup, annotated - select for diffs
Sat Jun 4 20:54:53 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.395: preferred, colored
Changes since revision 1.395: +32 -3 lines
uvm(9): Fix mmap optimization for topdown case.

PR kern/51393

Revision 1.395: download - view: text, markup, annotated - select for diffs
Sat Jun 4 20:54:24 2022 UTC (2 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.394: preferred, colored
Changes since revision 1.394: +13 -7 lines
uvm(9): Fix 19-year-old bug in assertion about mmap hint.

Previously this would _first_ remember the original hint, and _then_
clamp the hint to the VM map's range:

	orig_hint = hint;
	if (hint < vm_map_min(map)) {	/* check ranges ... */
		if (flags & UVM_FLAG_FIXED) {
			UVMHIST_LOG(maphist,"<- VA below map range",0,0,0,0);
			return (NULL);
		}
		hint = vm_map_min(map);
	...
	KASSERTMSG(!topdown || hint <= orig_hint, "hint: %#jx, orig_hint: %#jx",
	    (uintmax_t)hint, (uintmax_t)orig_hint);

Even if nothing else happens in the ellipsis, taking the branch
guarantees the assertion will fail in the topdown case.

Revision 1.394: download - view: text, markup, annotated - select for diffs
Sun Apr 10 09:50:46 2022 UTC (2 years, 7 months ago) by andvar
Branches: MAIN
Diff to: previous 1.393: preferred, colored
Changes since revision 1.393: +3 -3 lines
fix various typos in comments and output/log messages.

Revision 1.393: download - view: text, markup, annotated - select for diffs
Sat Apr 9 23:38:33 2022 UTC (2 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.392: preferred, colored
Changes since revision 1.392: +4 -4 lines
sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

Revision 1.392: download - view: text, markup, annotated - select for diffs
Sat Mar 12 15:32:33 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.391: preferred, colored
Changes since revision 1.391: +5 -2 lines
sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

Revision 1.391: download - view: text, markup, annotated - select for diffs
Thu Nov 25 09:40:45 2021 UTC (3 years ago) by skrll
Branches: MAIN
Diff to: previous 1.390: preferred, colored
Changes since revision 1.390: +11 -4 lines
More / improved debug

Revision 1.388.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 1 22:42:45 2021 UTC (3 years, 4 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.388: preferred, colored; next MAIN 1.389: preferred, colored
Changes since revision 1.388: +3 -7 lines
Sync with HEAD.

Revision 1.390: download - view: text, markup, annotated - select for diffs
Thu Jul 1 15:06:01 2021 UTC (3 years, 5 months ago) by chs
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Diff to: previous 1.389: preferred, colored
Changes since revision 1.389: +3 -2 lines
in uvm_mapent_forkzero(), if the old entry was an object mapping,
appease a debug check by setting the new entry offset to zero along with
setting the new entry object pointer to NULL.

Reported-by: syzbot+de8e4b223a3838c7307b@syzkaller.appspotmail.com
Reported-by: syzbot+efaea991addfdcc5abd4@syzkaller.appspotmail.com
Reported-by: syzbot+15d1e19dff9209c2e40b@syzkaller.appspotmail.com

Revision 1.389: download - view: text, markup, annotated - select for diffs
Sun Jun 20 07:11:38 2021 UTC (3 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.388: preferred, colored
Changes since revision 1.388: +2 -7 lines
remove diag-only printf() that fires when an unlinked file is mmapped
and someone runs ps(1) or similar.

Revision 1.388: download - view: text, markup, annotated - select for diffs
Sat Apr 17 21:37:21 2021 UTC (3 years, 7 months ago) by mrg
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Diff to: previous 1.387: preferred, colored
Changes since revision 1.387: +2 -5 lines
fix error in previous: UVMHIST_PDHIST_SIZE needs to stay next to pdhistbuf[].

Revision 1.386.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 17 17:26:22 2021 UTC (3 years, 7 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.386: preferred, colored; next MAIN 1.387: preferred, colored
Changes since revision 1.386: +3 -7 lines
Sync with HEAD.

Revision 1.387: download - view: text, markup, annotated - select for diffs
Sat Apr 17 01:53:58 2021 UTC (3 years, 7 months ago) by mrg
Branches: MAIN
CVS tags: thorpej-cfargs-base
Diff to: previous 1.386: preferred, colored
Changes since revision 1.386: +3 -7 lines
remove KERNHIST_INIT_STATIC().  it stradles the line between usable
early in boot and broken early in boot by requiring a partly static
structure with another structure that must be present by the time
any uses are performed.  theoretically platform code could allocate
a chunk while seting up memory and assign it here, giving a dynamic
sizing for the entry list, but the reality is that all users have
a statically allocated entry list as well.

the existing KERNHIST_LINK_STATIC() is used in conjunction with
KERNHIST_INITIALIZER() instead.

this stops a NULL pointer deref when the _LOG() macro is called
before the storage is linked in, which happens with GCC 10 on OCTEON
with UVMHIST enabled, crashing in very early kernel init.

Revision 1.385.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:29:03 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.385: preferred, colored; next MAIN 1.386: preferred, colored
Changes since revision 1.385: +7 -7 lines
Sync with HEAD.

Revision 1.386: download - view: text, markup, annotated - select for diffs
Sat Mar 13 15:29:55 2021 UTC (3 years, 8 months ago) by skrll
Branches: MAIN
CVS tags: thorpej-futex-base
Branch point for: thorpej-cfargs
Diff to: previous 1.385: preferred, colored
Changes since revision 1.385: +7 -7 lines
Consistently use %#jx instead of 0x%jx or just %jx in UVMHIST_LOG formats

Revision 1.385: download - view: text, markup, annotated - select for diffs
Thu Jul 9 05:57:15 2020 UTC (4 years, 4 months ago) by skrll
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.384: preferred, colored
Changes since revision 1.384: +48 -61 lines
Consistently use UVMHIST(__func__)

Convert UVMHIST_{CALLED,LOG} into UVMHIST_CALLARGS

Revision 1.384: download - view: text, markup, annotated - select for diffs
Sat May 30 08:50:31 2020 UTC (4 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.383: preferred, colored
Changes since revision 1.383: +6 -7 lines
Avoid passing file paths in panic strings, this results in extra long
output that is annoying and that syzbot classifies as independent reports
due to the instances having different build paths.

Revision 1.383: download - view: text, markup, annotated - select for diffs
Sat May 9 15:13:19 2020 UTC (4 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.382: preferred, colored
Changes since revision 1.382: +46 -22 lines
Make the uvm_voaddr structure more compact, only occupying 2 pointers
worth of space, by encoding the type in the lower bits of the object
pointer.

Revision 1.382: download - view: text, markup, annotated - select for diffs
Thu Apr 30 04:18:07 2020 UTC (4 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.381: preferred, colored
Changes since revision 1.381: +9 -8 lines
- In uvm_voaddr_acquire(), take an extra hold on the anon lock obj.
- In uvm_voaddr_release(), if the anon ref count drops to 0, call
  uvm_anfree() rather than uvm_anon_release().  Unconditionally drop
  the anon lock, and release the extra hold on the anon lock obj.

Fixes a panic that occurs if the backing store for a futex backed by
an anon memory location is unmapped while a thread is waiting in the
futex.

Add a test case that reproduced the panic to verify that it's fixed.

Revision 1.354.4.3: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:46 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.354.4.2: preferred, colored; branchpoint 1.354: preferred, colored; next MAIN 1.355: preferred, colored
Changes since revision 1.354.4.2: +266 -2 lines
Sync with HEAD

Revision 1.377.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 11:29:14 2020 UTC (4 years, 7 months ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.377: preferred, colored; next MAIN 1.378: preferred, colored
Changes since revision 1.377: +284 -5 lines
Sync with HEAD

Revision 1.381: download - view: text, markup, annotated - select for diffs
Sun Apr 19 08:59:53 2020 UTC (4 years, 7 months ago) by skrll
Branches: MAIN
CVS tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Diff to: previous 1.380: preferred, colored
Changes since revision 1.380: +3 -3 lines
Fix UVMHIST_LOG compile on 32bit platforms

Revision 1.380: download - view: text, markup, annotated - select for diffs
Sat Apr 18 17:22:26 2020 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.379: preferred, colored
Changes since revision 1.379: +8 -8 lines
Fix trailing whitespace.

Revision 1.379: download - view: text, markup, annotated - select for diffs
Sat Apr 18 03:27:13 2020 UTC (4 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.378: preferred, colored
Changes since revision 1.378: +266 -2 lines
Add an API to get a reference on the identity of an individual byte of
virtual memory, a "virtual object address".  This is not a reference to
a physical byte of memory, per se, but a reference to a byte residing
in a page, owned by a unique UVM object (either a uobj or an anon).  Two
separate address+addresses space tuples that reference the same byte in
an object (such as a location in a shared memory segment) will resolve
to equivalent virtual object addresses.  Even if the residency status
of the page changes, the virtual object address remains unchanged.

struct uvm_voaddr -- a structure that encapsulates this address reference.

uvm_voaddr_acquire() -- a function to acquire this address reference,
given a vm_map and a vaddr_t.

uvm_voaddr_release() -- a function to release this address reference.

uvm_voaddr_compare() -- a function to compare two such address references.

uvm_voaddr_acquire() resolves the COW status of the object address before
acquiring.

In collaboration with riastradh@ and chs@.

Revision 1.354.4.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:05:21 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.354.4.1: preferred, colored; branchpoint 1.354: preferred, colored
Changes since revision 1.354.4.1: +138 -159 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.378: download - view: text, markup, annotated - select for diffs
Fri Apr 10 17:26:46 2020 UTC (4 years, 7 months ago) by ad
Branches: MAIN
CVS tags: phil-wifi-20200411
Diff to: previous 1.377: preferred, colored
Changes since revision 1.377: +19 -4 lines
uvmspace_exec(): set VM_MAP_DYING for the duration, so pmap_update() is not
called until the pmap has been totally cleared out after pmap_remove_all(),
or it can confuse some pmap implementations.

Revision 1.377: download - view: text, markup, annotated - select for diffs
Sat Apr 4 21:17:02 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
CVS tags: phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Diff to: previous 1.376: preferred, colored
Changes since revision 1.376: +4 -3 lines
Mark uvm_map_entry_cache with PR_LARGECACHE.

Revision 1.376: download - view: text, markup, annotated - select for diffs
Sun Mar 22 18:32:42 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
Diff to: previous 1.375: preferred, colored
Changes since revision 1.375: +18 -2 lines
Process concurrent page faults on individual uvm_objects / vm_amaps in
parallel, where the relevant pages are already in-core.  Proposed on
tech-kern.

Temporarily disabled on MP architectures with __HAVE_UNLOCKED_PMAP until
adjustments are made to their pmaps.

Revision 1.375: download - view: text, markup, annotated - select for diffs
Fri Mar 20 19:08:54 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
Diff to: previous 1.374: preferred, colored
Changes since revision 1.374: +5 -7 lines
Go back to freeing struct vm_anon one by one.  There may have been an
advantage circa ~2008 but there isn't now.

Revision 1.374: download - view: text, markup, annotated - select for diffs
Sat Mar 14 17:29:53 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
Diff to: previous 1.373: preferred, colored
Changes since revision 1.373: +3 -2 lines
uvm_map_lookup_entry(): save the hint even on failure, since code elsewhere
relies on it pointing to the previous entry.

Revision 1.373: download - view: text, markup, annotated - select for diffs
Sat Mar 14 14:15:43 2020 UTC (4 years, 8 months ago) by ad
Branches: MAIN
Diff to: previous 1.372: preferred, colored
Changes since revision 1.372: +35 -90 lines
- uvmspace_exec(), uvmspace_free(): if pmap_remove_all() returns true the
  pmap is emptied.  Pass UVM_FLAG_VAONLY when clearing out the map and avoid
  needless extra work to tear down each mapping individually.

- uvm_map_lookup_entry(): remove the code to do a linear scan of map entries
  for small maps, in preference to using the RB tree.  It's questionable,
  and I think the code is almost never triggered because the average number
  of map entries has probably exceeded the hard-coded threshold for quite
  some time.

- vm_map_entry: get it aligned on a cacheline boundary, and cluster fields
  used during rbtree lookup at the beginning.

Revision 1.370.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:21:11 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.370.2.1: preferred, colored; branchpoint 1.370: preferred, colored; next MAIN 1.371: preferred, colored
Changes since revision 1.370.2.1: +12 -12 lines
Sync with head.

Revision 1.372: download - view: text, markup, annotated - select for diffs
Sun Feb 23 15:46:43 2020 UTC (4 years, 9 months ago) by ad
Branches: MAIN
CVS tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Diff to: previous 1.371: preferred, colored
Changes since revision 1.371: +12 -12 lines
UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.

Revision 1.370.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:47:38 2020 UTC (4 years, 10 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.370: preferred, colored
Changes since revision 1.370: +21 -28 lines
Sync with head.

Revision 1.371: download - view: text, markup, annotated - select for diffs
Sun Jan 12 17:46:55 2020 UTC (4 years, 10 months ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base2, ad-namecache-base1
Diff to: previous 1.370: preferred, colored
Changes since revision 1.370: +21 -28 lines
- uvm_unmap_remove(): need to call pmap_update() with the object still
  locked, otherwise the page could gain a new identity and still be visible
  via a stale mapping.

- Adjust reference counts with atomics.

Revision 1.370: download - view: text, markup, annotated - select for diffs
Sun Jan 5 15:57:15 2020 UTC (4 years, 11 months ago) by para
Branches: MAIN
CVS tags: ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.369: preferred, colored
Changes since revision 1.369: +2 -16 lines
remove unused predicate function

likely unused since kmem changes

Revision 1.369: download - view: text, markup, annotated - select for diffs
Tue Dec 31 22:42:51 2019 UTC (4 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.368: preferred, colored
Changes since revision 1.368: +4 -2 lines
- Add and use wrapper functions that take and acquire page interlocks, and pairs
  of page interlocks.  Require that the page interlock be held over calls to
  uvm_pageactivate(), uvm_pagewire() and similar.

- Solve the concurrency problem with page replacement state.  Rather than
  updating the global state synchronously, set an intended state on
  individual pages (active, inactive, enqueued, dequeued) while holding the
  page interlock.  After the interlock is released put the pages on a 128
  entry per-CPU queue for their state changes to be made real in batch.
  This results in in a ~400 fold decrease in contention on my test system.
  Proposed on tech-kern but modified to use the page interlock rather than
  atomics to synchronise as it's much easier to maintain that way, and
  cheaper.

Revision 1.368: download - view: text, markup, annotated - select for diffs
Fri Dec 27 10:17:57 2019 UTC (4 years, 11 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.367: preferred, colored
Changes since revision 1.367: +3 -3 lines
s/referece/reference/ in comment.

Revision 1.367: download - view: text, markup, annotated - select for diffs
Fri Dec 13 20:10:22 2019 UTC (4 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.366: preferred, colored
Changes since revision 1.366: +2 -5 lines
Break the global uvm_pageqlock into a per-page identity lock and a private
lock for use of the pagedaemon policy code.  Discussed on tech-kern.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour

Revision 1.362.2.2: download - view: text, markup, annotated - select for diffs
Fri Nov 1 18:24:31 2019 UTC (5 years, 1 month ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.362.2.1: preferred, colored; branchpoint 1.362: preferred, colored
Changes since revision 1.362.2.1: +4 -3 lines
Addionally pull up the following revision for ticket #388:

	sys/uvm/uvm_map.c			1.366

Fix previous; semantics of align argument of uvm_map() is different
when UVM_FLAG_COLORMATCH is specified.

Should fix PR kern/54669.

Revision 1.366: download - view: text, markup, annotated - select for diffs
Fri Nov 1 13:04:22 2019 UTC (5 years, 1 month ago) by rin
Branches: MAIN
CVS tags: phil-wifi-20191119
Diff to: previous 1.365: preferred, colored
Changes since revision 1.365: +4 -3 lines
Fix previous; semantics of align argument of uvm_map() is different
when UVM_FLAG_COLORMATCH is specified.

Should fix PR kern/54669.

Revision 1.362.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 1 09:36:32 2019 UTC (5 years, 1 month ago) by martin
Branches: netbsd-9
Diff to: previous 1.362: preferred, colored
Changes since revision 1.362: +30 -10 lines
Pull up following revision(s) (requested by rin in ticket #388):

	sys/uvm/uvm_map.c: revision 1.365

PR kern/54395

- Align hint for virtual address at the beginning of uvm_map() if
   required. Otherwise, it will be rounded up/down in an unexpected
   way by uvm_map_space_avail(), which results in assertion failure.
   Fix kernel panic when executing earm binary (8KB pages) on aarch64
   (4KB pages), which relies on mmap(2) with MAP_ALIGNED flag.
- Use inline functions/macros consistently.
- Add some more KASSERT's.

For more details, see the PR as well as discussion on port-kern:
http://mail-index.netbsd.org/tech-kern/2019/10/27/msg025629.html

Revision 1.365: download - view: text, markup, annotated - select for diffs
Fri Nov 1 08:26:18 2019 UTC (5 years, 1 month ago) by rin
Branches: MAIN
Diff to: previous 1.364: preferred, colored
Changes since revision 1.364: +30 -10 lines
PR kern/54395

- Align hint for virtual address at the beginning of uvm_map() if
  required. Otherwise, it will be rounded up/down in an unexpected
  way by uvm_map_space_avail(), which results in assertion failure.

  Fix kernel panic when executing earm binary (8KB pages) on aarch64
  (4KB pages), which relies on mmap(2) with MAP_ALIGNED flag.

- Use inline functions/macros consistently.

- Add some more KASSERT's.

For more details, see the PR as well as discussion on port-kern:
http://mail-index.netbsd.org/tech-kern/2019/10/27/msg025629.html

Revision 1.364: download - view: text, markup, annotated - select for diffs
Sat Aug 10 01:06:45 2019 UTC (5 years, 3 months ago) by mrg
Branches: MAIN
Diff to: previous 1.363: preferred, colored
Changes since revision 1.363: +5 -3 lines
KASSERT -> KASSERTMSG so we actually display the overflowed values.

Revision 1.351.2.3: download - view: text, markup, annotated - select for diffs
Sun Aug 4 11:08:51 2019 UTC (5 years, 4 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-2-RELEASE
Diff to: previous 1.351.2.2: preferred, colored; branchpoint 1.351: preferred, colored
Changes since revision 1.351.2.2: +3 -3 lines
Pull up following revision(s) (requested by maxv in ticket #1320):

	sys/uvm/uvm_map.c: revision 1.361

Fix info leak: 'map_attrib' is not used in UVM, and contains uninitialized
heap garbage. Return zero. Maybe we should remove the field completely.

Revision 1.363: download - view: text, markup, annotated - select for diffs
Thu Aug 1 02:28:55 2019 UTC (5 years, 4 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.362: preferred, colored
Changes since revision 1.362: +3 -3 lines
Remove last trace of never-used map_attrib.

Revision 1.362: download - view: text, markup, annotated - select for diffs
Fri Jul 12 06:27:13 2019 UTC (5 years, 4 months ago) by mlelstv
Branches: MAIN
CVS tags: netbsd-9-base
Branch point for: netbsd-9
Diff to: previous 1.361: preferred, colored
Changes since revision 1.361: +4 -2 lines
Add missing lock around pmap_protect.
ok, chs@

Reported-by: syzbot+6bfd0be70896fc9e9a3d@syzkaller.appspotmail.com

Revision 1.361: download - view: text, markup, annotated - select for diffs
Thu Jul 11 17:07:10 2019 UTC (5 years, 4 months ago) by maxv
Branches: MAIN
Diff to: previous 1.360: preferred, colored
Changes since revision 1.360: +3 -3 lines
Fix info leak: 'map_attrib' is not used in UVM, and contains uninitialized
heap garbage. Return zero. Maybe we should remove the field completely.

Revision 1.354.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:58 2019 UTC (5 years, 5 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +27 -17 lines
Sync with HEAD

Revision 1.360: download - view: text, markup, annotated - select for diffs
Sat Jun 8 23:48:33 2019 UTC (5 years, 5 months ago) by chs
Branches: MAIN
CVS tags: phil-wifi-20190609
Diff to: previous 1.359: preferred, colored
Changes since revision 1.359: +13 -2 lines
in uvm_map_protect(), do a pmap_update() before possibly switching from
removing pmap entries to creating them.  this fixes the problem reported in
https://syzkaller.appspot.com/bug?id=cc89e47f05e4eea2fd69bcccb5e837f8d1ab4d60

Revision 1.359: download - view: text, markup, annotated - select for diffs
Thu Mar 14 19:10:04 2019 UTC (5 years, 8 months ago) by kre
Branches: MAIN
CVS tags: isaki-audio2-base, isaki-audio2
Diff to: previous 1.358: preferred, colored
Changes since revision 1.358: +10 -2 lines
Avoid a panic from the sequence

	mlock(buf, 0);
	munlock(buf, 0);
	mlock(buf, page);
	munlock(buf, page);

where buf is page aligned, and page is actually anything > 0
(but not too big) which will get rounded up to the next multiple
of the page size.

In that sequence, it is possible that the 1st munlock() is optional.

Add a KASSERT() (or two) to detect the first effects of the problem
(without that, or in !DIAGNOSTIC kernels) the problem eventually
causes some kind of problem or other (most often still a panic.)

After this, mlock(anything, 0) (or munlock) validates "anything"
but is otherwise a no-op (regardless of the alignment of anything).

Also, don't treat mlock(buf, verybig) as equivalent to mlock(buf, 0)
which is (more or less) what we had been doing.

XXX pullup -8 (maybe -7 as well, need to check).

Revision 1.358: download - view: text, markup, annotated - select for diffs
Sun Mar 3 17:37:36 2019 UTC (5 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.357: preferred, colored
Changes since revision 1.357: +6 -6 lines
Fix bug, the entry we're iterating on is 'current', not 'entry'. Here only
the first entry gets wired in.

Revision 1.354.2.3: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:02:08 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.354.2.2: preferred, colored; branchpoint 1.354: preferred, colored; next MAIN 1.355: preferred, colored
Changes since revision 1.354.2.2: +3 -3 lines
Sync with HEAD, resolve a few conflicts

Revision 1.357: download - view: text, markup, annotated - select for diffs
Mon Dec 17 06:53:01 2018 UTC (5 years, 11 months ago) by kamil
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Diff to: previous 1.356: preferred, colored
Changes since revision 1.356: +3 -3 lines
Raise the fill_vmentries() E2BIG limit from 1MB to 10MB

The previous limit was not enough for libFuzzer as it requires up to 2.5MB
in test-suite.

Alternative approaches to retrieve larger address map during happened to be
worse during the evaluation due to difficulties in locking and atomicity.

Discussed with <christos>

Revision 1.354.2.2: download - view: text, markup, annotated - select for diffs
Sun Sep 30 01:45:58 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.354.2.1: preferred, colored; branchpoint 1.354: preferred, colored
Changes since revision 1.354.2.1: +2 -11 lines
Ssync with HEAD

Revision 1.356: download - view: text, markup, annotated - select for diffs
Wed Sep 12 15:58:08 2018 UTC (6 years, 2 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930
Diff to: previous 1.355: preferred, colored
Changes since revision 1.355: +2 -11 lines
Remove this check, it has never protected against mmap on page zero, and
has since been replaced by the code in exec_vm_minaddr.

Revision 1.354.2.1: download - view: text, markup, annotated - select for diffs
Thu Sep 6 06:56:48 2018 UTC (6 years, 3 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +3 -3 lines
Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.355: download - view: text, markup, annotated - select for diffs
Mon Sep 3 16:29:37 2018 UTC (6 years, 3 months ago) by riastradh
Branches: MAIN
CVS tags: pgoyette-compat-0906
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +3 -3 lines
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.354: download - view: text, markup, annotated - select for diffs
Tue Feb 6 09:20:29 2018 UTC (6 years, 9 months ago) by mrg
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Diff to: previous 1.353: preferred, colored
Changes since revision 1.353: +3 -3 lines
uvm_map_extract() has an indentation issue.

Revision 1.322.2.4: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:39:22 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.322.2.3: preferred, colored; next MAIN 1.323: preferred, colored
Changes since revision 1.322.2.3: +385 -97 lines
update from HEAD

Revision 1.351.2.2: download - view: text, markup, annotated - select for diffs
Thu Nov 2 21:29:53 2017 UTC (7 years, 1 month ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.351.2.1: preferred, colored; branchpoint 1.351: preferred, colored
Changes since revision 1.351.2.1: +66 -59 lines
Pull up following revision(s) (requested by pgoyette in ticket #335):
	share/man/man9/kernhist.9: 1.5-1.8
	sys/arch/acorn26/acorn26/pmap.c: 1.39
	sys/arch/arm/arm32/fault.c: 1.105 via patch
	sys/arch/arm/arm32/pmap.c: 1.350, 1.359
	sys/arch/arm/broadcom/bcm2835_bsc.c: 1.7
	sys/arch/arm/omap/if_cpsw.c: 1.20
	sys/arch/arm/omap/tiotg.c: 1.7
	sys/arch/evbarm/conf/RPI2_INSTALL: 1.3
	sys/dev/ic/sl811hs.c: 1.98
	sys/dev/usb/ehci.c: 1.256
	sys/dev/usb/if_axe.c: 1.83
	sys/dev/usb/motg.c: 1.18
	sys/dev/usb/ohci.c: 1.274
	sys/dev/usb/ucom.c: 1.119
	sys/dev/usb/uhci.c: 1.277
	sys/dev/usb/uhub.c: 1.137
	sys/dev/usb/umass.c: 1.160-1.162
	sys/dev/usb/umass_quirks.c: 1.100
	sys/dev/usb/umass_scsipi.c: 1.55
	sys/dev/usb/usb.c: 1.168
	sys/dev/usb/usb_mem.c: 1.70
	sys/dev/usb/usb_subr.c: 1.221
	sys/dev/usb/usbdi.c: 1.175
	sys/dev/usb/usbdi_util.c: 1.67-1.70
	sys/dev/usb/usbroothub.c: 1.3
	sys/dev/usb/xhci.c: 1.75
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.34
	sys/kern/kern_history.c: 1.15
	sys/kern/kern_xxx.c: 1.74
	sys/kern/vfs_bio.c: 1.275-1.276
	sys/miscfs/genfs/genfs_io.c: 1.71
	sys/sys/kernhist.h: 1.21
	sys/ufs/ffs/ffs_balloc.c: 1.63
	sys/ufs/lfs/lfs_vfsops.c: 1.361
	sys/ufs/lfs/ulfs_inode.c: 1.21
	sys/ufs/lfs/ulfs_vnops.c: 1.52
	sys/ufs/ufs/ufs_inode.c: 1.102
	sys/ufs/ufs/ufs_vnops.c: 1.239
	sys/uvm/pmap/pmap.c: 1.37-1.39
	sys/uvm/pmap/pmap_tlb.c: 1.22
	sys/uvm/uvm_amap.c: 1.108
	sys/uvm/uvm_anon.c: 1.64
	sys/uvm/uvm_aobj.c: 1.126
	sys/uvm/uvm_bio.c: 1.91
	sys/uvm/uvm_device.c: 1.66
	sys/uvm/uvm_fault.c: 1.201
	sys/uvm/uvm_km.c: 1.144
	sys/uvm/uvm_loan.c: 1.85
	sys/uvm/uvm_map.c: 1.353
	sys/uvm/uvm_page.c: 1.194
	sys/uvm/uvm_pager.c: 1.111
	sys/uvm/uvm_pdaemon.c: 1.109
	sys/uvm/uvm_swap.c: 1.175
	sys/uvm/uvm_vnode.c: 1.103
	usr.bin/vmstat/vmstat.c: 1.219
Reorder to test for null before null deref in debug code
--
Reorder to test for null before null deref in debug code
--
KNF
--
No need for '\n' in UVMHIST_LOG
--
normalise a BIOHIST log message
--
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
   the kernel and in the structures used for exporting the history data
   to userland via sysctl(9).  This avoids problems on some architectures
   where passing a 64-bit (or larger) value to printf(3) can cause it to
   process the value as multiple arguments.  (This can be particularly
   problematic when printf()'s format string is not a literal, since in
   that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
   include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
   updated.  Each format specifier now includes an explicit length
   modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
   updated to replace uses of "%p" with "%#jx", and the pointer
   arguments are now cast to (uintptr_t) before being subsequently cast
   to (uintmax_t).  This is needed to avoid compiler warnings about
   casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
   "%c" format strings replaced with numeric formats; several instances
   of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
   history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
   the -u option does not exist (previously, this condition was silently
   ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
   data exported via sysctl(9) and exits if they do not match the values
   with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
   requirements imposed on the format strings, along with several other
   minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
     uint64_t) for the history arguments.  But that would require another
     "rototill" of all the users in the future when we add support for an
     architecture that supports a larger size.  Also, the printf(3)
format
     specifiers for explicitly-sized values, such as "%"PRIu64, are much
     more verbose (and less aesthetically appealing, IMHO) than simply
     using "%ju".
[2] I've tried very hard to find "all [the] existing users of
kernhist(9)"
     but it is possible that I've missed some of them.  I would be glad
to
     update any stragglers that anyone identifies.
--
For some reason this single kernel seems to have outgrown its declared
size as a result of the kernhist(9) changes.  Bump the size.
XXX The amount of increase may be excessive - anyone with more detailed
XXX knowledge please feel free to further adjust the value
appropriately.
--
Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit
--
And yet another one.  :(
--
Use correct mark-up for NetBSD version.
--
More improvements in grammar and readability.
--
Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
--
And replace an instance of "%p" conversion with "%#jx"
--
Whitespace fix. Give Bl tag table a width. Fix Xr.

Revision 1.353: download - view: text, markup, annotated - select for diffs
Sat Oct 28 00:37:13 2017 UTC (7 years, 1 month ago) by pgoyette
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Diff to: previous 1.352: preferred, colored
Changes since revision 1.352: +66 -59 lines
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.

Revision 1.351.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 1 10:20:03 2017 UTC (7 years, 2 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.351: preferred, colored
Changes since revision 1.351: +4 -4 lines
Pull up following revision(s) (requested by pgoyette in ticket #294):
	sys/uvm/uvm_map.c: revision 1.352
Fix user-triggerable kernel crash as reported in PR kern/52573 (from
Bruno Haible).

Revision 1.352: download - view: text, markup, annotated - select for diffs
Sun Oct 1 01:45:02 2017 UTC (7 years, 2 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.351: preferred, colored
Changes since revision 1.351: +4 -4 lines
Fix user-triggerable kernel crash as reported in PR kern/52573 (from
Bruno Haible).

XXX Pull-up to netbsd-8

Revision 1.331.2.8: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:17 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.7: preferred, colored; branchpoint 1.331: preferred, colored; next MAIN 1.332: preferred, colored
Changes since revision 1.331.2.7: +94 -17 lines
Sync with HEAD

Revision 1.351: download - view: text, markup, annotated - select for diffs
Tue May 30 17:09:17 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base
Branch point for: netbsd-8
Diff to: previous 1.350: preferred, colored
Changes since revision 1.350: +4 -2 lines
add assertions that would have caught the recent audio mmap bugs.

Revision 1.350: download - view: text, markup, annotated - select for diffs
Tue May 23 22:18:17 2017 UTC (7 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.349: preferred, colored
Changes since revision 1.349: +4 -4 lines
sprinkle __diagused to fix the powerpc build, which is not DIAGNOSTIC.

Revision 1.349: download - view: text, markup, annotated - select for diffs
Sat May 20 07:27:15 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
Diff to: previous 1.348: preferred, colored
Changes since revision 1.348: +10 -8 lines
MAP_FIXED means something different for mremap() than it does for mmap(),
so we cannot use UVM_FLAG_FIXED to specify both behaviors.
keep UVM_FLAG_FIXED with its earlier meaning (prior to my previous change)
of whether to use uvm_map_findspace() to locate space for the new mapping or
to use the hint address that the caller passed in, and add a new flag
UVM_FLAG_UNMAP to indicate that any existing entries in the range should be
unmapped as part of creating the new mapping.  the new UVM_FLAG_UNMAP flag
may only be used if UVM_FLAG_FIXED is also specified.

Revision 1.348: download - view: text, markup, annotated - select for diffs
Fri May 19 16:56:35 2017 UTC (7 years, 6 months ago) by kamil
Branches: MAIN
Diff to: previous 1.347: preferred, colored
Changes since revision 1.347: +3 -3 lines
Add missing , to fix syntax

Unbreaks build after recent change adding a message for vm.user_va0_disable

Revision 1.347: download - view: text, markup, annotated - select for diffs
Fri May 19 15:30:19 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
Diff to: previous 1.346: preferred, colored
Changes since revision 1.346: +48 -6 lines
make MAP_FIXED mapping operations atomic. fixes PR 52239.
previously, unmapping any entries being replaced was done separately
from entering the new mapping, which allowed another thread doing
a non-MAP_FIXED mapping to allocate the range out from under the
MAP_FIXED thread.

Revision 1.346: download - view: text, markup, annotated - select for diffs
Fri May 19 14:42:00 2017 UTC (7 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.345: preferred, colored
Changes since revision 1.345: +4 -5 lines
mention the man page instead of the command.

Revision 1.345: download - view: text, markup, annotated - select for diffs
Fri May 19 14:38:46 2017 UTC (7 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.344: preferred, colored
Changes since revision 1.344: +7 -3 lines
Provide a helpful message to the user trying to run an birary that needs page
0 access.

Revision 1.343.4.1: download - view: text, markup, annotated - select for diffs
Thu May 11 02:58:42 2017 UTC (7 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.343: preferred, colored; next MAIN 1.344: preferred, colored
Changes since revision 1.343: +22 -2 lines
Sync with HEAD

Revision 1.344: download - view: text, markup, annotated - select for diffs
Sat May 6 21:34:52 2017 UTC (7 years, 7 months ago) by joerg
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2
Diff to: previous 1.343: preferred, colored
Changes since revision 1.343: +22 -2 lines
Extend the mmap(2) interface to allow requesting protections for later
use with mprotect(2), but without enabling them immediately.

Extend the mremap(2) interface to allow duplicating mappings, i.e.
create a second range of virtual addresses references the same physical
pages. Duplicated mappings can have different effective protections.

Adjust PAX mprotect logic to disallow effective protections of W&X, but
allow one mapping W and another X protections. This obsoletes using
temporary files for purposes like JIT.

Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested
and not silently drop the X protection.

Improve test cases to ensure correct operation of the changed
interfaces.

Revision 1.342.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:09 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.342: preferred, colored; next MAIN 1.343: preferred, colored
Changes since revision 1.342: +20 -12 lines
Sync with HEAD

Revision 1.340.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:54 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.340.2.1: preferred, colored; branchpoint 1.340: preferred, colored; next MAIN 1.341: preferred, colored
Changes since revision 1.340.2.1: +20 -12 lines
Sync with HEAD

Revision 1.343: download - view: text, markup, annotated - select for diffs
Wed Mar 15 20:25:41 2017 UTC (7 years, 8 months ago) by christos
Branches: MAIN
CVS tags: prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: prg-localcount2
Diff to: previous 1.342: preferred, colored
Changes since revision 1.342: +20 -12 lines
PR/52078: Don't panic on 0 allocation, check more bounds.

Revision 1.340.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:53 2017 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.340: preferred, colored
Changes since revision 1.340: +10 -4 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.331.2.7: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:30 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.6: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.6: +10 -4 lines
Sync with HEAD

Revision 1.342: download - view: text, markup, annotated - select for diffs
Thu Dec 1 02:09:03 2016 UTC (8 years ago) by mrg
Branches: MAIN
CVS tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, nick-nhusb-base-20161204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.341: preferred, colored
Changes since revision 1.341: +10 -4 lines
allow the sizes of the maphist and pdhist to be set in the config
file via UVMHIST_MAPHIST_SIZE and UVMHIST_PDHIST_SIZE.

Revision 1.331.2.6: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:12 2016 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.5: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.5: +3 -3 lines
Sync with HEAD

Revision 1.341: download - view: text, markup, annotated - select for diffs
Sat Aug 6 15:13:14 2016 UTC (8 years, 4 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161004, localcount-20160914
Diff to: previous 1.340: preferred, colored
Changes since revision 1.340: +3 -3 lines
The way the kernel tries to prevent a userland process from allocating page
zero is hugely flawed. It is easy to demonstrate that one can trick UVM
into chosing a NULL hint after the user_va0_disable check from uvm_map.
Such a bypass allows kernel NULL pointer dereferences to be exploitable on
architectures with a shared userland<->kernel VA, like amd64.

Fix this by increasing the limit of the vm space made available for
userland processes. This way, UVM will never chose a NULL hint, since it
would be outside of the vm space.

The user_va0_disable sysctl still controls this feature.

Revision 1.331.2.5: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:25 2016 UTC (8 years, 4 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.4: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.4: +31 -12 lines
Sync with HEAD

Revision 1.340: download - view: text, markup, annotated - select for diffs
Thu Jul 7 06:55:44 2016 UTC (8 years, 5 months ago) by msaitoh
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Diff to: previous 1.339: preferred, colored
Changes since revision 1.339: +3 -3 lines
KNF. Remove extra spaces. No functional change.

Revision 1.339: download - view: text, markup, annotated - select for diffs
Sat Jun 18 14:56:03 2016 UTC (8 years, 5 months ago) by martin
Branches: MAIN
Diff to: previous 1.338: preferred, colored
Changes since revision 1.338: +6 -4 lines
Change two KASSERT to KASSERTMSG to provide better diagnostics.

Revision 1.338: download - view: text, markup, annotated - select for diffs
Wed Jun 1 00:49:44 2016 UTC (8 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.337: preferred, colored
Changes since revision 1.337: +27 -10 lines
Avoid locking issues when copying out requires taking a fault and we are
finding out our own maps, by allocating a buffer and copying out after
we collected the information.

Revision 1.331.2.4: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:40 2016 UTC (8 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.3: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.3: +11 -5 lines
Sync with HEAD

Revision 1.337: download - view: text, markup, annotated - select for diffs
Wed May 25 17:43:58 2016 UTC (8 years, 6 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20160529
Diff to: previous 1.336: preferred, colored
Changes since revision 1.336: +11 -5 lines
Introduce security.pax.mprotect.ptrace sysctl which can be used to bypass
mprotect settings so that debuggers can write to the text segment of traced
processes so that they can insert breakpoints. Turned off by default.
Ok: chuq (for now)

Revision 1.331.2.3: download - view: text, markup, annotated - select for diffs
Sun Dec 27 12:10:19 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.2: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.2: +185 -19 lines
Sync with HEAD (as of 26th Dec)

Revision 1.336: download - view: text, markup, annotated - select for diffs
Thu Nov 5 00:10:48 2015 UTC (9 years, 1 month ago) by pgoyette
Branches: MAIN
CVS tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Diff to: previous 1.335: preferred, colored
Changes since revision 1.335: +18 -17 lines
Now that SYSVSHM is modularized, reattach the linkages from uvm so that
we can correctly clean up on process exit or fork.

Without this, firefox attaches to a shared memory segment but doesn't
detach before exit.  Thus once firefox causes an autoload for sysv_ipc
it cannot be unloaded since the segment still retains references.

Revision 1.335: download - view: text, markup, annotated - select for diffs
Thu Sep 24 14:35:15 2015 UTC (9 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.334: preferred, colored
Changes since revision 1.334: +169 -4 lines
implement VM_PROC_MAP

Revision 1.331.2.2: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:17 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331.2.1: preferred, colored; branchpoint 1.331: preferred, colored
Changes since revision 1.331.2.1: +48 -44 lines
Sync with HEAD

Revision 1.334: download - view: text, markup, annotated - select for diffs
Mon Jun 22 06:24:17 2015 UTC (9 years, 5 months ago) by matt
Branches: MAIN
CVS tags: nick-nhusb-base-20150921
Diff to: previous 1.333: preferred, colored
Changes since revision 1.333: +46 -42 lines
Use %p, %#xl etc. for pointers and addresses.

Revision 1.331.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:33 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.331: preferred, colored
Changes since revision 1.331: +7 -4 lines
Sync with HEAD

Revision 1.333: download - view: text, markup, annotated - select for diffs
Sun Feb 1 16:26:00 2015 UTC (9 years, 10 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.332: preferred, colored
Changes since revision 1.332: +4 -4 lines
The diagnostic function uvm_km_check_empty() takes a mutex, so don't call it
if we are using UVM_FLAG_NOWAIT.

Revision 1.330.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 23 16:31:06 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Diff to: previous 1.330: preferred, colored; next MAIN 1.331: preferred, colored
Changes since revision 1.330: +5 -2 lines
Pull up following revision(s) (requested by chs in ticket #447):
	sys/uvm/uvm_map.c: revision 1.332
skip busy anon pages in uvm_map_clean().
we shouldn't be messing with pages that someone else has busy,
and uvm_map_clean() is just advisory for amap mappings.

Revision 1.332: download - view: text, markup, annotated - select for diffs
Fri Jan 23 16:13:53 2015 UTC (9 years, 10 months ago) by chs
Branches: MAIN
Diff to: previous 1.331: preferred, colored
Changes since revision 1.331: +5 -2 lines
skip busy anon pages in uvm_map_clean().
we shouldn't be messing with pages that someone else has busy,
and uvm_map_clean() is just advisory for amap mappings.

Revision 1.331: download - view: text, markup, annotated - select for diffs
Sun Oct 26 01:42:07 2014 UTC (10 years, 1 month ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.330: preferred, colored
Changes since revision 1.330: +4 -4 lines
Define UVMDEBUG for expensive debugging operations. Idea from chuq.

Revision 1.322.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:45 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.322.2.2: preferred, colored
Changes since revision 1.322.2.2: +224 -182 lines
Rebase to HEAD as of a few days ago.

Revision 1.328.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:57:00 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.328: preferred, colored; next MAIN 1.329: preferred, colored
Changes since revision 1.328: +203 -164 lines
Rebase.

Revision 1.330: download - view: text, markup, annotated - select for diffs
Fri Jul 18 12:36:57 2014 UTC (10 years, 4 months ago) by christos
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.329: preferred, colored
Changes since revision 1.329: +33 -0 lines
Add MAP_INHERIT_ZERO

Revision 1.329: download - view: text, markup, annotated - select for diffs
Fri Jul 18 12:19:09 2014 UTC (10 years, 4 months ago) by christos
Branches: MAIN
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +170 -164 lines
Split out the minherit code into separate functions for readability (allows
us to indent them properly), and merge the new vm_map_entry creation into
a common function to avoid code duplication. No functional change.

Revision 1.305.2.5: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:19 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.305.2.4: preferred, colored; branchpoint 1.305: preferred, colored; next MAIN 1.306: preferred, colored
Changes since revision 1.305.2.4: +23 -20 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.324.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:22 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.324: preferred, colored; next MAIN 1.325: preferred, colored
Changes since revision 1.324: +23 -20 lines
sync with head

Revision 1.328: download - view: text, markup, annotated - select for diffs
Wed Mar 5 05:35:55 2014 UTC (10 years, 9 months ago) by matt
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.327: preferred, colored
Changes since revision 1.327: +5 -5 lines
Use UVMHIST_INITIALIZER (KERNHIST_INITIALIZER) to statically initialize
maphist.  This allows maphist to used very very early in boot well before
uvm has been initialized.

Revision 1.327: download - view: text, markup, annotated - select for diffs
Thu Nov 14 12:07:11 2013 UTC (11 years ago) by martin
Branches: MAIN
Diff to: previous 1.326: preferred, colored
Changes since revision 1.326: +17 -14 lines
As discussed on tech-kern: make TOPDOWN-VM runtime selectable per process
(offer MD code or emulations to override it).

Revision 1.326: download - view: text, markup, annotated - select for diffs
Fri Oct 25 20:25:25 2013 UTC (11 years, 1 month ago) by martin
Branches: MAIN
Diff to: previous 1.325: preferred, colored
Changes since revision 1.325: +4 -4 lines
Mark diagnostic-only variables

Revision 1.325: download - view: text, markup, annotated - select for diffs
Fri Oct 25 14:20:11 2013 UTC (11 years, 1 month ago) by martin
Branches: MAIN
Diff to: previous 1.324: preferred, colored
Changes since revision 1.324: +3 -3 lines
Some pmaps may not consume all arguments of pmap_copy()

Revision 1.305.2.4: download - view: text, markup, annotated - select for diffs
Wed Jan 16 05:33:56 2013 UTC (11 years, 10 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.305.2.3: preferred, colored; branchpoint 1.305: preferred, colored
Changes since revision 1.305.2.3: +7 -4 lines
sync with (a bit old) head

Revision 1.322.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 20 03:02:53 2012 UTC (12 years ago) by tls
Branches: tls-maxphys
Diff to: previous 1.322.2.1: preferred, colored
Changes since revision 1.322.2.1: +22 -25 lines
Resync to 2012-11-19 00:00:00 UTC

Revision 1.324: download - view: text, markup, annotated - select for diffs
Fri Nov 2 16:43:16 2012 UTC (12 years, 1 month ago) by matt
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Diff to: previous 1.323: preferred, colored
Changes since revision 1.323: +7 -4 lines
When uvm_io reserves kernel address space, make sure it's starts with the
same color as the user address space being copied.

Revision 1.313.2.3.2.1: download - view: text, markup, annotated - select for diffs
Thu Nov 1 16:45:06 2012 UTC (12 years, 1 month ago) by matt
Branches: matt-nb6-plus
Diff to: previous 1.313.2.3: preferred, colored; next MAIN 1.313.2.4: preferred, colored
Changes since revision 1.313.2.3: +2 -2 lines
sync with netbsd-6-0-RELEASE.

Revision 1.305.2.3: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:23:02 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.305.2.2: preferred, colored; branchpoint 1.305: preferred, colored
Changes since revision 1.305.2.2: +22 -25 lines
sync with head

Revision 1.323: download - view: text, markup, annotated - select for diffs
Mon Oct 29 16:00:05 2012 UTC (12 years, 1 month ago) by para
Branches: MAIN
CVS tags: yamt-pagecache-base6
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +17 -23 lines
get rid of not used uvm_map flag (UVM_MAP_KMAPENT)

Revision 1.322.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 12 06:15:35 2012 UTC (12 years, 2 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +11 -5 lines
Initial snapshot of work to eliminate 64K MAXPHYS.  Basically works for
physio (I/O to raw devices); needs more doing to get it going with the
filesystems, but it shouldn't damage data.

All work's been done on amd64 so far.  Not hard to add support to other
ports.  If others want to pitch in, one very helpful thing would be to
sort out when and how IDE disks can do 128K or larger transfers, and
adjust the various PCI IDE (or at least ahcisata) drivers and wd.c
accordingly -- it would make testing much easier.  Another very helpful
thing would be to implement a smart minphys() for RAIDframe along the
lines detailed in the MAXPHYS-NOTES file.

Revision 1.313.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 7 22:17:34 2012 UTC (12 years, 2 months ago) by riz
Branches: netbsd-6
CVS tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base
Diff to: previous 1.313.2.3: preferred, colored; branchpoint 1.313: preferred, colored; next MAIN 1.314: preferred, colored
Changes since revision 1.313.2.3: +2 -2 lines
Pull up following revision(s) (requested by para in ticket #547):
	sys/uvm/uvm_map.c: revision 1.320
	sys/uvm/uvm_map.c: revision 1.321
	sys/uvm/uvm_map.c: revision 1.322
	sys/uvm/uvm_km.c: revision 1.130
	sys/uvm/uvm_km.c: revision 1.131
	sys/uvm/uvm_km.c: revision 1.132
	sys/uvm/uvm_km.c: revision 1.133
	sys/uvm/uvm_km.c: revision 1.134
	sys/uvm/uvm_km.c: revision 1.135
	sys/uvm/uvm_km.c: revision 1.129
Fix a bug where the kernel was never grown to accomodate the kmem VA space
since that happens before the kernel_map is set.
Don't try grow the entire kmem space but just do as needed in
uvm_km_kmem_alloc
Shut up gcc printf warning.
Cleanup comment.  Change panic to KASSERTMSG.
Use kernel_map->misc_lock to make sure we don't call pmap_growkernel
concurrently and possibly mess up uvm_maxkaddr.
Switch to a spin lock (uvm_kentry_lock) which, fortunately, was
sitting there
unused.
Remove locking since it isn't needed.  As soon as the 2nd
uvm_map_entry in kernel_map
is created, uvm_map_prepare will call pmap_growkernel and the
pmap_growkernel call in
uvm_km_mem_alloc will never be called again.
call pmap_growkernel once after the kmem_arena is created
to make the pmap cover it's address space
assert on the growth in uvm_km_kmem_alloc
for the 3rd uvm_map_entry uvm_map_prepare will grow the kernel,
but we might call into uvm_km_kmem_alloc through imports to
the kmem_meta_arena earlier
while here guard uvm_km_va_starved_p from kmem_arena not yet created
thanks for tracking this down to everyone involved

Revision 1.322: download - view: text, markup, annotated - select for diffs
Tue Sep 4 13:37:42 2012 UTC (12 years, 3 months ago) by matt
Branches: MAIN
Branch point for: tls-maxphys
Diff to: previous 1.321: preferred, colored
Changes since revision 1.321: +2 -4 lines
Remove locking since it isn't needed.  As soon as the 2nd uvm_map_entry in kernel_map
is created, uvm_map_prepare will call pmap_growkernel and the pmap_growkernel call in
uvm_km_mem_alloc will never be called again.

Revision 1.321: download - view: text, markup, annotated - select for diffs
Mon Sep 3 19:53:42 2012 UTC (12 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.320: preferred, colored
Changes since revision 1.320: +4 -4 lines
Switch to a spin lock (uvm_kentry_lock) which, fortunately, was sitting there
unused.

Revision 1.320: download - view: text, markup, annotated - select for diffs
Mon Sep 3 17:30:04 2012 UTC (12 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.319: preferred, colored
Changes since revision 1.319: +4 -2 lines
Cleanup comment.  Change panic to KASSERTMSG.
Use kernel_map->misc_lock to make sure we don't call pmap_growkernel
concurrently and possibly mess up uvm_maxkaddr.

Revision 1.263.4.5: download - view: text, markup, annotated - select for diffs
Wed Aug 22 21:33:56 2012 UTC (12 years, 3 months ago) by bouyer
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2
Diff to: previous 1.263.4.4: preferred, colored; branchpoint 1.263: preferred, colored; next MAIN 1.264: preferred, colored
Changes since revision 1.263.4.4: +3 -4 lines
Pull up following revision(s) (requested by chs in ticket #1790):
	sys/uvm/uvm_map.c: revision 1.319
avoid leaking a uvm_object reference when merging a new map entry
with the entries on both sides.  fixes PR 46807.

Revision 1.313.2.3: download - view: text, markup, annotated - select for diffs
Sat Aug 18 22:03:24 2012 UTC (12 years, 3 months ago) by riz
Branches: netbsd-6
CVS tags: netbsd-6-0-RC1
Branch point for: matt-nb6-plus
Diff to: previous 1.313.2.2: preferred, colored; branchpoint 1.313: preferred, colored
Changes since revision 1.313.2.2: +3 -4 lines
Pull up following revision(s) (requested by chs in ticket #508):
	sys/uvm/uvm_map.c: revision 1.319
avoid leaking a uvm_object reference when merging a new map entry
with the entries on both sides.  fixes PR 46807.

Revision 1.319: download - view: text, markup, annotated - select for diffs
Sat Aug 18 14:28:04 2012 UTC (12 years, 3 months ago) by chs
Branches: MAIN
Diff to: previous 1.318: preferred, colored
Changes since revision 1.318: +3 -4 lines
avoid leaking a uvm_object reference when merging a new map entry
with the entries on both sides.  fixes PR 46807.

Revision 1.318: download - view: text, markup, annotated - select for diffs
Mon Jul 30 23:56:48 2012 UTC (12 years, 4 months ago) by matt
Branches: MAIN
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +6 -2 lines
-fno-common broke kernhist since it used commons.
Add a KERNHIST_DEFINE which is define the kernel history.
Change UVM to deal with the new usage.

Revision 1.263.4.3.4.9: download - view: text, markup, annotated - select for diffs
Mon May 7 18:30:56 2012 UTC (12 years, 7 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.8: preferred, colored; branchpoint 1.263.4.3: preferred, colored; next MAIN 1.263.4.4: preferred, colored
Changes since revision 1.263.4.3.4.8: +3 -3 lines
Use uvm_km_pagefree to free a kmap entry page.

Revision 1.306.2.4: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:05:09 2012 UTC (12 years, 7 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.306.2.3: preferred, colored; branchpoint 1.306: preferred, colored; next MAIN 1.307: preferred, colored
Changes since revision 1.306.2.3: +25 -15 lines
sync to latest -current.

Revision 1.305.2.2: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:59 2012 UTC (12 years, 7 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.305.2.1: preferred, colored; branchpoint 1.305: preferred, colored
Changes since revision 1.305.2.1: +111 -667 lines
sync with head

Revision 1.313.2.2: download - view: text, markup, annotated - select for diffs
Thu Apr 12 17:05:37 2012 UTC (12 years, 7 months ago) by riz
Branches: netbsd-6
Diff to: previous 1.313.2.1: preferred, colored; branchpoint 1.313: preferred, colored
Changes since revision 1.313.2.1: +25 -15 lines
Pull up following revision(s) (requested by martin in ticket #175):
	sys/kern/kern_exit.c: revision 1.238
	tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.4
	tests/lib/libc/gen/posix_spawn/t_fileactions.c: revision 1.5
	sys/uvm/uvm_extern.h: revision 1.183
	lib/libc/gen/posix_spawn_fileactions.c: revision 1.2
	sys/kern/kern_exec.c: revision 1.348
	sys/kern/kern_exec.c: revision 1.349
	sys/compat/netbsd32/syscalls.master: revision 1.95
	sys/uvm/uvm_glue.c: revision 1.159
	sys/uvm/uvm_map.c: revision 1.317
	sys/compat/netbsd32/netbsd32.h: revision 1.95
	sys/kern/exec_elf.c: revision 1.38
	sys/sys/spawn.h: revision 1.2
	sys/sys/exec.h: revision 1.135
	sys/compat/netbsd32/netbsd32_execve.c: revision 1.34
Rework posix_spawn locking and memory management:
 - always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat
Fix asynchronous posix_spawn child exit status (and test for it).

Revision 1.317: download - view: text, markup, annotated - select for diffs
Sun Apr 8 11:27:45 2012 UTC (12 years, 8 months ago) by martin
Branches: MAIN
CVS tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Diff to: previous 1.316: preferred, colored
Changes since revision 1.316: +25 -15 lines
Rework posix_spawn locking and memory management:
 - always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat

Revision 1.306.2.3: download - view: text, markup, annotated - select for diffs
Thu Apr 5 21:33:53 2012 UTC (12 years, 8 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.306.2.2: preferred, colored; branchpoint 1.306: preferred, colored
Changes since revision 1.306.2.2: +2 -4 lines
sync to latest -current.

Revision 1.316: download - view: text, markup, annotated - select for diffs
Tue Mar 13 18:41:15 2012 UTC (12 years, 8 months ago) by elad
Branches: MAIN
CVS tags: jmcneill-usbmp-base8
Diff to: previous 1.315: preferred, colored
Changes since revision 1.315: +4 -6 lines
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.

Revision 1.263.4.3.4.8: download - view: text, markup, annotated - select for diffs
Wed Feb 29 18:03:39 2012 UTC (12 years, 9 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.7: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.7: +6 -6 lines
Improve UVM_PAGE_TRKOWN.
Add more asserts to uvm_page.

Revision 1.306.2.2: download - view: text, markup, annotated - select for diffs
Fri Feb 24 09:11:52 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.306.2.1: preferred, colored; branchpoint 1.306: preferred, colored
Changes since revision 1.306.2.1: +22 -56 lines
sync to -current.

Revision 1.313.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 22 18:56:48 2012 UTC (12 years, 9 months ago) by riz
Branches: netbsd-6
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +2 -3 lines
Pull up following revision(s) (requested by bouyer in ticket #29):
	sys/arch/xen/x86/x86_xpmap.c: revision 1.39
	sys/arch/xen/include/hypervisor.h: revision 1.37
	sys/arch/xen/include/intr.h: revision 1.34
	sys/arch/xen/x86/xen_ipi.c: revision 1.10
	sys/arch/x86/x86/cpu.c: revision 1.97
	sys/arch/x86/include/cpu.h: revision 1.48
	sys/uvm/uvm_map.c: revision 1.315
	sys/arch/x86/x86/pmap.c: revision 1.165
	sys/arch/xen/x86/cpu.c: revision 1.81
	sys/arch/x86/x86/pmap.c: revision 1.167
	sys/arch/xen/x86/cpu.c: revision 1.82
	sys/arch/x86/x86/pmap.c: revision 1.168
	sys/arch/xen/x86/xen_pmap.c: revision 1.17
	sys/uvm/uvm_km.c: revision 1.122
	sys/uvm/uvm_kmguard.c: revision 1.10
	sys/arch/x86/include/pmap.h: revision 1.50
Apply patch proposed in PR port-xen/45975 (this does not solve the exact
problem reported here but is part of the solution):
xen_kpm_sync() is not working as expected,
leading to races between CPUs.
1 the check (xpq_cpu != &x86_curcpu) is always false because we
  have different x86_curcpu symbols with different addresses in the kernel.
  Fortunably, all addresses dissaemble to the same code.
  Because of this we always use the code intended for bootstrap, which doesn't
  use cross-calls or lock.
2 once 1 above is fixed, xen_kpm_sync() will use xcalls to sync other CPUs,
  which cause it to sleep and pmap.c doesn't like that. It triggers this
  KASSERT() in pmap_unmap_ptes():
  KASSERT(pmap->pm_ncsw == curlwp->l_ncsw);
3 pmap->pm_cpus is not safe for the purpose of xen_kpm_sync(), which
  needs to know on which CPU a pmap is loaded *now*:
  pmap->pm_cpus is cleared before cpu_load_pmap() is called to switch
  to a new pmap, leaving a window where a pmap is still in a CPU's
  ci_kpm_pdir but not in pm_cpus. As a virtual CPU may be preempted
  by the hypervisor at any time, it can be large enough to let another
  CPU free the PTP and reuse it as a normal page.
To fix 2), avoid cross-calls and IPIs completely, and instead
use a mutex to update all CPU's ci_kpm_pdir from the local CPU.
It's safe because we just need to update the table page, a tlbflush IPI will
happen later. As a side effect, we don't need a different code for bootstrap,
fixing 1). The mutex added to struct cpu needs a small headers reorganisation.
to fix 3), introduce a pm_xen_ptp_cpus which is updated from
cpu_pmap_load(), whith the ci_kpm_mtx mutex held. Checking it with
ci_kpm_mtx held will avoid overwriting the wrong pmap's ci_kpm_pdir.
While there I removed the unused pmap_is_active() function;
and added some more details to DIAGNOSTIC panics.
When using uvm_km_pgremove_intrsafe() make sure mappings are removed
before returning the pages to the free pool. Otherwise, under Xen,
a page which still has a writable mapping could be allocated for
a PDP by another CPU and the hypervisor would refuse it (this is
PR port-xen/45975).
For this, move the pmap_kremove() calls inside uvm_km_pgremove_intrsafe(),
and do pmap_kremove()/uvm_pagefree() in batch of (at most) 16 entries
(as suggested by Chuck Silvers on tech-kern@, see also
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012727.html and
followups).
Avoid early use of xen_kpm_sync(); locks are not available at this time.
Don't call cpu_init() twice.
Makes LOCKDEBUG kernels boot again
Revert pmap_pte_flush() -> xpq_flush_queue() in previous.

Revision 1.315: download - view: text, markup, annotated - select for diffs
Mon Feb 20 19:14:23 2012 UTC (12 years, 9 months ago) by bouyer
Branches: MAIN
CVS tags: jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3
Diff to: previous 1.314: preferred, colored
Changes since revision 1.314: +2 -3 lines
When using uvm_km_pgremove_intrsafe() make sure mappings are removed
before returning the pages to the free pool. Otherwise, under Xen,
a page which still has a writable mapping could be allocated for
a PDP by another CPU and the hypervisor would refuse it (this is
PR port-xen/45975).
For this, move the pmap_kremove() calls inside uvm_km_pgremove_intrsafe(),
and do pmap_kremove()/uvm_pagefree() in batch of (at most) 16 entries
(as suggested by Chuck Silvers on tech-kern@, see also
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012727.html and
followups).

Revision 1.314: download - view: text, markup, annotated - select for diffs
Sun Feb 19 00:05:56 2012 UTC (12 years, 9 months ago) by rmind
Branches: MAIN
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +22 -55 lines
Remove VM_MAP_INTRSAFE and related code.  Not used since the "kmem changes".

Revision 1.306.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 07:36:00 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +74 -609 lines
merge to -current.

Revision 1.313: download - view: text, markup, annotated - select for diffs
Sun Feb 12 20:28:14 2012 UTC (12 years, 9 months ago) by martin
Branches: MAIN
CVS tags: netbsd-6-base, jmcneill-usbmp-base2
Branch point for: netbsd-6
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +6 -3 lines
Fix another merge botch - bracket vm space assignement with kpreempt-
disable/enable.

Revision 1.263.4.3.4.7: download - view: text, markup, annotated - select for diffs
Thu Feb 9 03:04:59 2012 UTC (12 years, 9 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.6: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.6: +4 -2 lines
Major changes to uvm.
Support multiple collections (groups) of free pages and run the page
reclaimation algorithm on each group independently.

Revision 1.312: download - view: text, markup, annotated - select for diffs
Sat Jan 28 00:00:06 2012 UTC (12 years, 10 months ago) by rmind
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +5 -6 lines
pool_page_alloc, pool_page_alloc_meta: avoid extra compare, use const.
ffs_mountfs,sys_swapctl: replace memset with kmem_zalloc.
sys_swapctl: move kmem_free outside the lock path.
uvm_init: fix comment, remove pointless numeration of steps.
uvm_map_enter: remove meflagval variable.
Fix some indentation.

Revision 1.311: download - view: text, markup, annotated - select for diffs
Fri Jan 27 19:48:41 2012 UTC (12 years, 10 months ago) by para
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +54 -607 lines
extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged

Revision 1.310: download - view: text, markup, annotated - select for diffs
Thu Jan 5 15:19:53 2012 UTC (12 years, 11 months ago) by reinoud
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +2 -70 lines
Revert MAP_NOSYSCALLS patch.

Revision 1.305.2.1: download - view: text, markup, annotated - select for diffs
Mon Dec 26 16:03:11 2011 UTC (12 years, 11 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +13 -7 lines
- use O->A loan to serve read(2).  based on a patch from Chuck Silvers
- associated O->A loan fixes.

Revision 1.309: download - view: text, markup, annotated - select for diffs
Thu Dec 22 13:12:50 2011 UTC (12 years, 11 months ago) by reinoud
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +10 -20 lines
Redo uvm_map_setattr() to never fail and remove the possible panic. The
possibility of failure was a C&P error.

Revision 1.308: download - view: text, markup, annotated - select for diffs
Tue Dec 20 15:39:35 2011 UTC (12 years, 11 months ago) by reinoud
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +80 -2 lines
Add a MAP_NOSYSCALLS flag to mmap. This flag prohibits executing of system
calls from the mapped region. This can be used for emulation perposed or for
extra security in the case of generated code.

Its implemented by adding mapping-attributes to each uvm_map_entry. These can
then be queried when needed.

Currently the MAP_NOSYSCALLS is only implemented for x86 but other
architectures are easy to adapt; see the sys/arch/x86/x86/syscall.c patch.
Port maintainers are encouraged to add them for their processor ports too.
When this feature is not yet implemented for an architecture the
MAP_NOSYSCALLS is simply ignored with virtually no cpu cost..

Revision 1.307: download - view: text, markup, annotated - select for diffs
Tue Dec 20 13:47:38 2011 UTC (12 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +18 -2 lines
comment and assertion

Revision 1.306: download - view: text, markup, annotated - select for diffs
Wed Nov 23 01:00:52 2011 UTC (13 years ago) by matt
Branches: MAIN
CVS tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +7 -2 lines
When allocating pages for kernel map entries and PMAP_ALLOC_POOLPAGE is
defined, use it.  (allows a MIPS N32 kernel to boot when there is memory
outside of KSEG0).

Revision 1.305: download - view: text, markup, annotated - select for diffs
Tue Sep 27 01:02:39 2011 UTC (13 years, 2 months ago) by jym
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +3 -4 lines
Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html

Revision 1.304: download - view: text, markup, annotated - select for diffs
Thu Sep 1 06:40:28 2011 UTC (13 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +36 -14 lines
Forward some UVM from matt-nb5-mips64.  Add UVM_KMF_COLORMATCH flag.
When uvm_map gets passed UVM_FLAG_COLORMATCH, the align argument contains
the color of the starting address to be allocated (0..colormask).
When uvm_km_alloc is passed UVM_KMF_COLORMATCH (which can only be used with
UVM_KMF_VAONLY), the align argument contain the color of the starting address
to be allocated.
Change uvm_pagermapin to use this.  When mapping user pages in the kernel,
if colormatch is used with the color of the starting user page then the kernel
mapping will be congruent with the existing user mappings.

Revision 1.303: download - view: text, markup, annotated - select for diffs
Sat Aug 6 17:25:03 2011 UTC (13 years, 4 months ago) by rmind
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +6 -6 lines
- Rework uvm_anfree() into uvm_anon_freelst(), which always drops the lock.
- Free anons in uvm_anon_freelst() without lock held.
- Mechanic sync to unused loaning code.

Revision 1.302: download - view: text, markup, annotated - select for diffs
Sat Jul 30 20:05:46 2011 UTC (13 years, 4 months ago) by martin
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +14 -3 lines
Make uvmspace_exec() deal with procs that have no vmspace (yet) at all.
Greatly simplifies the upcoming posix_spawn implementation.

Revision 1.301: download - view: text, markup, annotated - select for diffs
Sat Jul 30 19:29:12 2011 UTC (13 years, 4 months ago) by martin
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +2 -6 lines
Get rid of #ifdef __sparc__ in uvm code - as noted by cgd back 1996,
now that we have __HAVE_CPU_VMSPACE_EXEC/cpu_vmspace_exec().

Revision 1.300: download - view: text, markup, annotated - select for diffs
Tue Jul 5 14:03:07 2011 UTC (13 years, 5 months ago) by yamt
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +4 -51 lines
- fix a use-after-free bug in uvm_km_free.
  (after uvm_km_pgremove frees pages, the following pmap_remove touches them.)
- acquire the object lock for operations on pmap_kernel as it can actually be
  raced with P->V operations.  eg. pagedaemon.

Revision 1.297.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 23 14:20:35 2011 UTC (13 years, 5 months ago) by cherry
Branches: cherry-xenmp
Diff to: previous 1.297: preferred, colored; next MAIN 1.298: preferred, colored
Changes since revision 1.297: +47 -14 lines
Catchup with rmind-uvmplock merge.

Revision 1.299: download - view: text, markup, annotated - select for diffs
Mon Jun 13 23:19:40 2011 UTC (13 years, 5 months ago) by rmind
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +8 -8 lines
uvm_map_lock_entry: fix the order of locking.  Spotted by yamt@.
Also, keep uvm_map_unlock_entry() symmetric.

Revision 1.298: download - view: text, markup, annotated - select for diffs
Sun Jun 12 03:36:03 2011 UTC (13 years, 5 months ago) by rmind
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +47 -14 lines
Welcome to 5.99.53!  Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.

Revision 1.294.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:10:22 2011 UTC (13 years, 6 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.294: preferred, colored; next MAIN 1.295: preferred, colored
Changes since revision 1.294: +10 -14 lines
Sync with HEAD.

Revision 1.263.4.3.4.6: download - view: text, markup, annotated - select for diffs
Fri Jun 3 07:59:58 2011 UTC (13 years, 6 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.5: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.5: +2 -2 lines
Restore $NetBSD$

Revision 1.263.4.3.4.5: download - view: text, markup, annotated - select for diffs
Fri Jun 3 02:43:41 2011 UTC (13 years, 6 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.4: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.4: +3 -3 lines
Rework page free lists to be sorted by color first rather than free_list.
Kept per color PGFL_* counter in each page free list.
Minor cleanups.

Revision 1.290.2.7: download - view: text, markup, annotated - select for diffs
Tue May 31 03:05:14 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.6: preferred, colored; branchpoint 1.290: preferred, colored; next MAIN 1.291: preferred, colored
Changes since revision 1.290.2.6: +2 -2 lines
sync with head

Revision 1.263.4.3.4.4: download - view: text, markup, annotated - select for diffs
Wed May 25 23:58:50 2011 UTC (13 years, 6 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.3: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.3: +34 -13 lines
Make uvm_map recognize UVM_FLAG_COLORMATCH which tells uvm_map that the
'align' argument specifies the starting color of the KVA range to be returned.

When calling uvm_km_alloc with UVM_KMF_VAONLY, also specify the starting
color of the kva range returned (UMV_KMF_COLORMATCH) and pass those to
uvm_map.

In uvm_pglistalloc, make sure the pages being returned have sequentially
advancing colors (so they can be mapped in a contiguous address range).
Add a few missing UVM_FLAG_COLORMATCH flags to uvm_pagealloc calls.

Make the socket and pipe loan color-safe.

Make the mips pmap enforce strict page color (color(VA) == color(PA)).

Revision 1.297: download - view: text, markup, annotated - select for diffs
Tue May 17 04:18:07 2011 UTC (13 years, 6 months ago) by mrg
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: cherry-xenmp
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +4 -4 lines
move and rename the uvm history code out of uvm_stat to "kernhist".

rename "UVMHIST" option to enable the uvm histories.

TODO:
- make UVMHIST properly depend upon KERNHIST
- enable dynamic registration of histories.  this is mostly just
  allocating something in a bitmap, and is only for viewing multiple
  histories in a merged form.


tested on amd64 and sparc64.

Revision 1.290.2.6: download - view: text, markup, annotated - select for diffs
Thu Apr 21 01:42:22 2011 UTC (13 years, 7 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.5: preferred, colored; branchpoint 1.290: preferred, colored
Changes since revision 1.290.2.5: +5 -4 lines
sync with head

Revision 1.296: download - view: text, markup, annotated - select for diffs
Fri Apr 8 10:38:36 2011 UTC (13 years, 8 months ago) by yamt
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +7 -6 lines
comment

Revision 1.290.2.5: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:56:36 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.4: preferred, colored; branchpoint 1.290: preferred, colored
Changes since revision 1.290.2.4: +39 -34 lines
sync with head

Revision 1.294.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 8 16:20:06 2011 UTC (13 years, 9 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.294: preferred, colored; next MAIN 1.295: preferred, colored
Changes since revision 1.294: +3 -8 lines
Sync with HEAD

Revision 1.295: download - view: text, markup, annotated - select for diffs
Wed Feb 2 15:25:27 2011 UTC (13 years, 10 months ago) by chuck
Branches: MAIN
CVS tags: uebayasi-xip-base7, bouyer-quota2-nbase, bouyer-quota2-base
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +3 -8 lines
udpate license clauses on my code to match the new-style BSD licenses.
based on second diff that rmind@ sent me.

no functional change with this commit.

Revision 1.294: download - view: text, markup, annotated - select for diffs
Tue Jan 4 08:21:18 2011 UTC (13 years, 11 months ago) by matt
Branches: MAIN
CVS tags: jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +5 -2 lines
Add a MD hook to indicate a change of vmspace due to exec.  (This is useful
to update any cpu flag due to a change to/from a 64bit and a 32bit address
space).  This can set the state needed for copyout/copyin before setregs
is invoked.

Revision 1.263.4.4: download - view: text, markup, annotated - select for diffs
Sun Nov 21 18:09:00 2010 UTC (14 years ago) by riz
Branches: netbsd-5
CVS tags: matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.263.4.3: preferred, colored; branchpoint 1.263: preferred, colored
Changes since revision 1.263.4.3: +10 -2 lines
Pull up following revision(s) (requested by rmind in ticket #1421):
	sys/uvm/uvm_bio.c: revision 1.70
	sys/uvm/uvm_map.c: revision 1.292
	sys/uvm/uvm_pager.c: revision 1.98
	sys/uvm/uvm_fault.c: revision 1.175
	sys/uvm/uvm_bio.c: revision 1.69
ubc_fault: split-off code part handling a single page into ubc_fault_page().
Keep the lock around pmap_update() where required.  While fixing this
in ubc_fault(), rework logic to &quot;remember&quot; the last object of page and
reduce locking overhead, since in common case pages belong to one and
the same UVM object (but not always, therefore add a comment).
Unlocks before pmap_update(), on removal of mappings, might cause TLB
coherency issues, since on architectures like x86 and mips64 invalidation
IPIs are deferred to pmap_update().  Hence, VA space might be globally
visible before IPIs are sent or while they are still in-flight.
OK ad@.

Revision 1.286.2.3: download - view: text, markup, annotated - select for diffs
Fri Oct 22 07:22:56 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.286.2.2: preferred, colored; branchpoint 1.286: preferred, colored; next MAIN 1.287: preferred, colored
Changes since revision 1.286.2.2: +33 -26 lines
Sync with HEAD (-D20101022).

Revision 1.254.2.7: download - view: text, markup, annotated - select for diffs
Sat Oct 9 03:32:46 2010 UTC (14 years, 1 month ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.6: preferred, colored; branchpoint 1.254: preferred, colored; next MAIN 1.255: preferred, colored
Changes since revision 1.254.2.6: +35 -28 lines
sync with head

Revision 1.293: download - view: text, markup, annotated - select for diffs
Fri Sep 24 22:51:51 2010 UTC (14 years, 2 months ago) by rmind
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, matt-mips64-premerge-20101231
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +35 -28 lines
Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
   would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
   already existing one.
4. Amend the interface to manipulate the actual object, instead of the
   rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@

Revision 1.263.4.3.4.3: download - view: text, markup, annotated - select for diffs
Thu Aug 19 07:30:31 2010 UTC (14 years, 3 months ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Diff to: previous 1.263.4.3.4.2: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.2: +3 -3 lines
Use __HAVE_CPU_VMSPACE_EXEC instead of a mips-specific #ifdef.

Revision 1.263.4.3.4.2: download - view: text, markup, annotated - select for diffs
Wed Aug 18 18:19:11 2010 UTC (14 years, 3 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.263.4.3.4.1: preferred, colored; branchpoint 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3.4.1: +5 -2 lines
Add a hook so that MD code has handle the change in address space limits
when an exec happens.
Add a routine to turn on/off UX when an address space changes due to an exec
(N32 execing a N64 for instance).

Revision 1.286.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 17 06:48:15 2010 UTC (14 years, 3 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.286.2.1: preferred, colored; branchpoint 1.286: preferred, colored
Changes since revision 1.286.2.1: +9 -1 lines
Sync with HEAD.

Revision 1.254.2.6: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:55:16 2010 UTC (14 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.5: preferred, colored; branchpoint 1.254: preferred, colored
Changes since revision 1.254.2.5: +11 -3 lines
sync with head.

Revision 1.290.2.4: download - view: text, markup, annotated - select for diffs
Sat Jul 3 01:20:06 2010 UTC (14 years, 5 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.3: preferred, colored; branchpoint 1.290: preferred, colored
Changes since revision 1.290.2.3: +10 -2 lines
sync with head

Revision 1.292: download - view: text, markup, annotated - select for diffs
Tue Jun 22 18:34:50 2010 UTC (14 years, 5 months ago) by rmind
Branches: MAIN
CVS tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +10 -2 lines
Keep the lock around pmap_update() where required.  While fixing this
in ubc_fault(), rework logic to "remember" the last object of page and
reduce locking overhead, since in common case pages belong to one and
the same UVM object (but not always, therefore add a comment).

Unlocks before pmap_update(), on removal of mappings, might cause TLB
coherency issues, since on architectures like x86 and mips64 invalidation
IPIs are deferred to pmap_update().  Hence, VA space might be globally
visible before IPIs are sent or while they are still in-flight.

OK ad@.

Revision 1.290.2.3: download - view: text, markup, annotated - select for diffs
Sun May 30 05:18:10 2010 UTC (14 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.2: preferred, colored; branchpoint 1.290: preferred, colored
Changes since revision 1.290.2.2: +3 -3 lines
sync with head

Revision 1.291: download - view: text, markup, annotated - select for diffs
Fri May 14 05:32:06 2010 UTC (14 years, 6 months ago) by cegger
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +3 -3 lines
Move PMAP_KMPAGE to be used in pmap_kenter_pa flags argument.
'Looks good to me' gimpy@

Forgot to commit this piece in previous commit

Revision 1.286.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:44:38 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +62 -3 lines
Sync with HEAD.

Revision 1.290.2.2: download - view: text, markup, annotated - select for diffs
Wed Mar 17 06:03:18 2010 UTC (14 years, 8 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290.2.1: preferred, colored; branchpoint 1.290: preferred, colored
Changes since revision 1.290.2.1: +46 -13 lines
Reorganise UVM locking to protect P->V state and serialise pmap(9)
operations on the same page(s) by always locking their owner.  Hence
lock order: "vmpage"-lock -> pmap-lock.

Patch, proposed on tech-kern@, from Andrew Doran.

Revision 1.290.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 16 15:38:18 2010 UTC (14 years, 8 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +3 -3 lines
Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc().  It allows us to share the locks among UVM objects.

Revision 1.254.2.5: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:47 2010 UTC (14 years, 8 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.4: preferred, colored; branchpoint 1.254: preferred, colored
Changes since revision 1.254.2.4: +71 -10 lines
sync with head

Revision 1.290: download - view: text, markup, annotated - select for diffs
Sun Feb 21 13:17:50 2010 UTC (14 years, 9 months ago) by drochner
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, uebayasi-xip-base1
Branch point for: rmind-uvmplock
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +15 -15 lines
rename the va0_disabled option and cpp conditional to "disable" as well,
for consistency, and document option and sysctl flag

Revision 1.289: download - view: text, markup, annotated - select for diffs
Sat Feb 20 13:21:58 2010 UTC (14 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +3 -3 lines
rename the new sysctl to "vm.user_va0_disable", for consistency
with the majority of existing sysctl flags, suggested by yamt

Revision 1.288: download - view: text, markup, annotated - select for diffs
Thu Feb 18 14:57:01 2010 UTC (14 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +61 -2 lines
Disable mapping of virtual address 0 by user programs per default.
This blocks an easy exploit of kernel bugs leading to dereference
of a NULL pointer on some architectures (eg i386).
The check can be disabled in various ways:
-by CPP definitions in machine/types.h (portmaster's choice)
-by a kernel config option USER_VA0_DISABLED_DEFAULT=0
-at runtime by sysctl vm.user_va0_disabled (cannot be cleared
 at securelevel>0)

Revision 1.287: download - view: text, markup, annotated - select for diffs
Mon Feb 8 19:02:33 2010 UTC (14 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +3 -3 lines
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.

Revision 1.286: download - view: text, markup, annotated - select for diffs
Tue Dec 15 06:15:11 2009 UTC (14 years, 11 months ago) by matt
Branches: MAIN
CVS tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +7 -5 lines
Use PRIxVADDR... (change a printf/panic -> panic)

Revision 1.285: download - view: text, markup, annotated - select for diffs
Mon Dec 14 21:19:47 2009 UTC (14 years, 11 months ago) by matt
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +3 -3 lines
Use PRIxVADDR ...

Revision 1.284: download - view: text, markup, annotated - select for diffs
Sat Nov 7 07:27:49 2009 UTC (15 years, 1 month ago) by cegger
Branches: MAIN
CVS tags: matt-premerge-20091211
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +3 -3 lines
Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.

Revision 1.283: download - view: text, markup, annotated - select for diffs
Sun Nov 1 11:16:32 2009 UTC (15 years, 1 month ago) by uebayasi
Branches: MAIN
CVS tags: jym-xensuspend-nbase
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +4 -4 lines
Consistently call amap / uobj layers as upper / lower, because UVM has only
those two layers by design.  Approved by Chuck Cranor some time ago.

Revision 1.254.2.4: download - view: text, markup, annotated - select for diffs
Wed Sep 16 13:38:08 2009 UTC (15 years, 2 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.3: preferred, colored; branchpoint 1.254: preferred, colored
Changes since revision 1.254.2.3: +6 -2 lines
sync with head

Revision 1.282: download - view: text, markup, annotated - select for diffs
Sun Sep 6 23:14:19 2009 UTC (15 years, 3 months ago) by rmind
Branches: MAIN
CVS tags: yamt-nfs-mp-base8
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +6 -2 lines
uvmspace_unshare: #if 0-out this function.  Q: perhaps remove?
AFAIK it was not used for 11 years.

Revision 1.263.4.3.4.1: download - view: text, markup, annotated - select for diffs
Sun Aug 23 06:38:07 2009 UTC (15 years, 3 months ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b
Diff to: previous 1.263.4.3: preferred, colored
Changes since revision 1.263.4.3: +14 -4 lines
PRIxVADDR, PRIdVSIZE, PRIxVSIZE, or PRIxPADDR as appropriate.
Use __intXX_t or __uintXX_t as appropriate in <mips/types.h>

Revision 1.254.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 19 18:48:35 2009 UTC (15 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.2: preferred, colored; branchpoint 1.254: preferred, colored
Changes since revision 1.254.2.2: +100 -222 lines
sync with head.

Revision 1.281: download - view: text, markup, annotated - select for diffs
Wed Aug 19 04:53:20 2009 UTC (15 years, 3 months ago) by matt
Branches: MAIN
CVS tags: yamt-nfs-mp-base7
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +2 -4 lines
In uvm_kmapent_alloc, Make sure entry is initialized.
Spotted by msaitoh.

Revision 1.280: download - view: text, markup, annotated - select for diffs
Tue Aug 18 19:16:09 2009 UTC (15 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +41 -81 lines
Move uvm_object-related DDB hooks into uvm_object.c.  Put all of the
uvm_map-related DDB stuff in one spot in the file.

Revision 1.279: download - view: text, markup, annotated - select for diffs
Tue Aug 18 19:08:39 2009 UTC (15 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +3 -118 lines
Move uvm_page-related DDB hooks into uvm_page.c.

Revision 1.278: download - view: text, markup, annotated - select for diffs
Thu Aug 13 03:21:03 2009 UTC (15 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +3 -3 lines
Fix KASSERT() failure reported by Geoff Wing.

Revision 1.277: download - view: text, markup, annotated - select for diffs
Mon Aug 10 16:49:30 2009 UTC (15 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +3 -3 lines
Compare vaddr_t against 0, not NULL.

Revision 1.276: download - view: text, markup, annotated - select for diffs
Sun Aug 9 22:13:07 2009 UTC (15 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +42 -11 lines
If PMAP_MAP_POOLPAGE is defined, use it to map kernel map entries.  This
avoids TLB pollution on those platforms that define it.

Revision 1.275: download - view: text, markup, annotated - select for diffs
Sat Aug 1 16:35:51 2009 UTC (15 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +16 -7 lines
- uvm_map_extract: update map->size correctly for !UVM_EXTRACT_CONTIG.
- uvm_map_extract: panic on zero-sized entries.
- make uvm_map_replace static.

Revision 1.274: download - view: text, markup, annotated - select for diffs
Sat Aug 1 15:36:07 2009 UTC (15 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +2 -11 lines
don't call uvm_map_check with map unlocked.

Revision 1.273: download - view: text, markup, annotated - select for diffs
Sat Aug 1 15:32:02 2009 UTC (15 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +6 -3 lines
_uvm_tree_sanity: fix an assertion.

Revision 1.272: download - view: text, markup, annotated - select for diffs
Sat Aug 1 15:30:33 2009 UTC (15 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +4 -3 lines
_uvm_map_sanity: fix a race which causes "stale hint".

Revision 1.269.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 23 23:33:04 2009 UTC (15 years, 4 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.269.2.1: preferred, colored; branchpoint 1.269: preferred, colored; next MAIN 1.270: preferred, colored
Changes since revision 1.269.2.1: +54 -2 lines
Sync with HEAD.

Revision 1.254.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 20 07:20:38 2009 UTC (15 years, 5 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254.2.1: preferred, colored; branchpoint 1.254: preferred, colored
Changes since revision 1.254.2.1: +54 -2 lines
sync with head

Revision 1.271: download - view: text, markup, annotated - select for diffs
Wed Jun 10 01:55:33 2009 UTC (15 years, 5 months ago) by yamt
Branches: MAIN
CVS tags: yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +54 -2 lines
on MADV_WILLNEED, start prefetching backing object's pages.

Revision 1.269.2.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:23:10 2009 UTC (15 years, 6 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +6 -6 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.254.2.1: download - view: text, markup, annotated - select for diffs
Mon May 4 08:14:39 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +263 -139 lines
sync with head.

Revision 1.270: download - view: text, markup, annotated - select for diffs
Sun May 3 16:52:54 2009 UTC (15 years, 7 months ago) by pooka
Branches: MAIN
CVS tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, jym-xensuspend-base
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +6 -6 lines
Include some debug print routines if DEBUGPRINT is defined.  This
way they can be included without having to include DDB.
(arguably all print routines should be behind #ifdef DEBUGPRINT
and options DDB should define that macro, but I'll tackle that later)

Revision 1.263.4.3: download - view: text, markup, annotated - select for diffs
Sun Apr 19 15:43:14 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0
Branch point for: matt-nb5-mips64
Diff to: previous 1.263.4.2: preferred, colored; branchpoint 1.263: preferred, colored
Changes since revision 1.263.4.2: +6 -7 lines
Pull up following revision(s) (requested by mrg in ticket #708):
	sys/uvm/uvm_km.c: revision 1.102
	sys/uvm/uvm_km.h: revision 1.18
	sys/uvm/uvm_map.c: revision 1.264
PR port-amd64/32816 amd64 can not load lkms
Change some assertions to partially allow for VM_MAP_IS_KERNEL(map) where
map is outside the range of kernel_map.

Revision 1.263.4.2: download - view: text, markup, annotated - select for diffs
Mon Feb 2 18:31:37 2009 UTC (15 years, 10 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2
Diff to: previous 1.263.4.1: preferred, colored; branchpoint 1.263: preferred, colored
Changes since revision 1.263.4.1: +3 -3 lines
Pull up following revision(s) (requested by ad in ticket #354):
	sys/uvm/uvm_fault.c: revision 1.126
	sys/uvm/uvm_map.c: revision 1.268
Move a couple of calls to pmap_update().

Revision 1.263.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:20:36 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.263: preferred, colored; next MAIN 1.264: preferred, colored
Changes since revision 1.263: +15 -13 lines
Sync with HEAD.

Revision 1.250.6.5: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:43 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.250.6.4: preferred, colored; branchpoint 1.250: preferred, colored; next MAIN 1.251: preferred, colored
Changes since revision 1.250.6.4: +13 -11 lines
Sync with HEAD.

Revision 1.269: download - view: text, markup, annotated - select for diffs
Tue Jan 13 14:04:35 2009 UTC (15 years, 10 months ago) by yamt
Branches: MAIN
CVS tags: nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base
Branch point for: jym-xensuspend
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +5 -2 lines
vm_map_locked_p: add comments

Revision 1.263.4.1: download - view: text, markup, annotated - select for diffs
Sat Dec 27 18:26:22 2008 UTC (15 years, 11 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-0-RC1
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +4 -3 lines
Pull up following revision(s) (requested by bouyer in ticket #211):
	sys/uvm/uvm_km.c: revision 1.103
	sys/uvm/uvm_map.c: revision 1.265
	sys/uvm/uvm_page.c: revision 1.141
It's easier for kernel reserve pages to be consumed because the pagedaemon
serves as less of a barrier these days. Restrict provision of kernel reserve
pages to kmem and one of these cases:
- doing a NOWAIT allocation
- caller is a realtime thread
- caller is a kernel thread
- explicitly requested, for example by the pmap

Revision 1.268: download - view: text, markup, annotated - select for diffs
Sat Dec 20 11:33:38 2008 UTC (15 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +3 -3 lines
Move a couple of calls to pmap_update().

Revision 1.267: download - view: text, markup, annotated - select for diffs
Wed Dec 17 20:51:39 2008 UTC (15 years, 11 months ago) by cegger
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +3 -4 lines
kill MALLOC and FREE macros.

Revision 1.266: download - view: text, markup, annotated - select for diffs
Tue Dec 16 22:35:38 2008 UTC (15 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +4 -4 lines
replace bitmask_snprintf(9) with snprintb(3)

Revision 1.265: download - view: text, markup, annotated - select for diffs
Sat Dec 13 11:34:43 2008 UTC (15 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +4 -3 lines
It's easier for kernel reserve pages to be consumed because the pagedaemon
serves as less of a barrier these days. Restrict provision of kernel reserve
pages to kmem and one of these cases:

- doing a NOWAIT allocation
- caller is a realtime thread
- caller is a kernel thread
- explicitly requested, for example by the pmap

Revision 1.260.4.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:15:42 2008 UTC (15 years, 11 months ago) by haad
Branches: haad-dm
Diff to: previous 1.260.4.1: preferred, colored; branchpoint 1.260: preferred, colored; next MAIN 1.261: preferred, colored
Changes since revision 1.260.4.1: +6 -7 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.264: download - view: text, markup, annotated - select for diffs
Mon Dec 1 10:54:57 2008 UTC (16 years ago) by ad
Branches: MAIN
CVS tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +6 -7 lines
PR port-amd64/32816 amd64 can not load lkms

Change some assertions to partially allow for VM_MAP_IS_KERNEL(map) where
map is outside the range of kernel_map.

Revision 1.260.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:18:11 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +229 -110 lines
Sync with HEAD.

Revision 1.250.6.4: download - view: text, markup, annotated - select for diffs
Sun Sep 28 10:41:07 2008 UTC (16 years, 2 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.250.6.3: preferred, colored; branchpoint 1.250: preferred, colored
Changes since revision 1.250.6.3: +227 -108 lines
Sync with HEAD.

Revision 1.254.4.2: download - view: text, markup, annotated - select for diffs
Thu Sep 18 04:37:06 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.254.4.1: preferred, colored; branchpoint 1.254: preferred, colored; next MAIN 1.255: preferred, colored
Changes since revision 1.254.4.1: +229 -110 lines
Sync with wrstuden-revivesa-base-2.

Revision 1.260.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 31 04:51:05 2008 UTC (16 years, 4 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.260.2.1: preferred, colored; branchpoint 1.260: preferred, colored; next MAIN 1.261: preferred, colored
Changes since revision 1.260.2.1: +226 -108 lines
Sync with head.

Revision 1.263: download - view: text, markup, annotated - select for diffs
Tue Jul 29 00:03:06 2008 UTC (16 years, 4 months ago) by matt
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +226 -108 lines
Make uvm_map.? use <sys/rb.h> instead of <sys/tree.h>.  Change the
ambiguous members ownspace/space to gap/maxgap.  Add some evcnt for
evaluation of lookups using tree/list.  Drop threshold of using
tree for lookups from > 30 to > 15.

Bump kernel version to 4.99.71

Revision 1.260.2.1: download - view: text, markup, annotated - select for diffs
Fri Jul 18 16:37:58 2008 UTC (16 years, 4 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +5 -4 lines
Sync with head.

Revision 1.262: download - view: text, markup, annotated - select for diffs
Wed Jul 16 00:11:27 2008 UTC (16 years, 4 months ago) by matt
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +4 -3 lines
Add PMAP_KMPAGE flag for pmap_kenter_pa.  This allows pmaps to know that
the page being entered is being for the kernel memory allocator.  Such pages
should have no references and don't need bookkeeping.

Revision 1.261: download - view: text, markup, annotated - select for diffs
Fri Jul 11 07:09:18 2008 UTC (16 years, 4 months ago) by skrll
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +3 -3 lines
English improvement in comments.

"seems good to me :)" from yamt.

Revision 1.254.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:32:06 2008 UTC (16 years, 5 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +19 -16 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.252.2.3: download - view: text, markup, annotated - select for diffs
Tue Jun 17 09:15:17 2008 UTC (16 years, 5 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.252.2.2: preferred, colored; branchpoint 1.252: preferred, colored; next MAIN 1.253: preferred, colored
Changes since revision 1.252.2.2: +18 -14 lines
sync with head.

Revision 1.260: download - view: text, markup, annotated - select for diffs
Fri Jun 6 14:01:32 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: simonb-wapbl, haad-dm
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +2 -4 lines
Back out previous.

Revision 1.259: download - view: text, markup, annotated - select for diffs
Fri Jun 6 13:52:56 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +4 -2 lines
Wrap an expensive check in DIAGNOSTIC.

Revision 1.250.6.3: download - view: text, markup, annotated - select for diffs
Thu Jun 5 19:14:38 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.250.6.2: preferred, colored; branchpoint 1.250: preferred, colored
Changes since revision 1.250.6.2: +16 -14 lines
Sync with HEAD.

Also fix build.

Revision 1.258: download - view: text, markup, annotated - select for diffs
Wed Jun 4 17:47:40 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +14 -10 lines
- Switch off the map evcnts by default.
- SAVE_HINT() doesn't need to be atomic.

Revision 1.257: download - view: text, markup, annotated - select for diffs
Wed Jun 4 12:41:40 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +6 -6 lines
vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both.

Revision 1.252.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:05:54 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.252.2.1: preferred, colored; branchpoint 1.252: preferred, colored
Changes since revision 1.252.2.1: +3 -4 lines
sync with head

Revision 1.256: download - view: text, markup, annotated - select for diffs
Mon Jun 2 16:08:41 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base3
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +2 -4 lines
Don't needlessly acquire v_interlock.

Revision 1.250.6.2: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:37 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.250.6.1: preferred, colored; branchpoint 1.250: preferred, colored
Changes since revision 1.250.6.1: +16 -4 lines
Sync with HEAD.

Revision 1.255: download - view: text, markup, annotated - select for diffs
Sat May 31 13:00:03 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +3 -2 lines
Missing cv_destroy().

Revision 1.252.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:35:56 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +17 -6 lines
sync with head.

Revision 1.254: download - view: text, markup, annotated - select for diffs
Sun Apr 27 11:39:47 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +6 -2 lines
Disable preemption while swapping pmap.

Revision 1.253: download - view: text, markup, annotated - select for diffs
Sat Apr 26 13:44:00 2008 UTC (16 years, 7 months ago) by yamt
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +13 -6 lines
fix a locking botch.  PR/38415 from Wolfgang Solfrank.

Revision 1.250.6.1: download - view: text, markup, annotated - select for diffs
Thu Apr 3 12:43:14 2008 UTC (16 years, 8 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +5 -4 lines
Sync with HEAD.

Revision 1.250.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 24 07:16:33 2008 UTC (16 years, 8 months ago) by keiichi
Branches: keiichi-mipv6
Diff to: previous 1.250: preferred, colored; next MAIN 1.251: preferred, colored
Changes since revision 1.250: +5 -4 lines
sync with head.

Revision 1.240.2.3: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:05:13 2008 UTC (16 years, 8 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.240.2.2: preferred, colored; branchpoint 1.240: preferred, colored; next MAIN 1.241: preferred, colored
Changes since revision 1.240.2.2: +5 -5 lines
sync with HEAD

Revision 1.204.2.9: download - view: text, markup, annotated - select for diffs
Mon Mar 17 09:15:52 2008 UTC (16 years, 8 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.8: preferred, colored; branchpoint 1.204: preferred, colored; next MAIN 1.205: preferred, colored
Changes since revision 1.204.2.8: +4 -4 lines
sync with head.

Revision 1.252: download - view: text, markup, annotated - select for diffs
Tue Mar 4 09:32:01 2008 UTC (16 years, 9 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Branch point for: yamt-pf42
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +4 -4 lines
fix "stale map" assertions.  PR/38153 from Sarton O'Brien.

Revision 1.204.2.8: download - view: text, markup, annotated - select for diffs
Wed Feb 27 08:37:09 2008 UTC (16 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.7: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.7: +3 -2 lines
sync with head.

Revision 1.251: download - view: text, markup, annotated - select for diffs
Sat Feb 23 17:27:58 2008 UTC (16 years, 9 months ago) by chris
Branches: MAIN
CVS tags: hpcarm-cleanup-base
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +3 -2 lines
Add some more missing pmap_update()s following pmap_kremove()s.

Revision 1.243.4.3: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:07:33 2008 UTC (16 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.243.4.2: preferred, colored; branchpoint 1.243: preferred, colored; next MAIN 1.244: preferred, colored
Changes since revision 1.243.4.2: +128 -89 lines
Sync with HEAD.

Revision 1.204.2.7: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:48:21 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.6: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.6: +181 -104 lines
sync with head

Revision 1.246.6.4: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:15:49 2008 UTC (16 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.246.6.3: preferred, colored; branchpoint 1.246: preferred, colored; next MAIN 1.247: preferred, colored
Changes since revision 1.246.6.3: +0 -1 lines
Sync with HEAD

Revision 1.250: download - view: text, markup, annotated - select for diffs
Fri Jan 18 10:48:23 2008 UTC (16 years, 10 months ago) by yamt
Branches: MAIN
CVS tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Branch point for: mjf-devfs2, keiichi-mipv6
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +2 -3 lines
push pmap_clear_reference calls into pdpolicy code, where reference bits
actually matter.

Revision 1.240.2.2: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:58:41 2008 UTC (16 years, 11 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.240.2.1: preferred, colored; branchpoint 1.240: preferred, colored
Changes since revision 1.240.2.1: +188 -103 lines
sync with HEAD

Revision 1.246.6.3: download - view: text, markup, annotated - select for diffs
Tue Jan 8 22:12:06 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.246.6.2: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.6.2: +8 -43 lines
Sync with HEAD

Revision 1.249: download - view: text, markup, annotated - select for diffs
Tue Jan 8 13:09:55 2008 UTC (16 years, 11 months ago) by yamt
Branches: MAIN
CVS tags: matt-armv6-base
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +10 -45 lines
simplify locking and remove vm_map_upgrade/downgrade.
this fixes a deadlock due to read-lock recursion of map->lock.

Revision 1.246.6.2: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:58:39 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.246.6.1: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.6.1: +130 -55 lines
Sync with HEAD

Revision 1.248: download - view: text, markup, annotated - select for diffs
Wed Jan 2 11:49:18 2008 UTC (16 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +132 -57 lines
Merge vmlocking2 to head.

Revision 1.246.2.6: download - view: text, markup, annotated - select for diffs
Wed Jan 2 10:12:28 2008 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.246.2.5: preferred, colored; branchpoint 1.246: preferred, colored; next MAIN 1.247: preferred, colored
Changes since revision 1.246.2.5: +4 -3 lines
Fix merge error.

Revision 1.246.2.5: download - view: text, markup, annotated - select for diffs
Fri Dec 28 14:33:13 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.246.2.4: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.4: +91 -14 lines
- Move remaining map locking functions into uvm_map.c. They depend on proc.h.
- Lock vm_map_kernel::vmk_merged_entries with the map's own lock. There was
  a race where a thread legitimately expects to find cached entries, but can
  find none because they have not been freed yet.

Revision 1.246.2.4: download - view: text, markup, annotated - select for diffs
Thu Dec 27 16:21:45 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.246.2.3: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.3: +6 -4 lines
Be more paranoid with vm_map_lock/vm_map_unbusy.

Revision 1.243.4.2: download - view: text, markup, annotated - select for diffs
Thu Dec 27 00:46:54 2007 UTC (16 years, 11 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.243.4.1: preferred, colored; branchpoint 1.243: preferred, colored
Changes since revision 1.243.4.1: +55 -17 lines
Sync with HEAD.

Revision 1.246.2.3: download - view: text, markup, annotated - select for diffs
Wed Dec 26 21:40:05 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.246.2.2: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.2: +55 -17 lines
Sync with head.

Revision 1.246.2.2: download - view: text, markup, annotated - select for diffs
Fri Dec 21 15:39:23 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.246.2.1: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.1: +6 -17 lines
Kill vm_map::hint_lock.

Revision 1.246.6.1: download - view: text, markup, annotated - select for diffs
Thu Dec 13 21:57:04 2007 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +55 -17 lines
Sync with HEAD

Revision 1.246.4.3: download - view: text, markup, annotated - select for diffs
Thu Dec 13 05:06:05 2007 UTC (16 years, 11 months ago) by yamt
Branches: yamt-kmem
Diff to: previous 1.246.4.2: preferred, colored; branchpoint 1.246: preferred, colored; next MAIN 1.247: preferred, colored
Changes since revision 1.246.4.2: +55 -17 lines
sync with head.

Revision 1.247: download - view: text, markup, annotated - select for diffs
Thu Dec 13 02:45:11 2007 UTC (16 years, 11 months ago) by yamt
Branches: MAIN
CVS tags: yamt-kmem-base3, vmlocking2-base3
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +55 -17 lines
add ddb "whatis" command.  inspired from solaris ::whatis dcmd.

Revision 1.246.4.2: download - view: text, markup, annotated - select for diffs
Mon Dec 10 13:00:24 2007 UTC (16 years, 11 months ago) by yamt
Branches: yamt-kmem
Diff to: previous 1.246.4.1: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.4.1: +19 -0 lines
uvm_map_checkprot: a kludge for mem(4).

Revision 1.246.4.1: download - view: text, markup, annotated - select for diffs
Mon Dec 10 12:56:13 2007 UTC (16 years, 11 months ago) by yamt
Branches: yamt-kmem
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +76 -41 lines
- separate kernel va allocation (kernel_va_arena) from
  in-kernel fault handling (kernel_map).
- add vmem bootstrap code.  vmem doesn't rely on malloc anymore.
- make kmem_alloc interrupt-safe.
- kill kmem_map.  make malloc a wrapper of kmem_alloc.

Revision 1.243.4.1: download - view: text, markup, annotated - select for diffs
Sat Dec 8 18:21:46 2007 UTC (17 years ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +9 -2 lines
Sync with HEAD.

Revision 1.204.2.6: download - view: text, markup, annotated - select for diffs
Fri Dec 7 17:35:27 2007 UTC (17 years ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.5: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.5: +9 -2 lines
sync with head

Revision 1.246.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 4 13:04:01 2007 UTC (17 years ago) by ad
Branches: vmlocking2
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +36 -30 lines
Pull the vmlocking changes into a new branch.

Revision 1.238.4.3: download - view: text, markup, annotated - select for diffs
Tue Nov 27 19:39:31 2007 UTC (17 years ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.238.4.2: preferred, colored; branchpoint 1.238: preferred, colored; next MAIN 1.239: preferred, colored
Changes since revision 1.238.4.2: +9 -2 lines
Sync with HEAD. amd64 Xen support needs testing.

Revision 1.246: download - view: text, markup, annotated - select for diffs
Mon Nov 26 08:22:32 2007 UTC (17 years ago) by xtraeme
Branches: MAIN
CVS tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-kmem, vmlocking2, bouyer-xeni386
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +4 -3 lines
Make this build without LOCKDEBUG (the if statement that uses
LOCKDEBUG_MEM_CHECK).

Revision 1.245: download - view: text, markup, annotated - select for diffs
Mon Nov 26 08:20:46 2007 UTC (17 years ago) by yamt
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +3 -0 lines
uvm_map_extract: for UVM_EXTRACT_QREF, mark entries UVM_MAP_NOMERGE.

Revision 1.244: download - view: text, markup, annotated - select for diffs
Mon Nov 26 08:15:19 2007 UTC (17 years ago) by yamt
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +3 -0 lines
uvm_unmap1: LOCKDEBUG_MEM_CHECK for kernel_map.

Revision 1.235.2.10: download - view: text, markup, annotated - select for diffs
Sat Nov 10 12:32:35 2007 UTC (17 years ago) by yamt
Branches: vmlocking
Diff to: previous 1.235.2.9: preferred, colored; next MAIN 1.236: preferred, colored
Changes since revision 1.235.2.9: +4 -3 lines
uvm_map_prepare: ignore UVM_FLAG_TRYLOCK for intrsafe maps.
otherwise pool_cache_get(NOWAIT) often fails even if there are plenty of
free memory and causes eg. "no pv entries available" panic on x86.

Revision 1.240.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:35:29 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +10 -6 lines
sync with HEAD

Revision 1.232.6.1: download - view: text, markup, annotated - select for diffs
Mon Oct 29 00:45:23 2007 UTC (17 years, 1 month ago) by wrstuden
Branches: wrstuden-fixsa
Diff to: previous 1.232: preferred, colored; next MAIN 1.233: preferred, colored
Changes since revision 1.232: +4 -3 lines
Catch up with 4.0 RC3

Revision 1.204.2.5: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:36:54 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.4: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.4: +10 -6 lines
sync with head.

Revision 1.238.4.2: download - view: text, markup, annotated - select for diffs
Fri Oct 26 15:49:41 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.238.4.1: preferred, colored; branchpoint 1.238: preferred, colored
Changes since revision 1.238.4.1: +10 -6 lines
Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.235.2.9: download - view: text, markup, annotated - select for diffs
Tue Oct 23 20:17:31 2007 UTC (17 years, 1 month ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.8: preferred, colored
Changes since revision 1.235.2.8: +4 -4 lines
Sync with head.

Revision 1.240.4.2: download - view: text, markup, annotated - select for diffs
Thu Oct 18 08:33:17 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-x86pmap
Diff to: previous 1.240.4.1: preferred, colored; branchpoint 1.240: preferred, colored; next MAIN 1.241: preferred, colored
Changes since revision 1.240.4.1: +4 -4 lines
sync with head.

Revision 1.243: download - view: text, markup, annotated - select for diffs
Mon Oct 15 11:24:30 2007 UTC (17 years, 1 month ago) by yamt
Branches: MAIN
CVS tags: yamt-x86pmap-base4, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: mjf-devfs
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +4 -4 lines
uvm_map_reserve: don't ignore alignment.  fixes mremap.

Revision 1.240.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 14 11:49:25 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-x86pmap
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +8 -4 lines
sync with head.

Revision 1.232.2.1: download - view: text, markup, annotated - select for diffs
Fri Oct 12 22:29:36 2007 UTC (17 years, 1 month ago) by riz
Branches: netbsd-4
CVS tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Diff to: previous 1.232: preferred, colored; next MAIN 1.233: preferred, colored
Changes since revision 1.232: +2 -1 lines
Pull up following revision(s) (requested by skrll in ticket #928):
	sys/uvm/uvm_map.c: revision 1.242
Don't restrict the offset when allocating a map entry for in-kernel map -
use UVM_UNKNOWN_OFFSET in the call to uvm_map_prepare.
This fixes a '"panic: malloc: out of space in kmem_map" when it's not
really' testcase of mine, and one reported to me by chuq. This is likely
to fix PR/35587 as well.
Looks/seems fine to me from chuq and yamt. Thanks.

Revision 1.242: download - view: text, markup, annotated - select for diffs
Fri Oct 12 06:45:17 2007 UTC (17 years, 1 month ago) by skrll
Branches: MAIN
CVS tags: yamt-x86pmap-base3, vmlocking-base
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +4 -3 lines
Don't restrict the offset when allocating a map entry for in-kernel map -
use UVM_UNKNOWN_OFFSET in the call to uvm_map_prepare.

This fixes a '"panic: malloc: out of space in kmem_map" when it's not
really' testcase of mine, and one reported to me by chuq. This is likely
to fix PR/35587 as well.

Looks/seems fine to me from chuq and yamt. Thanks.

Revision 1.241: download - view: text, markup, annotated - select for diffs
Wed Oct 10 20:42:41 2007 UTC (17 years, 1 month ago) by ad
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +6 -3 lines
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.

Revision 1.238.4.1: download - view: text, markup, annotated - select for diffs
Mon Sep 3 16:49:17 2007 UTC (17 years, 3 months ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +7 -3 lines
Sync with HEAD.

Revision 1.204.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:47:08 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.3: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.3: +182 -67 lines
sync with head.

Revision 1.237.2.2: download - view: text, markup, annotated - select for diffs
Mon Sep 3 10:24:25 2007 UTC (17 years, 3 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.237.2.1: preferred, colored; branchpoint 1.237: preferred, colored; next MAIN 1.238: preferred, colored
Changes since revision 1.237.2.1: +7 -3 lines
Sync with HEAD.

Revision 1.235.2.8: download - view: text, markup, annotated - select for diffs
Sat Sep 1 12:57:56 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.7: preferred, colored
Changes since revision 1.235.2.7: +20 -14 lines
Use pool_cache for allocating a few more types of objects.

Revision 1.235.2.7: download - view: text, markup, annotated - select for diffs
Mon Aug 20 21:28:32 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.6: preferred, colored
Changes since revision 1.235.2.6: +16 -16 lines
Sync with HEAD.

Revision 1.240: download - view: text, markup, annotated - select for diffs
Mon Aug 20 13:34:52 2007 UTC (17 years, 3 months ago) by ad
Branches: MAIN
CVS tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap, matt-armv6
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +3 -3 lines
Also initialize map->lock for INTRSAFE maps.

Revision 1.239: download - view: text, markup, annotated - select for diffs
Mon Aug 20 13:33:47 2007 UTC (17 years, 3 months ago) by ad
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +6 -2 lines
uvmspace_free: destroy locks.

Revision 1.237.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 15 13:51:22 2007 UTC (17 years, 3 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +174 -63 lines
Sync with HEAD.

Revision 1.235.2.6: download - view: text, markup, annotated - select for diffs
Sun Jul 29 11:31:54 2007 UTC (17 years, 4 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.5: preferred, colored
Changes since revision 1.235.2.5: +7 -3 lines
Destroy the map's locks before it's freed.

Revision 1.238.6.2: download - view: text, markup, annotated - select for diffs
Sat Jul 21 19:21:55 2007 UTC (17 years, 4 months ago) by ad
Branches: matt-mips64
Diff to: previous 1.238.6.1: preferred, colored; branchpoint 1.238: preferred, colored; next MAIN 1.239: preferred, colored
Changes since revision 1.238.6.1: +5053 -0 lines
Merge unobtrusive locking changes from the vmlocking branch.

Revision 1.238.6.1
Sat Jul 21 19:21:54 2007 UTC (17 years, 4 months ago) by ad
Branches: matt-mips64
FILE REMOVED
Changes since revision 1.238: +0 -5053 lines
file uvm_map.c was added on branch matt-mips64 on 2007-07-21 19:21:55 +0000

Revision 1.238: download - view: text, markup, annotated - select for diffs
Sat Jul 21 19:21:54 2007 UTC (17 years, 4 months ago) by ad
Branches: MAIN
CVS tags: matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, jmcneill-pm
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +174 -63 lines
Merge unobtrusive locking changes from the vmlocking branch.

Revision 1.236.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 20:12:55 2007 UTC (17 years, 4 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.236: preferred, colored; next MAIN 1.237: preferred, colored
Changes since revision 1.236: +3 -3 lines
Sync with head.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Mon Jul 9 21:11:36 2007 UTC (17 years, 5 months ago) by ad
Branches: MAIN
CVS tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +3 -3 lines
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.235.2.5: download - view: text, markup, annotated - select for diffs
Fri Apr 13 15:49:50 2007 UTC (17 years, 7 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.4: preferred, colored
Changes since revision 1.235.2.4: +6 -3 lines
- Fix a (new) bug where vget tries to acquire freed vnodes' interlocks.
- Minor locking fixes.

Revision 1.235.2.4: download - view: text, markup, annotated - select for diffs
Thu Apr 5 21:32:52 2007 UTC (17 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.3: preferred, colored
Changes since revision 1.235.2.3: +153 -38 lines
- Put a per-LWP lock around swapin / swapout.
- Replace use of lockmgr().
- Minor locking fixes and assertions.
- uvm_map.h no longer pulls in proc.h, etc.
- Use kpause where appropriate.

Revision 1.232.4.3: download - view: text, markup, annotated - select for diffs
Sat Mar 24 14:56:18 2007 UTC (17 years, 8 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.232.4.2: preferred, colored; branchpoint 1.232: preferred, colored; next MAIN 1.233: preferred, colored
Changes since revision 1.232.4.2: +4 -4 lines
sync with head.

Revision 1.235.2.3: download - view: text, markup, annotated - select for diffs
Wed Mar 21 20:11:59 2007 UTC (17 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.2: preferred, colored
Changes since revision 1.235.2.2: +3 -4 lines
- Replace more simple_locks, and fix up in a few places.
- Use condition variables.
- LOCK_ASSERT -> KASSERT.

Revision 1.235.2.2: download - view: text, markup, annotated - select for diffs
Tue Mar 13 17:51:56 2007 UTC (17 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235.2.1: preferred, colored
Changes since revision 1.235.2.1: +61 -64 lines
Pull in the initial set of changes for the vmlocking branch.

Revision 1.235.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 13 16:52:09 2007 UTC (17 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +4 -4 lines
Sync with head.

Revision 1.236: download - view: text, markup, annotated - select for diffs
Mon Mar 12 18:18:39 2007 UTC (17 years, 8 months ago) by ad
Branches: MAIN
CVS tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: mjf-ufs-trans
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +4 -4 lines
Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.232.4.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 06:01:12 2007 UTC (17 years, 8 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.232.4.1: preferred, colored; branchpoint 1.232: preferred, colored
Changes since revision 1.232.4.1: +3 -3 lines
Sync with HEAD.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Sun Mar 4 06:03:48 2007 UTC (17 years, 9 months ago) by christos
Branches: MAIN
Branch point for: vmlocking
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +3 -3 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.232.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:55:27 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +43 -43 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.204.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:12:29 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.2: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.2: +43 -43 lines
sync with head.

Revision 1.234: download - view: text, markup, annotated - select for diffs
Thu Feb 22 06:05:01 2007 UTC (17 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +34 -34 lines
TRUE -> true, FALSE -> false

Revision 1.233: download - view: text, markup, annotated - select for diffs
Wed Feb 21 23:00:13 2007 UTC (17 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +14 -14 lines
Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.204.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:51:05 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204.2.1: preferred, colored; branchpoint 1.204: preferred, colored
Changes since revision 1.204.2.1: +8 -15 lines
sync with head.

Revision 1.229.2.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:19:33 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.229.2.1: preferred, colored; branchpoint 1.229: preferred, colored; next MAIN 1.230: preferred, colored
Changes since revision 1.229.2.1: +10 -12 lines
sync with head.

Revision 1.227.4.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:39:50 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.227: preferred, colored; next MAIN 1.228: preferred, colored
Changes since revision 1.227: +7 -14 lines
Sync with head.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Wed Nov 1 10:18:27 2006 UTC (18 years, 1 month ago) by yamt
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RC2, netbsd-4-0-RC1
Branch point for: yamt-idlelwp, wrstuden-fixsa, netbsd-4
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +8 -10 lines
remove some __unused from function parameters.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Thu Oct 26 20:00:52 2006 UTC (18 years, 1 month ago) by uwe
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +4 -4 lines
uvm_page_printall: With new PQ_* flags pg->pqflags no longer fits and
makes the output of "show all pages" ragged.  Widen the field to 4 chars.

Revision 1.229.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:07:52 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +10 -8 lines
sync with head

Revision 1.230: download - view: text, markup, annotated - select for diffs
Thu Oct 12 01:32:52 2006 UTC (18 years, 1 month ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +10 -8 lines
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.229: download - view: text, markup, annotated - select for diffs
Sat Sep 16 07:14:38 2006 UTC (18 years, 2 months ago) by yamt
Branches: MAIN
CVS tags: yamt-splraiseipl-base
Branch point for: yamt-splraiseipl
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +4 -13 lines
revert a change which was unintentionally slipped in via yamt-pdpolicy branch.

Revision 1.228: download - view: text, markup, annotated - select for diffs
Fri Sep 15 15:51:13 2006 UTC (18 years, 2 months ago) by yamt
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +16 -14 lines
merge yamt-pdpolicy branch.
	- separate page replacement policy from the rest of kernel
	- implement an alternative replacement policy

Revision 1.215.2.5: download - view: text, markup, annotated - select for diffs
Fri Sep 15 11:54:56 2006 UTC (18 years, 2 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.215.2.4: preferred, colored; branchpoint 1.215: preferred, colored; next MAIN 1.216: preferred, colored
Changes since revision 1.215.2.4: +13 -4 lines
make UVM_KICK_PDAEMON() a real function and stop including
uvm_pdpolicy.h from uvm.h.  this also fixes build of pmap(1).

Revision 1.210.2.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 03:00:13 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.210: preferred, colored; next MAIN 1.211: preferred, colored
Changes since revision 1.210: +439 -131 lines
sync with head

Revision 1.226.2.1: download - view: text, markup, annotated - select for diffs
Thu Jul 13 17:50:13 2006 UTC (18 years, 4 months ago) by gdamore
Branches: gdamore-uart
Diff to: previous 1.226: preferred, colored; next MAIN 1.227: preferred, colored
Changes since revision 1.226: +3 -3 lines
Merge from HEAD.

Revision 1.215.2.4: download - view: text, markup, annotated - select for diffs
Mon Jun 26 12:55:08 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.215.2.3: preferred, colored; branchpoint 1.215: preferred, colored
Changes since revision 1.215.2.3: +43 -14 lines
sync with head.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Sun Jun 25 08:03:46 2006 UTC (18 years, 5 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, rpaulo-netinet-merge-pcb-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: newlock2
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +1 -1 lines
make amap use kmem_alloc, rather than malloc.
(ie. make it use kernel_map, rather than kmem_map.)
kmem_map is more restricted than kernel_map,
and there's no point for amap to use it.

Revision 1.204.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:12:40 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +517 -213 lines
sync with head.

Revision 1.224.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 19 04:11:44 2006 UTC (18 years, 5 months ago) by chap
Branches: chap-midi
Diff to: previous 1.224: preferred, colored; next MAIN 1.225: preferred, colored
Changes since revision 1.224: +42 -22 lines
Sync with head.

Revision 1.210.4.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:39:45 2006 UTC (18 years, 6 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.210.4.1: preferred, colored; next MAIN 1.211: preferred, colored
Changes since revision 1.210.4.1: +193 -66 lines
Sync with head.

Revision 1.226: download - view: text, markup, annotated - select for diffs
Thu May 25 14:27:28 2006 UTC (18 years, 6 months ago) by yamt
Branches: MAIN
CVS tags: simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base
Branch point for: gdamore-uart
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +42 -13 lines
move wait points for kva from upper layers to vm_map.  PR/33185 #1.

XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html

Revision 1.216.2.1: download - view: text, markup, annotated - select for diffs
Wed May 24 15:50:48 2006 UTC (18 years, 6 months ago) by tron
Branches: peter-altq
Diff to: previous 1.216: preferred, colored; next MAIN 1.217: preferred, colored
Changes since revision 1.216: +236 -105 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.215.2.3: download - view: text, markup, annotated - select for diffs
Wed May 24 10:59:30 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.215.2.2: preferred, colored; branchpoint 1.215: preferred, colored
Changes since revision 1.215.2.2: +236 -105 lines
sync with head.

Revision 1.225: download - view: text, markup, annotated - select for diffs
Sat May 20 15:45:38 2006 UTC (18 years, 6 months ago) by elad
Branches: MAIN
CVS tags: yamt-pdpolicy-base5
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +2 -11 lines
Better implementation of PaX MPROTECT, after looking some more into the
code and not trying to use temporary solutions.

Lots of comments and help from YAMAMOTO Takashi, also thanks to the PaX
author for being quick to recognize that something fishy's going on. :)

Hook up in mmap/vmcmd rather than (ugh!) uvm_map_protect().

Next time I suggest to commit a temporary solution just revoke my
commit bit.

Revision 1.224: download - view: text, markup, annotated - select for diffs
Tue May 16 00:08:25 2006 UTC (18 years, 6 months ago) by elad
Branches: MAIN
Branch point for: chap-midi
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +12 -2 lines
Introduce PaX MPROTECT -- mprotect(2) restrictions used to strengthen
W^X mappings.

Disabled by default.

First proposed in:

	http://mail-index.netbsd.org/tech-security/2005/12/18/0000.html

More information in:

	http://pax.grsecurity.net/docs/mprotect.txt

Read relevant parts of options(4) and sysctl(3) before using!

Lots of thanks to the PaX author and Matt Thomas.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Sun May 14 21:38:17 2006 UTC (18 years, 6 months ago) by elad
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +0 -0 lines
integrate kauth.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Sun May 14 08:22:50 2006 UTC (18 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +88 -44 lines
- rename uvm_tree_sanity to uvm_map_check and add some
  (non tree related) checks.
- remove treesanity_label.  instead, just panic if any corruption is detected.

Revision 1.221: download - view: text, markup, annotated - select for diffs
Sun May 14 08:21:36 2006 UTC (18 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +22 -6 lines
- uvm_mapent_trymerge: don't forget to update hints.
- clear_hints: new function.
- uvm_map_replace: use clear_hints.  no functional change.
- add some assertions.

Revision 1.220: download - view: text, markup, annotated - select for diffs
Sun May 14 08:20:35 2006 UTC (18 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +3 -2 lines
update first_free correctly.

Revision 1.215.4.2: download - view: text, markup, annotated - select for diffs
Thu May 11 23:32:03 2006 UTC (18 years, 6 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.215.4.1: preferred, colored; branchpoint 1.215: preferred, colored; next MAIN 1.216: preferred, colored
Changes since revision 1.215.4.1: +122 -53 lines
sync with head

Revision 1.219: download - view: text, markup, annotated - select for diffs
Wed May 3 14:12:01 2006 UTC (18 years, 7 months ago) by yamt
Branches: MAIN
CVS tags: elad-kernelauth-base
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +37 -1 lines
uvm_km_suballoc: consider kva overhead of "kmapent".
fixes PR/31275 (me) and PR/32287 (Christian Biere).

Revision 1.210.4.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:40:29 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +249 -68 lines
Sync with head.

Revision 1.218: download - view: text, markup, annotated - select for diffs
Fri Apr 21 14:03:01 2006 UTC (18 years, 7 months ago) by yamt
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +85 -52 lines
- share some code between uvm_map_clip_end and uvm_map_clip_start.
- add a map entry sanity-check function, uvm_mapent_check().

discussed on source-changes@.

Revision 1.215.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 19 03:58:21 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +6 -6 lines
oops - *really* sync to head this time.

Revision 1.217: download - view: text, markup, annotated - select for diffs
Thu Apr 13 01:11:08 2006 UTC (18 years, 7 months ago) by christos
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +3 -3 lines
Coverity CID 762: Protect against NULL dereferencing entry->object.uvm_obj
like we do a few lines before. Maybe all the tests should be changed
to UVM_ET_ISOBJ(), or the macro should do it internally?

Revision 1.215.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 1 12:07:58 2006 UTC (18 years, 8 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.215.2.1: preferred, colored; branchpoint 1.215: preferred, colored
Changes since revision 1.215.2.1: +5 -5 lines
sync with head.

Revision 1.216: download - view: text, markup, annotated - select for diffs
Wed Mar 15 18:09:25 2006 UTC (18 years, 8 months ago) by drochner
Branches: MAIN
CVS tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, peter-altq-base
Branch point for: peter-altq
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -5 lines
-clean up the interface to uvm_fault: the "fault type" didn't serve
 any purpose (done by a macro, so we don't save any cycles for now)
-kill vm_fault_t; it is not needed for real faults, and for simulated
 faults (wiring) it can be replaced by UVM internal flags
-remove <uvm/uvm_fault.h> from uvm_extern.h again

Revision 1.215.2.1: download - view: text, markup, annotated - select for diffs
Sun Mar 5 12:51:09 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -12 lines
separate page replacement policy from the rest of kernel.

Revision 1.215: download - view: text, markup, annotated - select for diffs
Wed Mar 1 12:38:44 2006 UTC (18 years, 9 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pdpolicy-base2, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, elad-kernelauth
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +20 -6 lines
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.

Revision 1.206.2.5: download - view: text, markup, annotated - select for diffs
Wed Mar 1 09:28:51 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.206.2.4: preferred, colored; next MAIN 1.207: preferred, colored
Changes since revision 1.206.2.4: +32 -2 lines
sync with head.

Revision 1.214: download - view: text, markup, annotated - select for diffs
Wed Feb 22 22:20:56 2006 UTC (18 years, 9 months ago) by bjh21
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +13 -5 lines
Include page ownership information in the output of the DDB "show all pages"
command if UVM_PAGE_TRKOWN is enabled.

Revision 1.213: download - view: text, markup, annotated - select for diffs
Sun Feb 19 18:52:29 2006 UTC (18 years, 9 months ago) by bjh21
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +24 -2 lines
Add a "show all pages" command to DDB which prints one line per physical
page in the system.  Useful for getting some idea where all your memory's
gone, at least on a sufficiently small system.

Revision 1.206.2.4: download - view: text, markup, annotated - select for diffs
Sat Feb 18 15:39:31 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.206.2.3: preferred, colored
Changes since revision 1.206.2.3: +115 -11 lines
sync with head.

Revision 1.212: download - view: text, markup, annotated - select for diffs
Wed Feb 15 14:06:45 2006 UTC (18 years, 9 months ago) by yamt
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +8 -8 lines
- amap_copy: take a "flags" argument instead of booleans.
- add AMAP_COPY_NOMERGE flag, and use it for uvm_map_extract.
  PR/32806 from Julio M. Merino Vidal.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Sat Feb 11 12:45:07 2006 UTC (18 years, 9 months ago) by yamt
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +105 -1 lines
remove the following options.  no objections on tech-kern@.

	UVM_PAGER_INLINE
	UVM_AMAP_INLINE
	UVM_PAGE_INLINE
	UVM_MAP_INLINE

Revision 1.206.2.3: download - view: text, markup, annotated - select for diffs
Wed Feb 1 14:52:48 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.206.2.2: preferred, colored
Changes since revision 1.206.2.2: +21 -13 lines
sync with head.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Sat Jan 21 13:34:15 2006 UTC (18 years, 10 months ago) by yamt
Branches: MAIN
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +18 -10 lines
implement compat_linux mremap.

Revision 1.209: download - view: text, markup, annotated - select for diffs
Sat Jan 21 13:10:41 2006 UTC (18 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +1 -1 lines
uvm_map_replace: remove a wrong comment.

Revision 1.206.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 15 10:03:05 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.206.2.1: preferred, colored
Changes since revision 1.206.2.1: +52 -64 lines
sync with head.

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sun Jan 15 08:31:31 2006 UTC (18 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +9 -7 lines
make some debug statistics evcnt.

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sun Jan 8 09:18:27 2006 UTC (18 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +43 -57 lines
clean up uvm_map evcnt code.  no functional changes.

Revision 1.206.2.1: download - view: text, markup, annotated - select for diffs
Sat Dec 31 11:21:26 2005 UTC (18 years, 11 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +20 -6 lines
- add a function to add a reference to a vmspace.
- add a macro to check if a vmspace belongs to kernel.

Revision 1.206: download - view: text, markup, annotated - select for diffs
Sat Dec 24 20:45:10 2005 UTC (18 years, 11 months ago) by perry
Branches: MAIN
Branch point for: yamt-uio_vmspace
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +12 -12 lines
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.205: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:25:29 2005 UTC (18 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +2 -2 lines
merge ktrace-lwp.

Revision 1.136.2.10: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:12:39 2005 UTC (19 years ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.9: preferred, colored; next MAIN 1.137: preferred, colored
Changes since revision 1.136.2.9: +177 -76 lines
Sync with HEAD. Here we go again...

Revision 1.204: download - view: text, markup, annotated - select for diffs
Tue Jun 28 05:25:42 2005 UTC (19 years, 5 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +3 -3 lines
Clean up the cpp macro used to say "we're compiling this specific C file".

Revision 1.203: download - view: text, markup, annotated - select for diffs
Tue Jun 28 01:07:56 2005 UTC (19 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +16 -27 lines
Clean up the use of __inline in this file.  In particular, don't inline
really big chunks of code.  This saves almost 2.5K on a GENERIC i386
kernel, and has the added benefit of not polluting the I$ so much.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Mon Jun 13 20:39:14 2005 UTC (19 years, 5 months ago) by jmc
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +3 -3 lines
Change signature of uvm_kmapent_map defintiion to __INLINE to match prototype

Revision 1.201: download - view: text, markup, annotated - select for diffs
Fri Jun 10 22:00:52 2005 UTC (19 years, 5 months ago) by dsl
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +26 -18 lines
If we are builging a small kernel [1], don't inline all these functions.
Saves over 2k and lets i386 rescue_tiny build again.
[1] if MALLOC_NOINLINE is defined - not ideal but...

Revision 1.200: download - view: text, markup, annotated - select for diffs
Thu Jun 2 17:01:44 2005 UTC (19 years, 6 months ago) by matt
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +3 -3 lines
When writing coredumps, don't write zero uninstantiated demand-zero pages.
Also, with ELF core dumps, trim trailing zeroes from sections.  These two
changes can shrink coredumps by over 50% in size.

Revision 1.199: download - view: text, markup, annotated - select for diffs
Sun May 29 21:06:33 2005 UTC (19 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +11 -11 lines
avoid shadow variables.
remove unneeded casts.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Sun May 22 21:37:56 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +4 -2 lines
uvm_kmapent_free: add missing vm_map_lock/unlock.

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed May 18 01:36:16 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +11 -6 lines
uvm_mapent_trymerge: adjust object offset when necessary.

Revision 1.196: download - view: text, markup, annotated - select for diffs
Wed May 18 01:34:53 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +4 -3 lines
redo the previous (uvm_map.c rev.1.195) correctly.

Revision 1.195: download - view: text, markup, annotated - select for diffs
Tue May 17 21:45:24 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +10 -8 lines
uvm_mapent_trymerge: add missing checks.

Revision 1.194: download - view: text, markup, annotated - select for diffs
Tue May 17 13:55:33 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +132 -41 lines
(try to) merge map entries in fault handler.

Revision 1.193: download - view: text, markup, annotated - select for diffs
Tue May 17 13:54:19 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +6 -12 lines
revert uvm_map.c rev.1.190 in favor of merging in fault handler.

Revision 1.164.2.3.2.2: download - view: text, markup, annotated - select for diffs
Wed May 11 19:15:43 2005 UTC (19 years, 6 months ago) by riz
Branches: netbsd-2
CVS tags: netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1
Diff to: previous 1.164.2.3.2.1: preferred, colored; branchpoint 1.164.2.3: preferred, colored; next MAIN 1.165: preferred, colored
Changes since revision 1.164.2.3.2.1: +6 -5 lines
Pull up revision 1.188 (requested by dbj in ticket #1409):
use voff_t instead of vaddr_t to hold file offset passed to pgo_put

Revision 1.192: download - view: text, markup, annotated - select for diffs
Wed May 11 13:02:25 2005 UTC (19 years, 6 months ago) by yamt
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +5 -5 lines
allocate anons on-demand, rather than reserving static amount of
them on boot/swapon.

Revision 1.191: download - view: text, markup, annotated - select for diffs
Thu May 5 01:58:51 2005 UTC (19 years, 7 months ago) by yamt
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +4 -4 lines
- amap_extend: don't extend amap beyond UVM_AMAP_LARGE.
- uvm_map_enter: if we fail to extend amap, just give up merging instead of
  bailing out immediately.

Revision 1.186.2.2: download - view: text, markup, annotated - select for diffs
Sun May 1 11:05:06 2005 UTC (19 years, 7 months ago) by tron
Branches: netbsd-3
CVS tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Diff to: previous 1.186.2.1: preferred, colored; branchpoint 1.186: preferred, colored; next MAIN 1.187: preferred, colored
Changes since revision 1.186.2.1: +2 -0 lines
Pull up revision 1.189 (requested by oster in ticket #223):
uvm_map: don't leak a preallocated map entry on error.

Revision 1.181.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:45 2005 UTC (19 years, 7 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.181: preferred, colored; next MAIN 1.182: preferred, colored
Changes since revision 1.181: +60 -38 lines
sync with -current

Revision 1.190: download - view: text, markup, annotated - select for diffs
Fri Apr 29 09:05:21 2005 UTC (19 years, 7 months ago) by yamt
Branches: MAIN
CVS tags: kent-audio2-base
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +10 -4 lines
uvm_map_enter: don't bother to defer amap allocation if there's a mergable
existing entry.  although there're merits and demerits, i think it benefits
common cases.

Revision 1.189: download - view: text, markup, annotated - select for diffs
Thu Apr 28 14:40:43 2005 UTC (19 years, 7 months ago) by yamt
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +4 -2 lines
uvm_map: don't leak a preallocated map entry on error.

Revision 1.186.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 8 00:22:48 2005 UTC (19 years, 8 months ago) by tron
Branches: netbsd-3
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +6 -5 lines
Pull up revision 1.188 (requested by dbj in ticket #123):
use voff_t instead of vaddr_t to hold file offset passed to pgo_put

Revision 1.188: download - view: text, markup, annotated - select for diffs
Thu Apr 7 06:44:15 2005 UTC (19 years, 8 months ago) by dbj
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +6 -5 lines
use voff_t instead of vaddr_t to hold file offset passed to pgo_put

Revision 1.164.2.3.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 6 15:23:22 2005 UTC (19 years, 8 months ago) by he
Branches: netbsd-2
Diff to: previous 1.164.2.3: preferred, colored
Changes since revision 1.164.2.3: +19 -19 lines
Pull up revision 1.176 (via patch, requested by yamt in ticket #1061):
  Don't merge incompatible map entries, e.g. private and shared.

Revision 1.136.2.9: download - view: text, markup, annotated - select for diffs
Fri Apr 1 14:32:12 2005 UTC (19 years, 8 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.8: preferred, colored
Changes since revision 1.136.2.8: +24 -9 lines
Sync with HEAD.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Fri Apr 1 11:59:38 2005 UTC (19 years, 8 months ago) by yamt
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +24 -9 lines
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.183.2.3: download - view: text, markup, annotated - select for diffs
Sat Mar 19 08:37:07 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.183.2.2: preferred, colored; branchpoint 1.183: preferred, colored; next MAIN 1.184: preferred, colored
Changes since revision 1.183.2.2: +8 -4 lines
sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.136.2.8: download - view: text, markup, annotated - select for diffs
Fri Mar 4 16:55:00 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.7: preferred, colored
Changes since revision 1.136.2.7: +8 -4 lines
Sync with HEAD.

Hi Perry!

Revision 1.186: download - view: text, markup, annotated - select for diffs
Mon Feb 28 16:55:54 2005 UTC (19 years, 9 months ago) by chs
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +7 -3 lines
add back rev. 1.29 of vm/vm_map.c, which was apparently lost in the UVM merge:
msync(MS_INVALIDATE) should fail if any part of the region is wired.

Revision 1.185: download - view: text, markup, annotated - select for diffs
Sat Feb 26 22:31:44 2005 UTC (19 years, 9 months ago) by perry
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +3 -3 lines
nuke trailing whitespace

Revision 1.136.2.7: download - view: text, markup, annotated - select for diffs
Tue Feb 15 21:34:02 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.6: preferred, colored
Changes since revision 1.136.2.6: +14 -13 lines
Sync with HEAD.

Revision 1.183.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 12 18:17:56 2005 UTC (19 years, 9 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.183.2.1: preferred, colored; branchpoint 1.183: preferred, colored
Changes since revision 1.183.2.1: +14 -13 lines
sync with head.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Fri Feb 11 02:12:03 2005 UTC (19 years, 9 months ago) by chs
Branches: MAIN
CVS tags: yamt-km-base2
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +14 -13 lines
use vm_map_{min,max}() instead of dereferencing the vm_map pointer directly.
define and use vm_map_set{min,max}() for modifying these values.
remove the {min,max}_offset aliases for these vm_map fields to be more
namespace-friendly.  PR 26475.

Revision 1.183.2.1: download - view: text, markup, annotated - select for diffs
Tue Jan 25 12:58:28 2005 UTC (19 years, 10 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +24 -9 lines
- don't use uvm_object or managed mappings for wired allocations.
  (eg. malloc(9))
- simplify uvm_km_* apis.

Revision 1.136.2.6: download - view: text, markup, annotated - select for diffs
Mon Jan 24 08:36:05 2005 UTC (19 years, 10 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.5: preferred, colored
Changes since revision 1.136.2.5: +2 -10 lines
Sync with HEAD.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Sun Jan 23 15:58:13 2005 UTC (19 years, 10 months ago) by chs
Branches: MAIN
CVS tags: yamt-km-base
Branch point for: yamt-km
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +2 -10 lines
pmap_wired_count() is now available on all platforms,
remove the code for the case where it's not defined.

Revision 1.136.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 17 19:33:11 2005 UTC (19 years, 10 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.4: preferred, colored
Changes since revision 1.136.2.4: +662 -152 lines
Sync with HEAD.

Revision 1.182: download - view: text, markup, annotated - select for diffs
Mon Jan 17 04:37:20 2005 UTC (19 years, 10 months ago) by atatat
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +4 -3 lines
Convert the PMAP_PREFER() macro from two arguments (offset and hint)
to four (adding size and direction).

In order for topdown uvm to be an option on ports using PMAP_PREFER,
they will need to "prefer" lower addresses if topdown is being used.
Additionally, at least one port also needs to know the size.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Fri Jan 14 14:25:40 2005 UTC (19 years, 10 months ago) by yamt
Branches: MAIN
Branch point for: kent-audio2
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +14 -14 lines
don't use uvm_kmapent_alloc for non-intrsafe kernel submaps
(namely exec_map and phys_map) becuase:
- normal vmmpepl is fine for them.
- some of them are tightly sized.  eg. size of exec_map on vax is just NCARGS.

should fix vax boot failure reported by Johnny Billquist on current-users@.

Revision 1.180: download - view: text, markup, annotated - select for diffs
Thu Jan 13 11:50:32 2005 UTC (19 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +40 -4 lines
in uvm_unmap_remove, always wakeup va waiters if any.
uvm_km_free_wakeup is now a synonym of uvm_km_free.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Wed Jan 12 09:34:35 2005 UTC (19 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +5 -2 lines
don't reserve (uvm_mapent_reserve) entries for malloc/pool backends
because it isn't necessary or safe.
reported and tested by Denis Lagno.  PR/28897.

Revision 1.178: download - view: text, markup, annotated - select for diffs
Mon Jan 3 19:46:22 2005 UTC (19 years, 11 months ago) by yamt
Branches: MAIN
CVS tags: kent-audio1-beforemerge
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +3 -3 lines
reapply uvm_map.c rev.1.156 (use a zero-sized array instead of
c99 flexible array member) for ports which still use gcc 2.95.
from Havard Eidnes.

Revision 1.177: download - view: text, markup, annotated - select for diffs
Sat Jan 1 21:12:59 2005 UTC (19 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +20 -2 lines
uvm_unmap_remove: debug check to ensure that
unmapped regions doesn't have any remaining page mappings.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Sat Jan 1 21:11:51 2005 UTC (19 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +19 -19 lines
don't merge incompatible map entries.  eg. private and shared.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Sat Jan 1 21:02:13 2005 UTC (19 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +33 -10 lines
introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Sat Jan 1 21:00:06 2005 UTC (19 years, 11 months ago) by yamt
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +564 -135 lines
for in-kernel maps,
- allocate kva for vm_map_entry from the map itsself and
  remove the static limit, MAX_KMAPENT.
- keep merged entries for later splitting to fix allocate-to-free problem.
  PR/24039.

Revision 1.136.2.4: download - view: text, markup, annotated - select for diffs
Tue Oct 19 15:58:30 2004 UTC (20 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.3: preferred, colored
Changes since revision 1.136.2.3: +8 -3 lines
Sync with HEAD

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sat Sep 25 04:19:38 2004 UTC (20 years, 2 months ago) by yamt
Branches: MAIN
CVS tags: kent-audio1-base, kent-audio1
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +8 -3 lines
uvm_map_printit:
- print wired_count if available.
- fix a printf format.

Revision 1.136.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:39:27 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.2: preferred, colored
Changes since revision 1.136.2.2: +2 -2 lines
Fix the sync with head I botched.

Revision 1.136.2.2: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:57:12 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136.2.1: preferred, colored
Changes since revision 1.136.2.1: +0 -0 lines
Sync with HEAD.

Revision 1.136.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:57:06 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +783 -356 lines
Sync with HEAD

Revision 1.172: download - view: text, markup, annotated - select for diffs
Wed May 19 22:02:05 2004 UTC (20 years, 6 months ago) by he
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +5 -3 lines
Move variable declaration up before the code.  Fixes compile error
for vax, and also conforms better to KNF.

Revision 1.164.2.3: download - view: text, markup, annotated - select for diffs
Sun May 9 09:01:32 2004 UTC (20 years, 7 months ago) by jdc
Branches: netbsd-2-0
CVS tags: netbsd-2-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE
Branch point for: netbsd-2
Diff to: previous 1.164.2.2: preferred, colored; branchpoint 1.164: preferred, colored; next MAIN 1.165: preferred, colored
Changes since revision 1.164.2.2: +3 -3 lines
Pull up revision 1.170 (requested by petrov in ticket #270)

Revert default uvm counters, rename UVMMAP_COUNTERS to UVMMAP_NOCOUNTERS.

Revision 1.164.2.2: download - view: text, markup, annotated - select for diffs
Sun May 9 08:54:35 2004 UTC (20 years, 7 months ago) by jdc
Branches: netbsd-2-0
Diff to: previous 1.164.2.1: preferred, colored; branchpoint 1.164: preferred, colored
Changes since revision 1.164.2.1: +47 -30 lines
Pull up revision 1.169 (requested by petrov in ticket #269)

Replace uvm counters with evcnt, initialize them through __link_set (from Matt Thomas),
disable counters by default and add configuration option UVMMAP_COUNTERS.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Tue May 4 21:33:40 2004 UTC (20 years, 7 months ago) by pk
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +10 -11 lines
Since a `vmspace' always includes a `vm_map' we can re-use vm_map's
reference count lock to also protect the vmspace's reference count.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Mon May 3 20:10:36 2004 UTC (20 years, 7 months ago) by petrov
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +3 -3 lines
Revert default uvm counters, rename UVMMAP_COUNTERS to UVMMAP_NOCOUNTERS.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Sat May 1 19:40:39 2004 UTC (20 years, 7 months ago) by petrov
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +47 -30 lines
Replace uvm counters with evcnt, initialize them through __link_set (from Matt Thomas),
disable counters by default and add configuration option UVMMAP_COUNTERS.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Tue Apr 27 09:50:43 2004 UTC (20 years, 7 months ago) by junyoung
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +4 -4 lines
Fix typo in comments.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Tue Apr 27 09:45:02 2004 UTC (20 years, 7 months ago) by junyoung
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +5 -5 lines
FINDSPACE_FIXED -> UVM_FLAG_FIXED in comment.

Revision 1.166: download - view: text, markup, annotated - select for diffs
Sun Apr 25 16:42:45 2004 UTC (20 years, 7 months ago) by simonb
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +8 -15 lines
Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.164.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 31 18:04:40 2004 UTC (20 years, 8 months ago) by tron
Branches: netbsd-2-0
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +9 -12 lines
Pull up revision 1.165 (requested by yamt in ticket #23):
uvm_map_findspace: don't return unaligned address if alignment is specified.
discussed on tech-kern@.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Tue Mar 30 12:59:09 2004 UTC (20 years, 8 months ago) by yamt
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +9 -12 lines
uvm_map_findspace: don't return unaligned address if alignment is specified.
discussed on tech-kern@.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Wed Mar 24 07:47:33 2004 UTC (20 years, 8 months ago) by junyoung
Branches: MAIN
CVS tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +7 -7 lines
Drop trailing spaces.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Wed Mar 17 23:58:12 2004 UTC (20 years, 8 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +4 -9 lines
Something I posted to tech-kern a long time ago...
Slightly simplify uvm_map_extract() slightly by eliminating "oldstart".

Revision 1.162: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:03:47 2004 UTC (20 years, 8 months ago) by pooka
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +5 -5 lines
Reflect dropping mappings in map_size.
Avoids panic on DIAGNOSTIC kernels.

ok by chs

Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Feb 10 01:30:49 2004 UTC (20 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +107 -388 lines
Back out the changes in
http://mail-index.netbsd.org/source-changes/2004/01/29/0027.html
since they don't really fix the problem.

Incorpate one fix:  Mark uvm_map_entry's that were created with
UVM_FLAG_NOMERGE so that they will not be used as future merge
candidates.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Mon Feb 9 13:11:21 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +2 -16 lines
- borrow vmspace0 in uvm_proc_exit instead of uvmspace_free.
  the latter is not a appropriate place to do so and it broke vfork.
- deactivate pmap before calling cpu_exit() to keep a balance of
  pmap_activate/deactivate.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Sat Feb 7 13:22:19 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +6 -3 lines
introduce a new patchable variable, uvm_debug_check_rbtree,
which is zero by default.
perform rbtree sanity checks only when it isn't zero
because the check is very heavy weight especially when
there're many entries.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sat Feb 7 10:05:52 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +16 -2 lines
don't deactivate pmap in exit1 because we'll touch the pmap later.
instead, borrow vmspace0 immediately before destroying the pmap
in uvmspace_free.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Sat Feb 7 08:02:21 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +12 -2 lines
uvm_kmapent_alloc:
in the case that there's no cached entries,
if kmem_map is already up, allocate a entry from it
so that we won't try to vm_map_lock recursively.
XXX assuming usage pattern of kmem_map.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Mon Feb 2 23:13:44 2004 UTC (20 years, 10 months ago) by he
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +3 -3 lines
Since the playstation2 port still uses a variant of gcc 2.95.2,
change to use a zero-sized array instead of c99 flexible array
member in a struct.

OK'ed by yamt.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Fri Jan 30 11:56:39 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +2 -6 lines
remove wrong assertions.
sparc's alloc_cpuinfo_global_va() partially unmaps kva range in kernel_map.

noted by Juergen Hannken-Illjes on current-users@.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Thu Jan 29 12:07:29 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +6 -6 lines
some English fixes from Soren Jacobsen.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Thu Jan 29 12:06:02 2004 UTC (20 years, 10 months ago) by yamt
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +382 -98 lines
- split uvm_map() into two functions for the followings.
- for in-kernel maps, disable map entry merging so that
  unmap operations won't block. (workaround for PR/24039)
- for in-kernel maps, allocate kva for vm_map_entry from
  the map itsself and eliminate MAX_KMAPENT and
  uvm_map_entry_kmem_pool.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Fri Dec 19 06:02:50 2003 UTC (20 years, 11 months ago) by simonb
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +8 -10 lines
Unindent a code block that doens't need to be indented.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Nov 13 02:44:02 2003 UTC (21 years ago) by chs
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +4 -4 lines
two changes in improve scalability:

 (1) split the single list of pages allocated to a pool into three lists:
     completely full, partially full, and completely empty.
     there is no longer any need to traverse any list looking for a
     certain type of page.

 (2) replace the 8-element hash table for out-of-page page headers
     with a splay tree.

these two changes (together with the recent enhancements to the wait code)
give us linear scaling for a fork+exit microbenchmark.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Thu Nov 6 12:45:26 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +6 -6 lines
fix wrong assertions.
they can be false due to alignment requiments (and PMAP_PREFER).

Revision 1.149: download - view: text, markup, annotated - select for diffs
Wed Nov 5 15:34:50 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +6 -4 lines
don't move hint backward.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Wed Nov 5 15:09:09 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +46 -14 lines
- fix a reversed comparison.
- fix "nextgap" case.
- make sure don't get addresses behind hint.
- deal with integer wraparounds better.
- assertions.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Sun Nov 2 07:58:52 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +3 -3 lines
fix a wrong assertion.  pointed by Christian Limpach.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sat Nov 1 19:56:09 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +7 -5 lines
- update uvm_map::size fewer places.
- add related assertions.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Nov 1 19:45:13 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +9 -2 lines
commit rest of the previous (rbtree).

(i should check .rej files before commit, sorry)

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sat Nov 1 11:09:02 2003 UTC (21 years, 1 month ago) by yamt
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +392 -14 lines
track map entries and free spaces using red-black tree
to improve scalability of operations on the map.

originally done by Niels Provos for OpenBSD.
tweaked for NetBSD by me with some advices from enami tsugutomo.
discussed on tech-kern@ and tech-perform@.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sat Oct 25 23:05:45 2003 UTC (21 years, 1 month ago) by junyoung
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +3 -3 lines
KNF.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Thu Oct 9 03:12:29 2003 UTC (21 years, 2 months ago) by enami
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +5 -5 lines
Fix indent.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Thu Oct 9 02:44:54 2003 UTC (21 years, 2 months ago) by atatat
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +3 -3 lines
When pulling back an amap to cover the new allocation along with the
previous entry, don't add the size to the extension -- it's already
been added to the end of the previous entry.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Oct 2 00:02:10 2003 UTC (21 years, 2 months ago) by enami
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +146 -80 lines
Rewrite uvm_map_findspace() to improve readability and to fix a bug that
it may return space already in use as free space under some condition.
The symptom of the bug is that exec fails if stack is unlimited on
topdown VM kernel.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Oct 1 23:08:32 2003 UTC (21 years, 2 months ago) by enami
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +58 -52 lines
Some whitespace fixes.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Wed Oct 1 22:50:15 2003 UTC (21 years, 2 months ago) by enami
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +63 -142 lines
ansi'fy.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Tue Aug 26 15:12:18 2003 UTC (21 years, 3 months ago) by yamt
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +3 -3 lines
use VM_PAGE_TO_PHYS macro instead of using phys_addr directly.

Revision 1.118.8.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 14:29:52 2003 UTC (21 years, 6 months ago) by tron
Branches: netbsd-1-6
CVS tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002
Diff to: previous 1.118: preferred, colored; next MAIN 1.119: preferred, colored
Changes since revision 1.118: +14 -7 lines
Pull up revision 1.119 (requested by skrll):
add a new km flag UVM_KMF_CANFAIL, which causes uvm_km_kmemalloc() to
return failure if swap is full and there are no free physical pages.
have malloc() use this flag if M_CANFAIL is passed to it.
use M_CANFAIL to allow amap_extend() to fail when memory is scarce.
this should prevent most of the remaining hangs in low-memory situations.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Wed Apr 9 21:39:29 2003 UTC (21 years, 8 months ago) by thorpej
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +7 -4 lines
In uvm_map_clean(), only call pgo_put if the object has one.
From Quentin Garnier <quatriemek.com!netbsd>.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Sun Mar 2 08:57:49 2003 UTC (21 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +3 -3 lines
In uvm_map_space, if the current entry is above the new space use the
previous entry.  (not if the current entry starts at the end of the new
space; that case doesn't take into account if the new space had a specified
alignment).

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun Mar 2 02:55:03 2003 UTC (21 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +8 -4 lines
When finding an aligned block, we need to truncate in topdown, not roundup.

Revision 1.133: download - view: text, markup, annotated - select for diffs
Sun Feb 23 04:53:51 2003 UTC (21 years, 9 months ago) by simonb
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +2 -4 lines
Remove assigned-to but not used variable.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Fri Feb 21 16:38:44 2003 UTC (21 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +3 -3 lines
fix a tpyo in a comment.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Thu Feb 20 22:16:08 2003 UTC (21 years, 9 months ago) by atatat
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +44 -7 lines
Introduce "top down" memory management for mmap()ed allocations.  This
means that the dynamic linker gets mapped in at the top of available
user virtual memory (typically just below the stack), shared libraries
get mapped downwards from that point, and calls to mmap() that don't
specify a preferred address will get mapped in below those.

This means that the heap and the mmap()ed allocations will grow
towards each other, allowing one or the other to grow larger than
before.  Previously, the heap was limited to MAXDSIZ by the placement
of the dynamic linker (and the process's rlimits) and the space
available to mmap was hobbled by this reservation.

This is currently only enabled via an *option* for the i386 platform
(though other platforms are expected to follow).  Add "options
USE_TOPDOWN_VM" to your kernel config file, rerun config, and rebuild
your kernel to take advantage of this.

Note that the pmap_prefer() interface has not yet been modified to
play nicely with this, so those platforms require a bit more work
(most notably the sparc) before they can use this new memory
arrangement.

This change also introduces a VM_DEFAULT_ADDRESS() macro that picks
the appropriate default address based on the size of the allocation or
the size of the process's text segment accordingly.  Several drivers
and the SYSV SHM address assignment were changed to use this instead
of each one picking their own "default".

Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Feb 1 06:23:55 2003 UTC (21 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +5 -2 lines
Add extensible malloc types, adapted from FreeBSD.  This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue Jan 21 00:03:07 2003 UTC (21 years, 10 months ago) by christos
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +4 -3 lines
finally: step 5: disable a KASSERT() if we are doing_shutdown.
now sync from ddb should work as badly as before the nathanw_sa merge.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Sat Jan 18 09:43:00 2003 UTC (21 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +14 -12 lines
Merge the nathanw_sa branch.

Revision 1.93.2.18: download - view: text, markup, annotated - select for diffs
Wed Dec 11 15:44:49 2002 UTC (21 years, 11 months ago) by thorpej
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.93.2.17: preferred, colored; next MAIN 1.94: preferred, colored
Changes since revision 1.93.2.17: +7 -7 lines
Sync with HEAD.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Wed Dec 11 07:14:28 2002 UTC (21 years, 11 months ago) by thorpej
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +7 -7 lines
UVM_KMF_NOWAIT -> UVM_FLAG_NOWAIT

Revision 1.93.2.17: download - view: text, markup, annotated - select for diffs
Wed Dec 11 06:51:55 2002 UTC (21 years, 11 months ago) by thorpej
Branches: nathanw_sa
Diff to: previous 1.93.2.16: preferred, colored
Changes since revision 1.93.2.16: +88 -44 lines
Sync with HEAD.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sat Nov 30 18:28:06 2002 UTC (22 years ago) by bouyer
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +41 -20 lines
Change uvm_km_kmemalloc() to accept flag UVM_KMF_NOWAIT and pass it to
uvm_map(). Change uvm_map() to honnor UVM_KMF_NOWAIT. For this, change
amap_extend() to take a flags parameter instead of just boolean for
direction, and introduce AMAP_EXTEND_FORWARDS and AMAP_EXTEND_NOWAIT flags
(AMAP_EXTEND_BACKWARDS is still defined as 0x0, to keep the code easier to
read).
Add a flag parameter to uvm_mapent_alloc().
This solves a problem a pool_get(PR_NOWAIT) could trigger a pool_get(PR_WAITOK)
in uvm_mapent_alloc().
Thanks to Chuck Silvers, enami tsugutomo, Andrew Brown and Jason R Thorpe
for feedback.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Thu Nov 14 17:58:48 2002 UTC (22 years ago) by atatat
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +56 -33 lines
Implement backwards extension of amaps.  There are three cases to deal
with:

Case #1 -- adjust offset: The slot offset in the aref can be
decremented to cover the required size addition.

Case #2 -- move pages and adjust offset: The slot offset is not large
enough, but the amap contains enough inactive space *after* the mapped
pages to make up the difference, so active slots are slid to the "end"
of the amap, and the slot offset is, again, adjusted to cover the
required size addition.  This optimizes for hitting case #1 again on
the next small extension.

Case #3 -- reallocate, move pages, and adjust offset: There is not
enough inactive space in the amap, so the arrays are reallocated, and
the active pages are copied again to the "end" of the amap, and the
slot offset is adjusted to cover the required size.  This also
optimizes for hitting case #1 on the next backwards extension.

This provides the missing piece in the "forward extension of
vm_map_entries" logic, so the merge failure counters have been
removed.

Not many applications will make any use of this at this time (except
for jvms and perhaps gcc3), but a "top-down" memory allocator will use
it extensively.

Revision 1.93.2.16: download - view: text, markup, annotated - select for diffs
Mon Nov 11 22:17:02 2002 UTC (22 years ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.15: preferred, colored
Changes since revision 1.93.2.15: +226 -77 lines
Catch up to -current

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Nov 2 07:40:47 2002 UTC (22 years, 1 month ago) by perry
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +6 -6 lines
/*CONTCOND*/ while (0)'ed macros

Revision 1.123: download - view: text, markup, annotated - select for diffs
Thu Oct 24 22:22:28 2002 UTC (22 years, 1 month ago) by atatat
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +12 -14 lines
In the case of a double amap_extend() (during a forward merge after a
back merge), don't abort the allocation if the second extend fails,
just abort the forward merge and finish the allocation.

Code reviewed by thorpej.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Thu Oct 24 20:37:59 2002 UTC (22 years, 1 month ago) by atatat
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +37 -12 lines
Call amap_extend() a second time in the case of a bimerge (both
backwards and forwards) if the previous entry was backed by an amap.

Fixes pr kern/18789, where netscape 7 + a java applet actually manage
to incur forward and bimerges in userspace.

Code reviewed by fvdl and thorpej.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Fri Oct 18 13:18:42 2002 UTC (22 years, 1 month ago) by atatat
Branches: MAIN
CVS tags: kqueue-beforemerge, kqueue-aftermerge
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +201 -75 lines
Add an implementation of forward merging of new map entries.  Most new
allocations can be merged either forwards or backwards, meaning no new
entries will be added to the list, and some can even be merged in both
directions, resulting in a surplus entry.

This code typically reduces the number of map entries in the
kernel_map by an order of magnitude or more.  It also makes possible
recovery from the pathological case of "5000 processes created and
then killed", which leaves behind a large number of map entries.

The only forward merge case not covered is the instance of an amap
that has to be extended backwards (WIP).  Note that this only affects
processes, not the kernel (the kernel doesn't use amaps), and that
merge opportunities like this come up *very* rarely, if at all.  Eg,
after being up for eight days, I see only three failures in this
regard, and even those are most likely due to programs I'm developing
to exercise this case.

Code reviewed by thorpej, matt, christos, mrg, chuq, chuck, perry,
tls, and probably others.  I'd like to thank my mother, the Hollywood
Foreign Press...

Revision 1.93.2.15: download - view: text, markup, annotated - select for diffs
Fri Oct 18 02:45:59 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.14: preferred, colored
Changes since revision 1.93.2.14: +30 -34 lines
Catch up to -current.

Revision 1.99.2.6: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:45:06 2002 UTC (22 years, 2 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.99.2.5: preferred, colored; next MAIN 1.100: preferred, colored
Changes since revision 1.99.2.5: +44 -41 lines
sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Sep 22 07:21:29 2002 UTC (22 years, 2 months ago) by chs
Branches: MAIN
CVS tags: kqueue-base
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +32 -36 lines
add a new flag VM_MAP_DYING, which is set before we start
tearing down a vm_map.  use this to skip the pmap_update()
at the end of all the removes, which allows pmaps to optimize
pmap tear-down.  also, use the new pmap_remove_all() hook to
let the pmap implemenation know what we're up to.

Revision 1.93.2.14: download - view: text, markup, annotated - select for diffs
Tue Sep 17 21:24:08 2002 UTC (22 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.13: preferred, colored
Changes since revision 1.93.2.13: +14 -7 lines
Catch up to -current.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Sun Sep 15 16:54:31 2002 UTC (22 years, 2 months ago) by chs
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +14 -7 lines
add a new km flag UVM_KMF_CANFAIL, which causes uvm_km_kmemalloc() to
return failure if swap is full and there are no free physical pages.
have malloc() use this flag if M_CANFAIL is passed to it.
use M_CANFAIL to allow amap_extend() to fail when memory is scarce.
this should prevent most of the remaining hangs in low-memory situations.

Revision 1.93.2.13: download - view: text, markup, annotated - select for diffs
Fri Jul 12 01:40:43 2002 UTC (22 years, 4 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.12: preferred, colored
Changes since revision 1.93.2.12: +2 -3 lines
No longer need to pull in lwp.h; proc.h pulls it in for us.

Revision 1.93.2.12: download - view: text, markup, annotated - select for diffs
Mon Jun 24 22:12:52 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.11: preferred, colored
Changes since revision 1.93.2.11: +3 -3 lines
Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).

Revision 1.93.2.11: download - view: text, markup, annotated - select for diffs
Wed Apr 17 00:06:32 2002 UTC (22 years, 7 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.10: preferred, colored
Changes since revision 1.93.2.10: +1 -0 lines
Catch up to -current.

Revision 1.93.2.10: download - view: text, markup, annotated - select for diffs
Mon Apr 1 07:49:22 2002 UTC (22 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.9: preferred, colored
Changes since revision 1.93.2.9: +5 -7 lines
Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.99.2.5: download - view: text, markup, annotated - select for diffs
Sat Mar 16 16:02:29 2002 UTC (22 years, 8 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.99.2.4: preferred, colored
Changes since revision 1.99.2.4: +5 -7 lines
Catch up with -current.

Revision 1.118.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 12 00:35:30 2002 UTC (22 years, 9 months ago) by thorpej
Branches: newlock
Diff to: previous 1.118: preferred, colored; next MAIN 1.119: preferred, colored
Changes since revision 1.118: +9 -13 lines
Make kentry_lock a spin mutex at IPL_VM, and rename it to kentry_mutex.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Fri Mar 8 20:48:47 2002 UTC (22 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: newlock-base, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, gehenna-devsw-base, gehenna-devsw, eeh-devprop-base, eeh-devprop
Branch point for: newlock, netbsd-1-6
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +5 -7 lines
Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

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

From art@openbsd.org.

Revision 1.36.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 14 14:47:44 2002 UTC (22 years, 10 months ago) by he
Branches: netbsd-1-4
Diff to: previous 1.36.2.4: preferred, colored; branchpoint 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.4: +2 -2 lines
Pull up revision 1.76 (via patch, requested by chs):
  Let uvm_map_extract() set the lower bound on the kernel address
  range itself, instead of having its callers do that.  Fixes
  PR#11972.

Revision 1.99.2.4: download - view: text, markup, annotated - select for diffs
Thu Jan 10 20:05:38 2002 UTC (22 years, 10 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.99.2.3: preferred, colored
Changes since revision 1.99.2.3: +139 -167 lines
Sync kqueue branch with -current.

Revision 1.93.2.9: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:35:02 2002 UTC (22 years, 11 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.8: preferred, colored
Changes since revision 1.93.2.8: +18 -30 lines
Catch up to -current.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Dec 31 22:34:40 2001 UTC (22 years, 11 months ago) by chs
Branches: MAIN
CVS tags: ifpoll-base
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +6 -6 lines
introduce a new UVM fault type, VM_FAULT_WIREMAX.  this is different
from VM_FAULT_WIRE in that when the pages being wired are faulted in,
the simulated fault is at the maximum protection allowed for the mapping
instead of the current protection.  use this in uvm_map_pageable{,_all}()
to fix the problem where writing via ptrace() to shared libraries that
are also mapped with wired mappings in another process causes a
diagnostic panic when the wired mapping is removed.

this is a really obscure problem so it deserves some more explanation.
ptrace() writing to another process ends up down in uvm_map_extract(),
which for MAP_PRIVATE mappings (such as shared libraries) will cause
the amap to be copied or created.  then the amap is made shared
(ie. the AMAP_SHARED flag is set) between the kernel and the ptrace()d
process so that the kernel can modify pages in the amap and have the
ptrace()d process see the changes.  then when the page being modified
is actually faulted on, the object pages (from the shared library vnode)
is copied to a new anon page and inserted into the shared amap.
to make all the processes sharing the amap actually see the new anon
page instead of the vnode page that was there before, we need to
invalidate all the pmap-level mappings of the vnode page in the pmaps
of the processes sharing the amap, but we don't have a good way of
doing this.  the amap doesn't keep track of the vm_maps which map it.
so all we can do at this point is to remove all the mappings of the
page with pmap_page_protect(), but this has the unfortunate side-effect
of removing wired mappings as well.  removing wired mappings with
pmap_page_protect() is a legitimate operation, it can happen when a file
with a wired mapping is truncated.  so the pmap has no way of knowing
whether a request to remove a wired mapping is normal or when it's due to
this weird situation.  so the pmap has to remove the weird mapping.
the process being ptrace()d goes away and life continues.  then,
much later when we go to unwire or remove the wired vm_map mapping,
we discover that the pmap mapping has been removed when it should
still be there, and we panic.

so where did we go wrong?  the problem is that we don't have any way
to update just the pmap mappings that need to be updated in this
scenario.  we could invent a mechanism to do this, but that is much
more complicated than this change and it doesn't seem like the right
way to go in the long run either.

the real underlying problem here is that wired pmap mappings just
aren't a good concept.  one of the original properties of the pmap
design was supposed to be that all the information in the pmap could
be thrown away at any time and the VM system could regenerate it all
through fault processing, but wired pmap mappings don't allow that.
a better design for UVM would not require wired pmap mappings,
and Chuck C. and I are talking about this, but it won't be done
anytime soon, so this change will do for now.

this change has the effect of causing MAP_PRIVATE mappings to be
copied to anonymous memory when they are mlock()d, so that uvm_fault()
doesn't need to copy these pages later when called from ptrace(), thus
avoiding the call to pmap_page_protect() and the panic that results
from this when the mlock()d region is unlocked or freed.  note that
this change doesn't help the case where the wired mapping is MAP_SHARED.

discussed at great length with Chuck Cranor.
fixes PRs 10363, 12554, 12604, 13041, 13487, 14580 and 14853.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Mon Dec 31 20:34:01 2001 UTC (22 years, 11 months ago) by chs
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +6 -3 lines
in uvm_map_clean(), add PGO_CLEANIT to the flags passed to an object's pager.
we need to make sure that vnode pages are written to disk at least once,
otherwise processes could gain access to whatever data was previously stored
in disk blocks which are freshly allocated to a file.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Mon Dec 31 19:21:36 2001 UTC (22 years, 11 months ago) by chs
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +10 -25 lines
fix locking for loaning.  in general we should be looking at the page's
uobject and uanon pointers rather than at the PQ_ANON flag to determine
which lock to hold, since PQ_ANON can be clear even when the anon's lock
is the one which we should hold (if the page was loaned from an object
and then freed by the object).

Revision 1.93.2.8: download - view: text, markup, annotated - select for diffs
Thu Nov 15 11:06:53 2001 UTC (23 years ago) by pk
Branches: nathanw_sa
Diff to: previous 1.93.2.7: preferred, colored
Changes since revision 1.93.2.7: +3 -3 lines
The sparc `kill_user_windows()' special case now takes a `struct lwp *'.

Revision 1.93.2.7: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:19:06 2001 UTC (23 years ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.6: preferred, colored
Changes since revision 1.93.2.6: +42 -68 lines
Catch up to -current.

Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 12 21:19:54 2001 UTC (23 years ago) by thorpej
Branches: thorpej-mips-cache
Diff to: previous 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108: +42 -68 lines
Sync the thorpej-mips-cache branch with -current.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Sat Nov 10 07:37:00 2001 UTC (23 years, 1 month ago) by lukem
Branches: MAIN
CVS tags: thorpej-mips-cache-base
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +8 -5 lines
add RCSIDs, and in some cases, slightly cleanup #include order

Revision 1.113: download - view: text, markup, annotated - select for diffs
Tue Nov 6 05:27:17 2001 UTC (23 years, 1 month ago) by chs
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -64 lines
don't call pmap_copy() from uvmspace_fork().
a new process is very likely to call execve() immediately after fork(),
so most of the time copying the pmap mappings is wasted effort.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue Oct 30 19:05:26 2001 UTC (23 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +18 -1 lines
uvm_map_protect(): Don't allow VM_PROT_EXECUTE to be set on entries
(either the current protection or the max protection) that reference
vnodes associated with a file system mounted with the NOEXEC option.

uvm_mmap(): Don't allow PROT_EXEC mappings to be established of vnodes
which are associated with a file system mounted with the NOEXEC option.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Oct 30 18:52:17 2001 UTC (23 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +2 -2 lines
Correct a comment.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Tue Oct 30 15:32:04 2001 UTC (23 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +2 -2 lines
- Add a new vnode flag VEXECMAP, which indicates that a vnode has
  executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Mon Oct 29 23:06:03 2001 UTC (23 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +16 -1 lines
uvm_mmap(): If a vnode mapping is established with PROT_EXEC, mark the
vnode as VTEXT.

uvm_map_protect(): When VM_PROT_EXECUTE is added to a VA range, mark
all the vnodes mapped by the range as VTEXT.

Revision 1.77.2.3: download - view: text, markup, annotated - select for diffs
Mon Oct 8 19:23:25 2001 UTC (23 years, 2 months ago) by he
Branches: netbsd-1-5
CVS tags: netbsd-1-5-PATCH003
Diff to: previous 1.77.2.2: preferred, colored; branchpoint 1.77: preferred, colored; next MAIN 1.78: preferred, colored
Changes since revision 1.77.2.2: +32 -26 lines
Pull up revision 1.104 (via patch, requested by chuq):
  Create a new pool for map entries, allocated from kmem_map instead
  of kernel_map.  Use this instead of the static map entries when
  allocating map entries for kernel_map.  This greatly reduces the
  number of static map entries used, and should eliminate the
  problems with running out.

Revision 1.103.2.2: download - view: text, markup, annotated - select for diffs
Mon Oct 1 12:48:42 2001 UTC (23 years, 2 months ago) by fvdl
Branches: thorpej-devvp
Diff to: previous 1.103.2.1: preferred, colored; branchpoint 1.103: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103.2.1: +3386 -0 lines
Catch up with -current.

Revision 1.93.2.6: download - view: text, markup, annotated - select for diffs
Wed Sep 26 19:55:15 2001 UTC (23 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.5: preferred, colored
Changes since revision 1.93.2.5: +1 -6 lines
Catch up to -current.
Again.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sun Sep 23 06:35:30 2001 UTC (23 years, 2 months ago) by chs
Branches: MAIN
CVS tags: thorpej-devvp-base3, thorpej-devvp-base2
Branch point for: thorpej-mips-cache
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +1 -6 lines
make pmap_resident_count() non-optional.

Revision 1.93.2.5: download - view: text, markup, annotated - select for diffs
Fri Sep 21 22:37:14 2001 UTC (23 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.4: preferred, colored
Changes since revision 1.93.2.4: +117 -96 lines
Catch up to -current.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Fri Sep 21 07:57:35 2001 UTC (23 years, 2 months ago) by chs
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +7 -1 lines
add an assert.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Sep 15 20:36:46 2001 UTC (23 years, 2 months ago) by chs
Branches: MAIN
CVS tags: post-chs-ubcperf
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +76 -67 lines
a whole bunch of changes to improve performance and robustness under load:

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

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.

Revision 1.99.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 13 01:16:33 2001 UTC (23 years, 2 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.99.2.2: preferred, colored
Changes since revision 1.99.2.2: +34 -30 lines
Update the kqueue branch to HEAD.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Sep 10 21:19:42 2001 UTC (23 years, 2 months ago) by chris
Branches: MAIN
CVS tags: pre-chs-ubcperf
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +6 -6 lines
Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sun Sep 9 19:38:22 2001 UTC (23 years, 3 months ago) by chs
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +29 -27 lines
create a new pool for map entries, allocated from kmem_map instead of
kernel_map.  use this instead of the static map entries when allocating
map entries for kernel_map.  this greatly reduces the number of static
map entries used and should eliminate the problems with running out.

Revision 1.103.2.1
Fri Sep 7 00:50:54 2001 UTC (23 years, 3 months ago) by fvdl
Branches: thorpej-devvp
FILE REMOVED
Changes since revision 1.103: +0 -3374 lines
file uvm_map.c was added on branch thorpej-devvp on 2001-10-01 12:48:42 +0000

Revision 1.103: download - view: text, markup, annotated - select for diffs
Fri Sep 7 00:50:54 2001 UTC (23 years, 3 months ago) by lukem
Branches: MAIN
CVS tags: thorpej-devvp-base
Branch point for: thorpej-devvp
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +4 -2 lines
let user know current value of MAX_KMAPENT in panic

Revision 1.99.2.2: download - view: text, markup, annotated - select for diffs
Sat Aug 25 06:17:21 2001 UTC (23 years, 3 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.99.2.1: preferred, colored
Changes since revision 1.99.2.1: +8 -12 lines
Merge Aug 24 -current into the kqueue branch.

Revision 1.93.2.4: download - view: text, markup, annotated - select for diffs
Fri Aug 24 00:13:38 2001 UTC (23 years, 3 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.3: preferred, colored
Changes since revision 1.93.2.3: +10 -14 lines
Catch up with -current.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Mon Aug 20 12:20:08 2001 UTC (23 years, 3 months ago) by wiz
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +2 -2 lines
"wierd" is weird.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Aug 16 01:37:50 2001 UTC (23 years, 3 months ago) by chs
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +7 -11 lines
user maps are always pageable.

Revision 1.99.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 3 04:14:12 2001 UTC (23 years, 4 months ago) by lukem
Branches: kqueue
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -3 lines
update to -current

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sun Jul 22 13:34:12 2001 UTC (23 years, 4 months ago) by wiz
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -3 lines
seperate -> separate

Revision 1.93.2.3: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:10:33 2001 UTC (23 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.2: preferred, colored
Changes since revision 1.93.2.2: +243 -213 lines
Catch up to -current.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sat Jun 2 18:09:26 2001 UTC (23 years, 6 months ago) by chs
Branches: MAIN
Branch point for: kqueue
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +140 -115 lines
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri May 25 04:06:14 2001 UTC (23 years, 6 months ago) by chs
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +97 -97 lines
remove trailing whitespace.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Tue May 22 00:44:44 2001 UTC (23 years, 6 months ago) by ross
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +2 -3 lines
Merge the swap-backed and object-backed inactive lists.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sun Apr 29 04:23:21 2001 UTC (23 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +4 -3 lines
Implement page coloring, using a round-robin bucket selection
algorithm (Solaris calls this "Bin Hopping").

This implementation currently relies on MD code to define a
constant defining the number of buckets.  This will change
reasonably soon (MD code will be able to dynamically size
the bucket array).

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue Apr 24 04:31:18 2001 UTC (23 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej_scsipi_beforemerge
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +6 -1 lines
Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative.  It may be possible to
optimize these a little more.

Revision 1.93.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 9 01:59:16 2001 UTC (23 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93.2.1: preferred, colored
Changes since revision 1.93.2.1: +73 -91 lines
Catch up with -current.

Revision 1.69.2.6: download - view: text, markup, annotated - select for diffs
Tue Mar 27 15:32:49 2001 UTC (23 years, 8 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69.2.5: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.2.5: +73 -91 lines
Sync with HEAD.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Mar 15 06:10:57 2001 UTC (23 years, 8 months ago) by chs
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_base
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +73 -91 lines
eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>

Revision 1.93.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 5 22:50:10 2001 UTC (23 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +12 -12 lines
Initial commit of scheduler activations and lightweight process support.

Revision 1.69.2.5: download - view: text, markup, annotated - select for diffs
Sun Feb 11 19:17:49 2001 UTC (23 years, 9 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69.2.4: preferred, colored; branchpoint 1.69: preferred, colored
Changes since revision 1.69.2.4: +30 -31 lines
Sync with HEAD.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Feb 11 01:34:23 2001 UTC (23 years, 9 months ago) by eeh
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +10 -1 lines
When recycling a vm_map, resize it to the new process address space limits.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sat Feb 10 05:05:28 2001 UTC (23 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +6 -1 lines
Don't uvm_deallocate() the address space in exit1().  The address
space is already torn down in uvmspace_free() when the vmspace
refrence count reaches 0.  Move the shmexit() call into uvmspace_free().

Note that there is a beneficial side-effect of deferring the unmap
to uvmspace_free() -- on systems where TLB invalidations are
particularly expensive, the unmapping of the address space won't
have to cause TLB invalidations; uvmspace_free() is going to be
run in a context other than the exiting process's, so the "pmap is
active" test will evaluate to FALSE in the pmap module.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Tue Feb 6 17:01:51 2001 UTC (23 years, 10 months ago) by eeh
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +5 -4 lines
Specify a process' address space limits for uvmspace_exec().

Revision 1.90: download - view: text, markup, annotated - select for diffs
Mon Feb 5 11:29:54 2001 UTC (23 years, 10 months ago) by chs
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +11 -25 lines
in uvm_map_clean(), fix the case where the start offset is within the last
entry in the map.  the old code would walk around the end of the linked list,
through the header entry, and keep going from the first map entry until it
found a gap in the map, at which point it would return an error.  if the map
had no gaps then it would loop forever.  reported by k-abe@cs.utah.edu.
while I'm here, clean up this function a bit.

also, use MIN() instead of min(), since the latter takes arguments of
type "int" but we're passing it values of type "vaddr_t", which can be
a larger size.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun Jan 28 23:30:44 2001 UTC (23 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -4 lines
Page scanner improvements, behavior is actually a bit more like
Mach VM's now.  Specific changes:
- Pages now need not have all of their mappings removed before being
  put on the inactive list.  They only need to have the "referenced"
  attribute cleared.  This makes putting pages onto the inactive list
  much more efficient.  In order to eliminate redundant clearings of
  "refrenced", callers of uvm_pagedeactivate() must now do this
  themselves.
- When checking the "modified" attribute for a page (for clearing
  PG_CLEAN), make sure to only do it if PG_CLEAN is currently set on
  the page (saves a potentially expensive pmap operation).
- When scanning the inactive list, if a page is referenced, reactivate
  it (this part was actually added in uvm_pdaemon.c,v 1.27).  This
  now works properly now that pages on the inactive list are allowed to
  have mappings.
- When scanning the inactive list and considering a page for freeing,
  remove all mappings, and then check the "modified" attribute if the
  page is marked PG_CLEAN.
- When scanning the active list, if the page was referenced since its
  last sweep by the scanner, don't deactivate it.  (This part was
  actually added in uvm_pdaemon.c,v 1.28.)

These changes greatly improve interactive performance during
moderate to high memory and I/O load.

Revision 1.69.2.4: download - view: text, markup, annotated - select for diffs
Thu Jan 18 09:24:05 2001 UTC (23 years, 10 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69.2.3: preferred, colored; branchpoint 1.69: preferred, colored
Changes since revision 1.69.2.3: +2 -2 lines
Sync with head (for UBC+NFS fixes, mostly).

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sun Jan 14 02:10:01 2001 UTC (23 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +3 -3 lines
splimp() -> splvm()

Revision 1.69.2.3: download - view: text, markup, annotated - select for diffs
Wed Dec 13 15:50:43 2000 UTC (23 years, 11 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69.2.2: preferred, colored; branchpoint 1.69: preferred, colored
Changes since revision 1.69.2.2: +1 -0 lines
Sync with HEAD (for UBC fixes).

Revision 1.87: download - view: text, markup, annotated - select for diffs
Wed Dec 13 08:06:11 2000 UTC (23 years, 11 months ago) by enami
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +2 -1 lines
Use single const char array instead of over 200 string constant.

Revision 1.69.2.2: download - view: text, markup, annotated - select for diffs
Fri Dec 8 09:20:54 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69.2.1: preferred, colored; branchpoint 1.69: preferred, colored
Changes since revision 1.69.2.1: +148 -220 lines
Sync with HEAD.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Mon Nov 27 08:40:03 2000 UTC (24 years ago) by chs
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +9 -9 lines
Initial integration of the Unified Buffer Cache project.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sat Nov 25 06:27:59 2000 UTC (24 years ago) by chs
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +140 -212 lines
lots of cleanup:
use queue.h macros and KASSERT().
address amap offsets in pages instead of bytes.
make amap_ref() and amap_unref() take an amap, offset and length
  instead of a vm_map_entry_t.
improve whitespace and comments.

Revision 1.69.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 18:12:02 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +129 -72 lines
Update thorpej_scsipi to -current as of a month ago

Revision 1.84: download - view: text, markup, annotated - select for diffs
Mon Oct 16 23:17:54 2000 UTC (24 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +0 -9 lines
Back out rev. 1.83 -- it's causing problems with some pmap
implementations, so we'll have to spend a little more time
working on the problem.

Revision 1.77.2.2: download - view: text, markup, annotated - select for diffs
Mon Oct 16 22:02:17 2000 UTC (24 years, 1 month ago) by tv
Branches: netbsd-1-5
CVS tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Diff to: previous 1.77.2.1: preferred, colored; branchpoint 1.77: preferred, colored
Changes since revision 1.77.2.1: +16 -11 lines
Pullup 1.82 [thorpej]:
- Change SAVE_HINT() to take a "check" value.  This value is compared
  to the contents of the hint in the map, and the hint saved in the
  map only if the two values match.  When an unconditional save is
  required, the "check" value passed should be map->hint (and the
  compiler will optimize the test away).  When deleting a map entry,
  the new SAVE_HINT() will only change the hint if the entry being
  deleted was the hint value (thus preserving any meaningful hint
  that may have been there previously, rather than stomping on it).
- Add a missing hint update when deleting the map entry in
  uvm_map_entry_unlink().  This is the fix for kern/11125, from
  ITOH Yasufumi <itohy@netbsd.org>.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Wed Oct 11 17:27:58 2000 UTC (24 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +10 -1 lines
- uvmspace_share(): If p2 has a vmspace already, make sure to deactivate
  it and free it as appropriate.  Activate p2's new address space once
  it references p1's.
- uvm_fork(): Make sure the child's vmspace is NULL before calling
  uvmspace_share() (the child doens't have one already in this case).

These changes do not change the behavior for the current use of
uvmspace_share() (vfork(2)), but make it possible for an already
running process (such as a kernel thread) to properly attach to
another process's address space.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Wed Oct 11 17:21:11 2000 UTC (24 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +16 -11 lines
- Change SAVE_HINT() to take a "check" value.  This value is compared
  to the contents of the hint in the map, and the hint saved in the
  map only if the two values match.  When an unconditional save is
  required, the "check" value passed should be map->hint (and the
  compiler will optimize the test away).  When deleting a map entry,
  the new SAVE_HINT() will only change the hint if the entry being
  deleted was the hint value (thus preserving any meaningful hint
  that may have been there previously, rather than stomping on it).
- Add a missing hint update when deleting the map entry in
  uvm_map_entry_unlink().  This is the fix for kern/11125, from
  ITOH Yasufumi <itohy@netbsd.org>.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Wed Sep 13 15:00:25 2000 UTC (24 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +60 -22 lines
Add an align argument to uvm_map() and some callers of that
routine.  Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.

Revision 1.77.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 6 00:11:24 2000 UTC (24 years, 4 months ago) by fvdl
Branches: netbsd-1-5
CVS tags: netbsd-1-5-ALPHA2
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +7 -7 lines
Pull up version 1.80 (VM_INHERIT -> MAP_INHERIT).

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Aug 1 00:53:11 2000 UTC (24 years, 4 months ago) by wiz
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +7 -7 lines
Rename VM_INHERIT_* to MAP_INHERIT_* and move them to sys/sys/mman.h as
discussed on tech-kern.
Retire sys/uvm/uvm_inherit.h, update man page for minherit(2).

Revision 1.79: download - view: text, markup, annotated - select for diffs
Tue Jun 27 17:29:26 2000 UTC (24 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +1 -3 lines
remove include of <vm/vm.h>

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Jun 26 14:21:18 2000 UTC (24 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +1 -3 lines
remove/move more mach vm header files:

	<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.

Revision 1.74.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:10:44 2000 UTC (24 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.74: preferred, colored; next MAIN 1.75: preferred, colored
Changes since revision 1.74: +4 -3 lines
Sync w/ netbsd-1-5-base.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Tue Jun 13 04:10:47 2000 UTC (24 years, 5 months ago) by chs
Branches: MAIN
CVS tags: netbsd-1-5-base
Branch point for: netbsd-1-5
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +2 -1 lines
initialize aref.ar_pageoff even if there's no amap.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon Jun 5 07:28:56 2000 UTC (24 years, 6 months ago) by pk
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -2 lines
Change previous to use `vm_map_min(dstmap)' instead of hard-coding
VM_MIN_KERNEL_ADDRESS.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Fri Jun 2 12:02:43 2000 UTC (24 years, 6 months ago) by pk
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +3 -3 lines
Let uvm_map_extract() set the lower bound on the kernel address range
itself, in stead of having its callers do that.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Fri May 19 17:43:55 2000 UTC (24 years, 6 months ago) by thorpej
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +8 -6 lines
Clean up some indentation lossage in uvm_map_extract().

Revision 1.36.2.4: download - view: text, markup, annotated - select for diffs
Sun Apr 30 12:40:26 2000 UTC (24 years, 7 months ago) by he
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH003
Diff to: previous 1.36.2.3: preferred, colored; branchpoint 1.36: preferred, colored
Changes since revision 1.36.2.3: +1 -7 lines
Pull up revision 1.72 (requested by chs):
  Undo revision 1.13: don't block interrupts while deactivating
  one pmap and activating another, since these only affect user-
  level mappings which cannot be accessed from interrupt context.
  This fixes Sparc zstty overflows reported in PR#8322, since pmap
  operations are slow on old sun4c sparcs.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Apr 24 17:12:00 2000 UTC (24 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +6 -3 lines
Changes necessary to implement pre-zero'ing of pages in the idle loop:
- Make page free lists have two actual queues: known-zero pages and
  pages with unknown contents.
- Implement uvm_pageidlezero().  This function attempts to zero up to
  the target number of pages until the target has been reached (currently
  target is `all free pages') or until whichqs becomes non-zero (indicating
  that a process is ready to run).
- Define a new hook for the pmap module for pre-zero'ing pages.  This is
  used to zero the pages using uncached access.  This allows us to zero
  as many pages as we want without polluting the cache.

In order to use this feature, each platform must add the appropropriate
glue in their idle loop.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sun Apr 16 20:52:29 2000 UTC (24 years, 7 months ago) by chs
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +1 -7 lines
undo rev 1.13, which is to say, don't block interrupts while deactivating
one pmap and activating another.  this isn't actually necessary (since
pmap_activate() and pmap_deactivate() affect only user-level mappings,
which cannot be accessed from interrupts anyway), and pmap_activate()
is very slow on old sun4c sparcs so we can't block interrupts for this long.
this fixes PR 8322.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Apr 10 02:21:26 2000 UTC (24 years, 8 months ago) by chs
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +29 -11 lines
sparc -> __sparc__
print lock status in uvm_object_printit().

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sun Mar 26 20:54:47 2000 UTC (24 years, 8 months ago) by kleink
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +5 -5 lines
Merge parts of chs-ubc2 into the trunk:
Add a new type voff_t (defined as a synonym for off_t) to describe offsets
into uvm objects, and update the appropriate interfaces to use it, the
most visible effect being the ability to mmap() file offsets beyond
the range of a vaddr_t.

Originally by Chuck Silvers; blame me for problems caused by merging this
into non-UBC.

Revision 1.36.2.1.4.1: download - view: text, markup, annotated - select for diffs
Tue Nov 30 13:36:25 1999 UTC (25 years ago) by itojun
Branches: kame
CVS tags: kame_141_19991130
Diff to: previous 1.36.2.1: preferred, colored; next MAIN 1.36.2.2: preferred, colored
Changes since revision 1.36.2.1: +20 -18 lines
bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sun Sep 12 01:17:37 1999 UTC (25 years, 2 months ago) by chs
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-newbase
Branch point for: thorpej_scsipi
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +2 -13 lines
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sat Aug 21 02:19:05 1999 UTC (25 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +9 -1 lines
When handling the MADV_FREE case, if the amap or aobj has more than
one reference, go through the deactivate path; the page may actually
be in use by another process.

Fixes kern/8239.

Revision 1.36.2.1.2.5: download - view: text, markup, annotated - select for diffs
Mon Aug 9 00:05:55 1999 UTC (25 years, 4 months ago) by chs
Branches: chs-ubc2
Diff to: previous 1.36.2.1.2.4: preferred, colored; branchpoint 1.36.2.1: preferred, colored; next MAIN 1.36.2.2: preferred, colored
Changes since revision 1.36.2.1.2.4: +3 -3 lines
create a new type "voff_t" for uvm_object offsets
and define it to be "off_t".  also, remove pgo_asyncget().

Revision 1.67: download - view: text, markup, annotated - select for diffs
Tue Aug 3 00:38:33 1999 UTC (25 years, 4 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +12 -3 lines
Fix the error recovery in uvm_map_pageable_all().

Revision 1.36.2.1.2.4: download - view: text, markup, annotated - select for diffs
Mon Aug 2 23:16:15 1999 UTC (25 years, 4 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.36.2.1.2.3: preferred, colored; branchpoint 1.36.2.1: preferred, colored
Changes since revision 1.36.2.1.2.3: +226 -113 lines
Update from trunk.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Jul 19 17:45:23 1999 UTC (25 years, 4 months ago) by thorpej
Branches: MAIN
CVS tags: chs-ubc2-base
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +2 -2 lines
Fix PR #8023 from Bernd Ernesti: when MADV_FREE'ing a region which spanned
more than one VM map entry, a typo caused amap_unadd() to attempt to
remove anons from the wrong amap.  Fix that typo.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sun Jul 18 00:41:56 1999 UTC (25 years, 4 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +42 -9 lines
Rework uvm_map_protect():
- Fix some locking bugs; a couple of places would return an error condition
  without unlocking the map.
- Deal with maps marked WIREFUTURE; if making an entry VM_PROT_NONE ->
  anything else, and it is not already marked as wired, wire it.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sat Jul 17 21:35:49 1999 UTC (25 years, 4 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +27 -12 lines
Add a set of "lockflags", which can control the locking behavior
of some functions.  Use these flags in uvm_map_pageable() to determine
if the map is locked on entry (replaces an already present boolean_t
argument `islocked'), and if the function should return with the map
still locked.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed Jul 7 21:51:35 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +7 -7 lines
Fix a thinko which could cause a NULL pointer deref, in the PGO_FREE
case.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Wed Jul 7 21:04:22 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +6 -1 lines
In the PGO_FREE case of uvm_map_clean()'s amap cleaning, skip wired
pages.

XXX This should be handled better in the future, probably by marking the
XXX page as released, and making uvm_pageunwire() free the page when
XXX the wire count on a released page reaches zero.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Wed Jul 7 06:02:22 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +154 -94 lines
Add some more meat to madvise(2):
* Implement MADV_DONTNEED: deactivate pages in the specified range,
  semantics similar to Solaris's MADV_DONTNEED.
* Add MADV_FREE: free pages and swap resources associated with the
  specified range, causing the range to be reloaded from backing
  store (vnodes) or zero-fill (anonymous), semantics like FreeBSD's
  MADV_FREE and like Digital UNIX's MADV_DONTNEED (isn't it SO GREAT
  that madvise(2) isn't standardized!?)

As part of this, move the non-map-modifying advice handling out of
uvm_map_advise(), and into sys_madvise().

As another part, implement general amap cleaning in uvm_map_clean(), and
change uvm_map_clean() to only push dirty pages to disk if PGO_CLEANIT
is set in its flags (and update sys___msync13() accordingly).  XXX Add
a patchable global "amap_clean_works", defaulting to 1, which can disable
the amap cleaning code, just in case problems are unearthed; this gives
a developer/user a quick way to recover and send a bug report (e.g. boot
into DDB and change the value).

XXX Still need to implement a real uao_flush().

XXX Need to update the manual page.

With these changes, rebuilding libc will automatically cause the new
malloc(3) to use MADV_FREE to actually release pages and swap resources
when it decides that can be done.

Revision 1.36.2.1.2.3: download - view: text, markup, annotated - select for diffs
Thu Jul 1 23:55:16 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.36.2.1.2.2: preferred, colored; branchpoint 1.36.2.1: preferred, colored
Changes since revision 1.36.2.1.2.2: +29 -18 lines
Sync w/ -current.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Jul 1 20:07:05 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +29 -18 lines
Fix a corner case locking error, which could lead to map corruption in
SMP environments.  See comments in <vm/vm_map.h> for details.

Revision 1.36.2.1.2.2: download - view: text, markup, annotated - select for diffs
Mon Jun 21 01:47:20 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.36.2.1.2.1: preferred, colored; branchpoint 1.36.2.1: preferred, colored
Changes since revision 1.36.2.1.2.1: +489 -189 lines
Sync w/ -current.

Revision 1.36.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 18 17:17:04 1999 UTC (25 years, 5 months ago) by perry
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Diff to: previous 1.36.2.2: preferred, colored; branchpoint 1.36: preferred, colored
Changes since revision 1.36.2.2: +4 -9 lines
patch from thorpej: fixes bug in mlock() of anonymous memory

Revision 1.36.2.2: download - view: text, markup, annotated - select for diffs
Fri Jun 18 17:01:53 1999 UTC (25 years, 5 months ago) by perry
Branches: netbsd-1-4
Diff to: previous 1.36.2.1: preferred, colored; branchpoint 1.36: preferred, colored
Changes since revision 1.36.2.1: +17 -10 lines
pullup 1.39->1.40 (thorpej): fix the 1G RAM bug

Revision 1.59: download - view: text, markup, annotated - select for diffs
Fri Jun 18 05:13:46 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +9 -5 lines
Add the guts of mlockall(MCL_FUTURE).  This requires that a process's
"memlock" resource limit to uvm_mmap().  Update all calls accordingly.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Thu Jun 17 00:24:10 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +1 -49 lines
The i386 and pc532 pmaps are officially fixed.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed Jun 16 22:11:23 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +2 -10 lines
* Rename uvm_fault_unwire() to uvm_fault_unwire_locked(), and require that
  the map be at least read-locked to call this function.  This requirement
  will be taken advantage of in a future commit.
* Write a uvm_fault_unwire() wrapper which read-locks the map and calls
  uvm_fault_unwire_locked().
* Update the comments describing the locking contraints of uvm_fault_wire()
  and uvm_fault_unwire().

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Jun 16 19:34:24 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +15 -20 lines
Modify uvm_map_pageable() and uvm_map_pageable_all() to follow POSIX 1003.1b
semantics.  That is, regardless of the number of mlock/mlockall calls,
an munlock/munlockall actually unlocks the region (i.e. sets wiring count
to 0).

Add a comment describing why uvm_map_pageable() should not be used for
transient page wirings (e.g. for physio) -- note, it's currently only
(ab)used in this way by a few pieces of code which are known to be
broken, i.e. the Amiga and Atari pmaps, and i386 and pc532 if PMAP_NEW is
not used.  The i386 GDT code uses uvm_map_pageable(), but in a safe
way, and could be trivially converted to use uvm_fault_wire() instead.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Jun 16 00:29:04 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +19 -22 lines
Add a macro to test if a map entry is wired.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Tue Jun 15 23:27:47 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +242 -24 lines
Several changes, developed and tested concurrently:
* Provide POSIX 1003.1b mlockall(2) and munlockall(2) system calls.
  MCL_CURRENT is presently implemented.  MCL_FUTURE is not fully
  implemented.  Also, the same one-unlock-for-every-lock caveat
  currently applies here as it does to mlock(2).  This will be
  addressed in a future commit.
* Provide the mincore(2) system call, with the same semantics as
  Solaris.
* Clean up the error recovery in uvm_map_pageable().
* Fix a bug where a process would hang if attempting to mlock a
  zero-fill region where none of the pages in that region are resident.
  [ This fix has been submitted for inclusion in 1.4.1 ]

Revision 1.53: download - view: text, markup, annotated - select for diffs
Mon Jun 7 16:31:42 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +4 -3 lines
Print the maps flags in "show map" from DDB.

Revision 1.36.2.1.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 7 04:25:36 1999 UTC (25 years, 6 months ago) by chs
Branches: chs-ubc2
Diff to: previous 1.36.2.1: preferred, colored
Changes since revision 1.36.2.1: +53 -12 lines
merge everything from chs-ubc branch.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Wed Jun 2 22:40:51 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +8 -53 lines
Simplify the last even more; We downgraded to a shared (read) lock, so
setting recursive has no effect!  The kernel lock manager doesn't allow
an exclusive recursion into a shared lock.  This situation must simply
be avoided.  The only place where this might be a problem is the (ab)use
of uvm_map_pageable() in the Utah-derived pmaps for m68k (they should
either toss the iffy scheme they use completely, or use something like
uvm_fault_wire()).

In addition, once we have looped over uvm_fault_wire(), only upgrade to
an exclusive (write) lock if we need to modify the map again (i.e.
wiring a page failed).

Revision 1.51: download - view: text, markup, annotated - select for diffs
Wed Jun 2 21:23:08 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +54 -35 lines
Clean up the locking mess in uvm_map_pageable() a little... Most importantly,
don't unlock a kernel map (!!!) and then relock it later; a recursive lock,
as it used in the user map case, is fine.  Also, don't change map entries
while only holding a read lock on the map.  Instead, if we fail to wire
a page, clear recursive locking, and upgrade back to a write lock before
dropping the wiring count on the remaining map entries.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon May 31 23:36:23 1999 UTC (25 years, 6 months ago) by mrg
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -1 lines
unlock the map for unknown arguments to uvm_map_advise. from Soren S. Jorvang in PR kern/7681

Revision 1.32.2.3: download - view: text, markup, annotated - select for diffs
Sun May 30 15:18:18 1999 UTC (25 years, 6 months ago) by chs
Branches: chs-ubc
Diff to: previous 1.32.2.2: preferred, colored; branchpoint 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.2.2: +1 -2 lines
vm_page's blkno field is gone.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri May 28 22:54:12 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +5 -7 lines
A little spring cleaning in the unwire case of uvm_map_pageable().

Revision 1.48: download - view: text, markup, annotated - select for diffs
Fri May 28 20:49:51 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +2 -2 lines
Make uvm_fault_unwire() take a vm_map_t, rather than a pmap_t, for
consistency.  Use this opportunity for checking for intrsafe map use
in this routine (which is illegal).

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri May 28 20:31:43 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +36 -3 lines
Make "intrsafe" maps locked only by exclusive spin locks, never sleep
locks (and thus, never shared locks).  Move the "set/clear recursive"
functions to uvm_map.c, which is the only placed they're used (and
they should go away anyhow).  Delete some unused cruft.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed May 26 23:53:48 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -8 lines
Upon further investigation, in uvm_map_pageable(), entry->protection is the
right access_type to pass to uvm_fault_wire().  This way, if the entry has
VM_PROT_WRITE, and the entry is marked COW, the copy will happen immediately
in uvm_fault(), as if the access were performed.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed May 26 19:16:36 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +15 -10 lines
Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags.  PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that.  INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now).  This will eventually
change now these maps are locked, as well.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed May 26 00:36:53 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +9 -2 lines
In uvm_map_pageable(), pass VM_PROT_NONE as access type to uvm_fault_wire()
for now.  XXX This needs to be reexamined.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue May 25 20:30:09 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +21 -26 lines
Define a new kernel object type, "intrsafe", which are used for objects
which can be used in an interrupt context.  Use pmap_kenter*() and
pmap_kremove() only for mappings owned by these objects.

Fixes some locking protocol issues related to MP support, and eliminates
all of the pmap_enter vs. pmap_kremove inconsistencies.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue May 25 00:09:00 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +8 -7 lines
Macro'ize the test for "object is a kernel object".

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun May 23 06:27:13 1999 UTC (25 years, 6 months ago) by mrg
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +115 -1 lines
implement madvice() for MADV_{NORMAL,RANDOM,SEQUENTIAL}, others are not yet done.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu May 20 23:03:23 1999 UTC (25 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +17 -10 lines
Make a slight modification of pmap_growkernel() -- it now returns the
end of the mappable kernel virtual address space.  Previously, it would
get called more often than necessary, because the caller only new what
was requested.

Also, export uvm_maxkaddr so that uvm_pageboot_alloc() can grow the
kernel pmap if necessary, as well.  Note that pmap_growkernel() must
now be able to handle being called before pmap_init().

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed May 12 19:11:23 1999 UTC (25 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -1 lines
Add an optional pmap hook, pmap_fork(), to be called at the end of
uvmspace_fork().

pmap_fork() is used to "fork a pmap", that is copy data from one pmap
to the other that is NOT related to actual mappings in the pmap, but is
otherwise logically coupled to the address space.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon May 3 08:57:42 1999 UTC (25 years, 7 months ago) by mrg
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -10 lines
remove now-wrong comments.  formatting nits.

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 19 16:02:52 1999 UTC (25 years, 7 months ago) by perry
Branches: netbsd-1-4
CVS tags: netbsd-1-4-RELEASE, kame_14_19990705, kame_14_19990628
Branch point for: kame, chs-ubc2
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -2 lines
pullup 1.36->1.37 as requested by chuq -- fixes botch mmapping large regions.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Mon Apr 19 14:43:46 1999 UTC (25 years, 7 months ago) by chs
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -2 lines
in uvm_map_extract(), handle the case where the map entry being extracted
is large enough to cause the end address of the new entry to overflow.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Mar 28 19:53:50 1999 UTC (25 years, 8 months ago) by mycroft
Branches: MAIN
CVS tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -3 lines
Only turn off VM_PROT_WRITE for COW pages; not VM_PROT_EXECUTE.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Mar 25 18:48:52 1999 UTC (25 years, 8 months ago) by mrg
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -5 lines
remove now >1 year old pre-release message.

Revision 1.32.2.2: download - view: text, markup, annotated - select for diffs
Thu Feb 25 04:15:05 1999 UTC (25 years, 9 months ago) by chs
Branches: chs-ubc
Diff to: previous 1.32.2.1: preferred, colored; branchpoint 1.32: preferred, colored
Changes since revision 1.32.2.1: +15 -4 lines
in uvm_page_printit(), print page flags symbolicly too.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Jan 24 23:53:15 1999 UTC (25 years, 10 months ago) by chuck
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +9 -9 lines
cleanup/reorg:
- break anon related functions out of uvm_amap.c and put them in their own
  file (uvm_anon.c).  includes break up uvm_anon_init into an amap and an
  an anon init function
- ensure that only functions within the amap module access amap structure
  fields (add macros to amap api as needed)

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Nov 15 04:38:19 1998 UTC (26 years ago) by chuck
Branches: MAIN
CVS tags: kenh-if-detach-base, kenh-if-detach
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +4 -5 lines
remove bogus permission check in uvm_map_clean().   fixes mmap/msync
problem discussed/reported by jonathan and Andreas Wrede <andreas@planix.com>.

Revision 1.32.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 9 06:06:38 1998 UTC (26 years, 1 month ago) by chs
Branches: chs-ubc
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +40 -9 lines
initial snapshot.  lots left to do.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat Oct 24 13:32:34 1998 UTC (26 years, 1 month ago) by mrg
Branches: MAIN
CVS tags: chs-ubc-base
Branch point for: chs-ubc
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +9 -11 lines
KNF a missing bit. remove register.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Mon Oct 19 22:21:19 1998 UTC (26 years, 1 month ago) by tron
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -1 lines
Defopt SYSVMSG, SYSVSEM and SYSVSHM.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Oct 18 23:50:00 1998 UTC (26 years, 1 month ago) by chs
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
shift by PAGE_SHIFT instead of multiplying or dividing by PAGE_SIZE.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun Oct 11 23:14:47 1998 UTC (26 years, 2 months ago) by chuck
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +47 -382 lines
remove unused share map code from UVM:
 - replace map checks with submap checks
 - get rid of unused 'mainonly' arg in uvm_unmap/uvm_unmap_remove, simplify
	code.   update all calls to reflect this.
 - don't worry about unmapping or changing the protection of shared share
	map mappings (is_main_map no longer used).
 - remove unused uvm_map_sharemapcopy() function from fork code.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Aug 31 01:54:14 1998 UTC (26 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +0 -9 lines
Back out previous; I should have instrumented the benefit of this one
first.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Aug 31 01:50:08 1998 UTC (26 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +10 -1 lines
Use the pool allocator and the "nointr" pool page allocator for vm_map's.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Aug 31 01:10:15 1998 UTC (26 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +11 -4 lines
Use the pool allocator and the "nointr" pool page allocator for dynamically
allocated vm_map_entry's.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Mon Aug 31 00:20:26 1998 UTC (26 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +17 -3 lines
Use the pool allocator and the "nointr" pool page allocator for vmspace
structures.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Aug 13 02:11:01 1998 UTC (26 years, 3 months ago) by eeh
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +45 -45 lines
Merge paddr_t changes into the main branch.

Revision 1.22.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 12 03:01:28 1998 UTC (26 years, 4 months ago) by eeh
Branches: eeh-paddr_t
Diff to: previous 1.22.2.1: preferred, colored; branchpoint 1.22: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22.2.1: +2 -2 lines
Fix a debug printf if paddr_t == long long.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Aug 9 22:36:38 1998 UTC (26 years, 4 months ago) by perry
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +4 -4 lines
bzero->memset, bcopy->memcpy, bcmp->memcmp

Revision 1.22.2.1: download - view: text, markup, annotated - select for diffs
Thu Jul 30 14:04:12 1998 UTC (26 years, 4 months ago) by eeh
Branches: eeh-paddr_t
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +44 -44 lines
Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Jul 8 04:28:28 1998 UTC (26 years, 5 months ago) by thorpej
Branches: MAIN
CVS tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -2 lines
Add support for multiple memory free lists.  There is at least one
default free list, and 0 - N additional free list, in order of descending
priority.

A new page allocation function, uvm_pagealloc_strat(), has been added,
providing three page allocation strategies:

	- normal: high -> low priority free list walk, taking the
	  page off the first free list that has one.

	- only: attempt to allocate a page only from the specified free
	  list, failing if that free list has none available.

	- fallback: if `only' fails, fall back on `normal'.

uvm_pagealloc(...) is provided for normal use (and is a synonym for
uvm_pagealloc_strat(..., UVM_PGA_STRAT_NORMAL, 0); the free list argument
is ignored for the `normal' case).

uvm_page_physload() now specified which free list the pages will be
loaded onto.  This means that some platforms which have multiple physical
memory segments may define additional vm_physsegs if they wish to break
individual physical segments into differing priorities.

Machine-dependent code must define _at least_ the following constants
in <machine/vmparam.h>:

	VM_NFREELIST: the number of free lists the system will have

	VM_FREELIST_DEFAULT: the default freelist (should always be 0,
	but is defined in machdep code so that it's with all of the
	other free list-related constants).

Additional free list names may be defined by machine-dependent code, but
they will only be used by machine-dependent code (e.g. for loading the
vm_physsegs).

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sat Jul 4 22:18:53 1998 UTC (26 years, 5 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +7 -1 lines
defopt DDB.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri May 22 02:01:54 1998 UTC (26 years, 6 months ago) by chuck
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +13 -6 lines
fix bug in uvm_map_extract, remove case.  make sure we update the loop
variable before removing the entry from the map.
[bug was not causing problems because the remove case isn't currently
 being used ...]

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat May 9 15:05:50 1998 UTC (26 years, 7 months ago) by kleink
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -2 lines
Minor KNF.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue May 5 20:51:06 1998 UTC (26 years, 7 months ago) by kleink
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -4 lines
Remove inclusions of syscall (and syscall argument) related header files;
we don't need them here.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Apr 25 19:58:58 1998 UTC (26 years, 7 months ago) by matthias
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -4 lines
port-pc532 now has pmap_new just like port-i386.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Mar 30 17:34:58 1998 UTC (26 years, 8 months ago) by chuck
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +10 -3 lines
have ddb show map print resident page count

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Mar 27 01:47:06 1998 UTC (26 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +31 -5 lines
Split uvmspace_alloc() into uvmspace_alloc() and uvmspace_init().  The latter
can be used for initializing a pre-allocated vmspace.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Mar 19 19:26:50 1998 UTC (26 years, 8 months ago) by chuck
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +122 -112 lines
rework the copy inheritance case of fork.  the old way did not handle
the very rare case of shared mappings that have amap's attached in a
reasonable way -- this is not currently causing any problems, but i
fixed it anyway.  update the comment in this section of code and also
be smarter about avoiding needless calls to pmap_protect().

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Mar 19 06:37:26 1998 UTC (26 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +9 -1 lines
Make the previous change `atomic'.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Mar 19 04:19:21 1998 UTC (26 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -1 lines
When unsharing or execing, deactivate the old vmspace before reassigning
and activating the new one.  Pointed out by Chris Demetriou.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Mar 17 07:50:08 1998 UTC (26 years, 8 months ago) by mrg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -6 lines
oops, missed a bit of KNF here.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Mar 9 00:58:57 1998 UTC (26 years, 9 months ago) by mrg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2319 -2206 lines
KNF.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Mar 1 02:25:28 1998 UTC (26 years, 9 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
Merge with Lite2 + local changes

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Feb 24 15:58:09 1998 UTC (26 years, 9 months ago) by chuck
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +15 -7 lines
be consistent about offsets in kernel objects.  vm_map_min(kernel_map)
should always be the base [fixes problem on m68k detected by jason thorpe]

add comments to uvm_km.c explaining kernel memory management in more detail

Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Feb 18 14:50:32 1998 UTC (26 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -3 lines
fix map range boundary check

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Feb 10 14:12:18 1998 UTC (26 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -3 lines
- add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sun Feb 8 07:52:28 1998 UTC (26 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +5 -3 lines
move pdhist initialisation to the same place as maphist.  also, declare
the history buffers are "struct uvm_history_ent" to ensure proper
alignment (eg, alpha).  this fixes a boottime panic when the pdhist was
used before it had been initialised.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Feb 7 12:31:32 1998 UTC (26 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -2 lines
bzero the entire vmspace, like the old vm does.  makes ps report sane values of VSZ for swapper/pagedaemon

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Feb 7 11:08:57 1998 UTC (26 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
restore rcsids

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Feb 6 22:32:01 1998 UTC (26 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +1 -1 lines
RCS ID police.

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Thu Feb 5 06:25:09 1998 UTC (26 years, 10 months ago) by mrg
Branches: CDC
CVS tags: uvm980205
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the UVM kernel code portion.


this will be KNF'd shortly.  :-)

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu Feb 5 06:25:09 1998 UTC (26 years, 10 months ago) by mrg
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

CVSweb <webmaster@jp.NetBSD.org>