History log of /haiku/src/system/kernel/vm/PageCacheLocker.h
Revision Date Author Comments
# 40bb9481 03-Feb-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed useless return parameter from vm_remove_all_page_mappings().
* Added vm_clear_page_mapping_accessed_flags() and
vm_remove_all_page_mappings_if_unaccessed(), which combine the functionality
of vm_test_map_activation(), vm_clear_map_flags(), and
vm_remove_all_page_mappings(), thus saving lots of calls to translation map
methods. The backend is the new method
VMTranslationMap::ClearAccessedAndModified().
* Started to make use of the cached page queue and changed the meaning of the
other non-free queues slightly:
- Active queue: Contains mapped pages that have been used recently.
- Inactive queue: Contains mapped pages that have not been used recently. Also
contains unmapped temporary pages.
- Modified queue: Contains unmapped modified pages.
- Cached queue: Contains unmapped unmodified pages (LRU sorted).
Unless we're actually low on memory and actively do paging, modified and
cached queues only contain non-temporary pages. Cached pages are considered
quasi free. They still belong to a cache, but since they are unmodified and
unmapped, they can be freed immediately. And this is what
vm_page_[try_]reserve_pages() do now when there are no more actually free
pages at hand. Essentially this means that pages storing cached file data,
unless mmap()ped, no longer are considered used and don't contribute to page
pressure. Paging will not happen as long there are enough free + cached pages
available.
* Reimplemented the page daemon. It no longer scans all pages, but instead works
the page queues. As long as the free pages situation is harmless, it only
iterates through the active queue and deactivates pages that have not been
used recently. When paging occurs it additionally scans the inactive queue and
frees pages that have not been used recently.
* Changed the page reservation/allocation interface:
vm_page_[try_]reserve_pages(), vm_page_unreserve_pages(), and
vm_page_allocate_page() now take a vm_page_reservation structure pointer.
The reservation functions initialize the structure -- currently consisting
only of a count member for the number of still reserved pages.
vm_page_allocate_page() decrements the count and vm_page_unreserve_pages()
unreserves the remaining pages (if any). Advantages are that reservation/
unreservation mismatches cannot occur anymore, that vm_page_allocate_page()
can verify that the caller has indeed a reserved page left, and that there's
no unnecessary pressure on the free page pool anymore. The only disadvantage
is that the vm_page_reservation object needs to be passed around a bit.
* Reworked the page reservation implementation:
- Got rid of sSystemReservedPages and sPageDeficit. Instead
sUnreservedFreePages now actually contains the number of free pages that
have not yet been reserved (it cannot become negative anymore) and the new
sUnsatisfiedPageReservations contains the number of pages that are still
needed for reservation.
- Threads waiting for reservations do now add themselves to a waiter queue,
which is ordered by descending priority (VM priority and thread priority).
High priority waiters are served first when pages become available.
Fixes #5328.
* cache_prefetch_vnode(): Would reserve one less page than allocated later, if
the size wasn't page aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7e414f2 07-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Made page_writer() use a marker page as well, so that it won't try to get
the same pages over and over.
* Increased the priority of the page writer a bit, so that it is higher than
the one of the page daemon.
* Added a sModifiedTemporaryPages counter to let the page_writer decide how
many pages are there to write back (temporary pages would go to the swap file
and are only written back when memory is low).
* In case there are more than 1024 modified (non-temporary) pages around, the
page writer will constantly write out pages, not only when being pushed.
* The page writer now temporarily always leave out temporary pages (as long as
we don't have a swap file).
* Shuffled functions around a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22852 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a6778735 28-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* We now have a page writer that takes some pages from the modified queue
and writes it back every few seconds. It can be triggered by the page
scanner to do that more often, though. That mechanism can be greatly
improved once we have our I/O scheduler working.
* Removed vm_page_write_modified_page() again - it was all "eaten up" by
the page writer.
* Reworked vm_page_write_modified_pages() a bit: it now uses
vm_test_map_modification() and vm_clear_map_flags() instead of the
iterating over all areas which wouldn't even work correctly.
The code is much simpler now, too.
* You usually put something to the tail of a queue, and remove the contents
from the head, not vice versa - changed queue implementation to reflect this.
* Additionally, there is now a enqueue_page_to_head() if you actually want the
opposite.
* vm_page_requeue() allows you to move a page in a queue to the head or tail.
* Replaced vm_clear_map_activation() with vm_clear_map_flags() which allows
you to clear other flags than PAGE_ACCESSED.
* The page scanner dumps now some arguments with each run.
* Removed the old disabled pageout_daemon() from NewOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40bb94819e6c39d72ab29edc1a0dcd80b15b8b42 03-Feb-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed useless return parameter from vm_remove_all_page_mappings().
* Added vm_clear_page_mapping_accessed_flags() and
vm_remove_all_page_mappings_if_unaccessed(), which combine the functionality
of vm_test_map_activation(), vm_clear_map_flags(), and
vm_remove_all_page_mappings(), thus saving lots of calls to translation map
methods. The backend is the new method
VMTranslationMap::ClearAccessedAndModified().
* Started to make use of the cached page queue and changed the meaning of the
other non-free queues slightly:
- Active queue: Contains mapped pages that have been used recently.
- Inactive queue: Contains mapped pages that have not been used recently. Also
contains unmapped temporary pages.
- Modified queue: Contains unmapped modified pages.
- Cached queue: Contains unmapped unmodified pages (LRU sorted).
Unless we're actually low on memory and actively do paging, modified and
cached queues only contain non-temporary pages. Cached pages are considered
quasi free. They still belong to a cache, but since they are unmodified and
unmapped, they can be freed immediately. And this is what
vm_page_[try_]reserve_pages() do now when there are no more actually free
pages at hand. Essentially this means that pages storing cached file data,
unless mmap()ped, no longer are considered used and don't contribute to page
pressure. Paging will not happen as long there are enough free + cached pages
available.
* Reimplemented the page daemon. It no longer scans all pages, but instead works
the page queues. As long as the free pages situation is harmless, it only
iterates through the active queue and deactivates pages that have not been
used recently. When paging occurs it additionally scans the inactive queue and
frees pages that have not been used recently.
* Changed the page reservation/allocation interface:
vm_page_[try_]reserve_pages(), vm_page_unreserve_pages(), and
vm_page_allocate_page() now take a vm_page_reservation structure pointer.
The reservation functions initialize the structure -- currently consisting
only of a count member for the number of still reserved pages.
vm_page_allocate_page() decrements the count and vm_page_unreserve_pages()
unreserves the remaining pages (if any). Advantages are that reservation/
unreservation mismatches cannot occur anymore, that vm_page_allocate_page()
can verify that the caller has indeed a reserved page left, and that there's
no unnecessary pressure on the free page pool anymore. The only disadvantage
is that the vm_page_reservation object needs to be passed around a bit.
* Reworked the page reservation implementation:
- Got rid of sSystemReservedPages and sPageDeficit. Instead
sUnreservedFreePages now actually contains the number of free pages that
have not yet been reserved (it cannot become negative anymore) and the new
sUnsatisfiedPageReservations contains the number of pages that are still
needed for reservation.
- Threads waiting for reservations do now add themselves to a waiter queue,
which is ordered by descending priority (VM priority and thread priority).
High priority waiters are served first when pages become available.
Fixes #5328.
* cache_prefetch_vnode(): Would reserve one less page than allocated later, if
the size wasn't page aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7e414f22b68451ecb9201f435630753117976fd 07-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Made page_writer() use a marker page as well, so that it won't try to get
the same pages over and over.
* Increased the priority of the page writer a bit, so that it is higher than
the one of the page daemon.
* Added a sModifiedTemporaryPages counter to let the page_writer decide how
many pages are there to write back (temporary pages would go to the swap file
and are only written back when memory is low).
* In case there are more than 1024 modified (non-temporary) pages around, the
page writer will constantly write out pages, not only when being pushed.
* The page writer now temporarily always leave out temporary pages (as long as
we don't have a swap file).
* Shuffled functions around a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22852 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a6778735f9b06e497f3ad8e23b7c6da9356bbef5 28-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* We now have a page writer that takes some pages from the modified queue
and writes it back every few seconds. It can be triggered by the page
scanner to do that more often, though. That mechanism can be greatly
improved once we have our I/O scheduler working.
* Removed vm_page_write_modified_page() again - it was all "eaten up" by
the page writer.
* Reworked vm_page_write_modified_pages() a bit: it now uses
vm_test_map_modification() and vm_clear_map_flags() instead of the
iterating over all areas which wouldn't even work correctly.
The code is much simpler now, too.
* You usually put something to the tail of a queue, and remove the contents
from the head, not vice versa - changed queue implementation to reflect this.
* Additionally, there is now a enqueue_page_to_head() if you actually want the
opposite.
* vm_page_requeue() allows you to move a page in a queue to the head or tail.
* Replaced vm_clear_map_activation() with vm_clear_map_flags() which allows
you to clear other flags than PAGE_ACCESSED.
* The page scanner dumps now some arguments with each run.
* Removed the old disabled pageout_daemon() from NewOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22348 a95241bf-73f2-0310-859d-f6bbb57e9c96