History log of /openbsd-current/sys/uvm/uvm_aobj.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.20 13-May-2023 mpi

Put back in the simplification of the aiodone daemon.

Previous "breakage" of the swap on arm64 has been found to be an issue
on one machine the rockpro/arm64 related to a deadlock built into the
sdmmc(4) stack interacting with swapping code both running under
KERNEL_LOCK().

This issue is easily reproducible on -current and entering swap when
building LLVM on a rockpro crashes the machine by memory corruption.

Tested by mlarkin@ on octeon & i386, by myself on amd64 & arm64 and by
sthen@ on i386 port bulk.

ok beck@ some time ago.

Previous commit message:

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap. This
allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
assert for the different anon cases.

ok beck@, kettenis@


Revision tags: OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.19 24-Jul-2022 mpi

Revert simplification of the aiodone daemon it breaks swap on arm64.

Found the hard way by mlarkin@ and deraadt@.


# 1.18 11-Jul-2022 mpi

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap. This
allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
assert for the different anon cases.

ok beck@, kettenis@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.17 21-Oct-2020 mpi

Constify and use C99 initializer for "struct uvm_pagerops".

While here put some KERNEL_ASSERT_LOCKED() in the functions called from
the page fault handler. The removal of locking of `uobj' will need to be
revisited and these are good indicator that something is missing and that
many comments are lying.

ok kettenis


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.16 11-Jul-2014 jsg

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2


Revision tags: OPENBSD_5_5_BASE
# 1.15 09-Dec-2013 espie

forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,
like the rest of tmpfs


# 1.14 08-Dec-2013 espie

allow aobj to shrink grow, for tmpfs support
A few tweaks asked by kettenis@
(code doesn't affect systems without mounted tmpfs at all)

okay beck@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 10-May-2011 oga

Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.

Before we were only calling uao_dropswap() if there was a page, maning
that if the buffer was swapped out then we would leak the slot.

Quite rare because only pipebuffers should swap from the kernel object,
but i've seen panics that implied this had happened (alpha.p for example).

ok thib@ after a lot of discussion and checking the semantics.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 22-Jul-2009 oga

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@


Revision tags: OPENBSD_4_6_BASE
# 1.11 16-Jun-2009 oga

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@


# 1.10 16-Jun-2009 oga

Backout all the PG_RELEASED changes.

This is for the same reason as the earlier backouts, to avoid the bug
either added or exposed sometime around c2k9. This *should* be the last
one.

prompted by deraadt@

ok ariane@


# 1.9 05-May-2009 oga

The first step in cleaning up the use of PG_RELEASED for uvm objects.

Now, the PG_ RELEASED flag currently has two (maybe three) uses. The
valid one is for use with async io where we want to free the page after
we've paged it out. The other ones are "oh i'd like to free this, but
someone else is playing with it". It's simpler to just sleep on the
damned page instead and stop the fiddling.

First step does uao's: in uao_detach, sleep on the object and free it
when we're clean, instead of setting a flag so it's freed after. In
uao_flush, do the same. Change the interation over the object in flush
so that we don't have to add marker pages or other such voodoo to the
list when we sleep (netbsd did that when they had a similar diff), just
use the hash always. We can now change uao_releasepg() to just free the
page, and not bother with the KILLME stuff. When the other objects are
fixed this hook will vanish.

Much discussion with art@ over the idea, and ariane@ over this specific
diff. As mentioned, this one is based loosely on a similar idea in
netbsd.

Been in my tree for a while, survived many make builds, etc, and forcing
paging using ariane's evil program.

ok ariane@, beck@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 26-Jul-2001 art

branches: 1.7.4;
Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD


Revision tags: OPENBSD_2_9_BASE
# 1.6 09-Mar-2001 smart

Protect protypes, certain macros, and inlines from userland. Checked userland
with a 'make build'. From NetBSD. art@ ok


# 1.5 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.4 15-Mar-2000 art

Fix the NetBSD id strings.


Revision tags: OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.3 23-Aug-1999 art

branches: 1.3.4;
sync with NetBSD from 1999.05.24 (there is a reason for this date)
Mostly cleanups, but also a few improvements to pagedaemon for better
handling of low memory and/or low swap conditions.


Revision tags: OPENBSD_2_5_BASE
# 1.2 26-Feb-1999 art

add OpenBSD tags


# 1.1 26-Feb-1999 art

Import of uvm from NetBSD. Some local changes, some code disabled


# 1.19 24-Jul-2022 mpi

Revert simplification of the aiodone daemon it breaks swap on arm64.

Found the hard way by mlarkin@ and deraadt@.


# 1.18 11-Jul-2022 mpi

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap. This
allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
assert for the different anon cases.

ok beck@, kettenis@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.17 21-Oct-2020 mpi

Constify and use C99 initializer for "struct uvm_pagerops".

While here put some KERNEL_ASSERT_LOCKED() in the functions called from
the page fault handler. The removal of locking of `uobj' will need to be
revisited and these are good indicator that something is missing and that
many comments are lying.

ok kettenis


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.16 11-Jul-2014 jsg

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2


Revision tags: OPENBSD_5_5_BASE
# 1.15 09-Dec-2013 espie

forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,
like the rest of tmpfs


# 1.14 08-Dec-2013 espie

allow aobj to shrink grow, for tmpfs support
A few tweaks asked by kettenis@
(code doesn't affect systems without mounted tmpfs at all)

okay beck@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 10-May-2011 oga

Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.

Before we were only calling uao_dropswap() if there was a page, maning
that if the buffer was swapped out then we would leak the slot.

Quite rare because only pipebuffers should swap from the kernel object,
but i've seen panics that implied this had happened (alpha.p for example).

ok thib@ after a lot of discussion and checking the semantics.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 22-Jul-2009 oga

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@


Revision tags: OPENBSD_4_6_BASE
# 1.11 16-Jun-2009 oga

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@


# 1.10 16-Jun-2009 oga

Backout all the PG_RELEASED changes.

This is for the same reason as the earlier backouts, to avoid the bug
either added or exposed sometime around c2k9. This *should* be the last
one.

prompted by deraadt@

ok ariane@


# 1.9 05-May-2009 oga

The first step in cleaning up the use of PG_RELEASED for uvm objects.

Now, the PG_ RELEASED flag currently has two (maybe three) uses. The
valid one is for use with async io where we want to free the page after
we've paged it out. The other ones are "oh i'd like to free this, but
someone else is playing with it". It's simpler to just sleep on the
damned page instead and stop the fiddling.

First step does uao's: in uao_detach, sleep on the object and free it
when we're clean, instead of setting a flag so it's freed after. In
uao_flush, do the same. Change the interation over the object in flush
so that we don't have to add marker pages or other such voodoo to the
list when we sleep (netbsd did that when they had a similar diff), just
use the hash always. We can now change uao_releasepg() to just free the
page, and not bother with the KILLME stuff. When the other objects are
fixed this hook will vanish.

Much discussion with art@ over the idea, and ariane@ over this specific
diff. As mentioned, this one is based loosely on a similar idea in
netbsd.

Been in my tree for a while, survived many make builds, etc, and forcing
paging using ariane's evil program.

ok ariane@, beck@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 26-Jul-2001 art

branches: 1.7.4;
Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD


Revision tags: OPENBSD_2_9_BASE
# 1.6 09-Mar-2001 smart

Protect protypes, certain macros, and inlines from userland. Checked userland
with a 'make build'. From NetBSD. art@ ok


# 1.5 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.4 15-Mar-2000 art

Fix the NetBSD id strings.


Revision tags: OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.3 23-Aug-1999 art

branches: 1.3.4;
sync with NetBSD from 1999.05.24 (there is a reason for this date)
Mostly cleanups, but also a few improvements to pagedaemon for better
handling of low memory and/or low swap conditions.


Revision tags: OPENBSD_2_5_BASE
# 1.2 26-Feb-1999 art

add OpenBSD tags


# 1.1 26-Feb-1999 art

Import of uvm from NetBSD. Some local changes, some code disabled


# 1.18 11-Jul-2022 mpi

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap. This
allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
assert for the different anon cases.

ok beck@, kettenis@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.17 21-Oct-2020 mpi

Constify and use C99 initializer for "struct uvm_pagerops".

While here put some KERNEL_ASSERT_LOCKED() in the functions called from
the page fault handler. The removal of locking of `uobj' will need to be
revisited and these are good indicator that something is missing and that
many comments are lying.

ok kettenis


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.16 11-Jul-2014 jsg

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2


Revision tags: OPENBSD_5_5_BASE
# 1.15 09-Dec-2013 espie

forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,
like the rest of tmpfs


# 1.14 08-Dec-2013 espie

allow aobj to shrink grow, for tmpfs support
A few tweaks asked by kettenis@
(code doesn't affect systems without mounted tmpfs at all)

okay beck@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 10-May-2011 oga

Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.

Before we were only calling uao_dropswap() if there was a page, maning
that if the buffer was swapped out then we would leak the slot.

Quite rare because only pipebuffers should swap from the kernel object,
but i've seen panics that implied this had happened (alpha.p for example).

ok thib@ after a lot of discussion and checking the semantics.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 22-Jul-2009 oga

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@


Revision tags: OPENBSD_4_6_BASE
# 1.11 16-Jun-2009 oga

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@


# 1.10 16-Jun-2009 oga

Backout all the PG_RELEASED changes.

This is for the same reason as the earlier backouts, to avoid the bug
either added or exposed sometime around c2k9. This *should* be the last
one.

prompted by deraadt@

ok ariane@


# 1.9 05-May-2009 oga

The first step in cleaning up the use of PG_RELEASED for uvm objects.

Now, the PG_ RELEASED flag currently has two (maybe three) uses. The
valid one is for use with async io where we want to free the page after
we've paged it out. The other ones are "oh i'd like to free this, but
someone else is playing with it". It's simpler to just sleep on the
damned page instead and stop the fiddling.

First step does uao's: in uao_detach, sleep on the object and free it
when we're clean, instead of setting a flag so it's freed after. In
uao_flush, do the same. Change the interation over the object in flush
so that we don't have to add marker pages or other such voodoo to the
list when we sleep (netbsd did that when they had a similar diff), just
use the hash always. We can now change uao_releasepg() to just free the
page, and not bother with the KILLME stuff. When the other objects are
fixed this hook will vanish.

Much discussion with art@ over the idea, and ariane@ over this specific
diff. As mentioned, this one is based loosely on a similar idea in
netbsd.

Been in my tree for a while, survived many make builds, etc, and forcing
paging using ariane's evil program.

ok ariane@, beck@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 26-Jul-2001 art

branches: 1.7.4;
Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD


Revision tags: OPENBSD_2_9_BASE
# 1.6 09-Mar-2001 smart

Protect protypes, certain macros, and inlines from userland. Checked userland
with a 'make build'. From NetBSD. art@ ok


# 1.5 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.4 15-Mar-2000 art

Fix the NetBSD id strings.


Revision tags: OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.3 23-Aug-1999 art

branches: 1.3.4;
sync with NetBSD from 1999.05.24 (there is a reason for this date)
Mostly cleanups, but also a few improvements to pagedaemon for better
handling of low memory and/or low swap conditions.


Revision tags: OPENBSD_2_5_BASE
# 1.2 26-Feb-1999 art

add OpenBSD tags


# 1.1 26-Feb-1999 art

Import of uvm from NetBSD. Some local changes, some code disabled


# 1.17 21-Oct-2020 mpi

Constify and use C99 initializer for "struct uvm_pagerops".

While here put some KERNEL_ASSERT_LOCKED() in the functions called from
the page fault handler. The removal of locking of `uobj' will need to be
revisited and these are good indicator that something is missing and that
many comments are lying.

ok kettenis


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.16 11-Jul-2014 jsg

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2


Revision tags: OPENBSD_5_5_BASE
# 1.15 09-Dec-2013 espie

forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,
like the rest of tmpfs


# 1.14 08-Dec-2013 espie

allow aobj to shrink grow, for tmpfs support
A few tweaks asked by kettenis@
(code doesn't affect systems without mounted tmpfs at all)

okay beck@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 10-May-2011 oga

Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.

Before we were only calling uao_dropswap() if there was a page, maning
that if the buffer was swapped out then we would leak the slot.

Quite rare because only pipebuffers should swap from the kernel object,
but i've seen panics that implied this had happened (alpha.p for example).

ok thib@ after a lot of discussion and checking the semantics.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 22-Jul-2009 oga

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@


Revision tags: OPENBSD_4_6_BASE
# 1.11 16-Jun-2009 oga

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@


# 1.10 16-Jun-2009 oga

Backout all the PG_RELEASED changes.

This is for the same reason as the earlier backouts, to avoid the bug
either added or exposed sometime around c2k9. This *should* be the last
one.

prompted by deraadt@

ok ariane@


# 1.9 05-May-2009 oga

The first step in cleaning up the use of PG_RELEASED for uvm objects.

Now, the PG_ RELEASED flag currently has two (maybe three) uses. The
valid one is for use with async io where we want to free the page after
we've paged it out. The other ones are "oh i'd like to free this, but
someone else is playing with it". It's simpler to just sleep on the
damned page instead and stop the fiddling.

First step does uao's: in uao_detach, sleep on the object and free it
when we're clean, instead of setting a flag so it's freed after. In
uao_flush, do the same. Change the interation over the object in flush
so that we don't have to add marker pages or other such voodoo to the
list when we sleep (netbsd did that when they had a similar diff), just
use the hash always. We can now change uao_releasepg() to just free the
page, and not bother with the KILLME stuff. When the other objects are
fixed this hook will vanish.

Much discussion with art@ over the idea, and ariane@ over this specific
diff. As mentioned, this one is based loosely on a similar idea in
netbsd.

Been in my tree for a while, survived many make builds, etc, and forcing
paging using ariane's evil program.

ok ariane@, beck@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 26-Jul-2001 art

branches: 1.7.4;
Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD


Revision tags: OPENBSD_2_9_BASE
# 1.6 09-Mar-2001 smart

Protect protypes, certain macros, and inlines from userland. Checked userland
with a 'make build'. From NetBSD. art@ ok


# 1.5 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.4 15-Mar-2000 art

Fix the NetBSD id strings.


Revision tags: OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.3 23-Aug-1999 art

branches: 1.3.4;
sync with NetBSD from 1999.05.24 (there is a reason for this date)
Mostly cleanups, but also a few improvements to pagedaemon for better
handling of low memory and/or low swap conditions.


Revision tags: OPENBSD_2_5_BASE
# 1.2 26-Feb-1999 art

add OpenBSD tags


# 1.1 26-Feb-1999 art

Import of uvm from NetBSD. Some local changes, some code disabled


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.16 11-Jul-2014 jsg

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2


Revision tags: OPENBSD_5_5_BASE
# 1.15 09-Dec-2013 espie

forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,
like the rest of tmpfs


# 1.14 08-Dec-2013 espie

allow aobj to shrink grow, for tmpfs support
A few tweaks asked by kettenis@
(code doesn't affect systems without mounted tmpfs at all)

okay beck@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 10-May-2011 oga

Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.

Before we were only calling uao_dropswap() if there was a page, maning
that if the buffer was swapped out then we would leak the slot.

Quite rare because only pipebuffers should swap from the kernel object,
but i've seen panics that implied this had happened (alpha.p for example).

ok thib@ after a lot of discussion and checking the semantics.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.12 22-Jul-2009 oga

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@


Revision tags: OPENBSD_4_6_BASE
# 1.11 16-Jun-2009 oga

date based reversion of uvm to the 4th May.

We still have no idea why this stops the crashes. but it does.

a machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@


# 1.10 16-Jun-2009 oga

Backout all the PG_RELEASED changes.

This is for the same reason as the earlier backouts, to avoid the bug
either added or exposed sometime around c2k9. This *should* be the last
one.

prompted by deraadt@

ok ariane@


# 1.9 05-May-2009 oga

The first step in cleaning up the use of PG_RELEASED for uvm objects.

Now, the PG_ RELEASED flag currently has two (maybe three) uses. The
valid one is for use with async io where we want to free the page after
we've paged it out. The other ones are "oh i'd like to free this, but
someone else is playing with it". It's simpler to just sleep on the
damned page instead and stop the fiddling.

First step does uao's: in uao_detach, sleep on the object and free it
when we're clean, instead of setting a flag so it's freed after. In
uao_flush, do the same. Change the interation over the object in flush
so that we don't have to add marker pages or other such voodoo to the
list when we sleep (netbsd did that when they had a similar diff), just
use the hash always. We can now change uao_releasepg() to just free the
page, and not bother with the KILLME stuff. When the other objects are
fixed this hook will vanish.

Much discussion with art@ over the idea, and ariane@ over this specific
diff. As mentioned, this one is based loosely on a similar idea in
netbsd.

Been in my tree for a while, survived many make builds, etc, and forcing
paging using ariane's evil program.

ok ariane@, beck@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE SMP_SYNC_A SMP_SYNC_B UBC_SYNC_A UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 26-Jul-2001 art

branches: 1.7.4;
Add support for disabling swap devices (swapctl -d).
Improve error handling on I/O errors to swap.
From NetBSD


Revision tags: OPENBSD_2_9_BASE
# 1.6 09-Mar-2001 smart

Protect protypes, certain macros, and inlines from userland. Checked userland
with a 'make build'. From NetBSD. art@ ok


# 1.5 29-Jan-2001 niklas

$OpenBSD$


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.4 15-Mar-2000 art

Fix the NetBSD id strings.


Revision tags: OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.3 23-Aug-1999 art

branches: 1.3.4;
sync with NetBSD from 1999.05.24 (there is a reason for this date)
Mostly cleanups, but also a few improvements to pagedaemon for better
handling of low memory and/or low swap conditions.


Revision tags: OPENBSD_2_5_BASE
# 1.2 26-Feb-1999 art

add OpenBSD tags


# 1.1 26-Feb-1999 art

Import of uvm from NetBSD. Some local changes, some code disabled