History log of /haiku/src/system/kernel/cache/vnode_store.h
Revision Date Author Comments
# 92030a4a 22-Mar-2022 Augustin Cavalier <waddlesplash@gmail.com>

Revert "vfs: functions to change a vnode busy status and ID"

This reverts commit 8497a2cc289f6d991147995507e4efc0ae189147.

The VFS layer is not at all ready for this. Many places in the
code implicitly assume ino_t values will never change. This
functionality is only necessary for live shrinking of partitions,
which is a feature niche enough we do not need to worry about
implementing it in the first round of resizing (if ever.)


# 8497a2cc 12-Jul-2012 ahenriksson <sausageboy@gmail.com>

vfs: functions to change a vnode busy status and ID

The kernel version is only partially tested.

Change-Id: I9a2f6c78087154ab137eadbced99062a8a2dd688
Reviewed-on: https://review.haiku-os.org/c/918
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 467fe4ca 24-Apr-2016 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel: Add core dump facility

* Add function core_dump_write_core_file(). It writes a core file for
the current thread's team. The file format is similar to that of
other OSs (i.e. ELF with PT_LOAD segments and a PT_NOTE segment), but
most of the notes are Haiku specific (infos for team, areas, images,
threads). More data will probably need to be added.
* Add team flag TEAM_FLAG_DUMP_CORE, thread flag
THREAD_FLAGS_TRAP_FOR_CORE_DUMP, and Team property coreDumpCondition,
a condition variable available while a core dump is progress. A
thread that finds its flag THREAD_FLAGS_TRAP_FOR_CORE_DUMP set before
exiting the kernel to userland calls core_dump_trap_thread(), which
blocks on the condition variable until the core dump has finished. We
need the team's threads to stop so we can get their CPU state (and
have a generally unchanging team state while writing the core file).
* Add user debugger message B_DEBUG_WRITE_CORE_FILE. It causes
core_dump_write_core_file() to be called for the team.
* Dumping core as an immediate effect of a terminal signal has not been
implemented yet, but that should be fairly straight forward.


# f8154d17 02-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

mmlr (distracted) + bonefish:
* Turn VMCache::consumers C list into a DoublyLinkedList.
* Use object caches for the different VMCache types and the VMCacheRefs.
The purpose is to reduce slab area fragmentation.
* Requires the introduction of a pure virtual VMCache::DeleteObject()
method, implemented in the derived classes.


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


# ab3d6a3e 02-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Style cleanup. No functional change.


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


# 377ecfe7 14-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed cache_type_to_string() to vm_cache_type_to_string() and made in
kernel private.
* Moved dumping code from dump_cache() to new VMCache::Dump().
* Override VMCache::Dump() in VMVnodeCache to also print the vnode.
* Removed no longer needed VMCache::GetLock().


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


# 435c43f5 02-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced type generic_io_vec, which is similar to iovec, but uses types
that are wide enough for both virtual and physical addresses.
* DMABuffer, IORequest, IOScheduler,... and code using them: Use
generic_io_vec and generic_{addr,size}_t where necessary.


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


# 1c1d16b3 19-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Adjusted indentation. No functional change.


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


# deee8524 26-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced {malloc,memalign,free}_etc() which take an additional "flags"
argument. They replace the previous special-purpose allocation functions
(malloc_nogrow(), vip_io_request_malloc()).
* Moved the I/O VIP heap to heap.cpp accordingly.
* Added quite a bit of passing around of allocation flags in the VM,
particularly in the VM*AddressSpace classes.
* Fixed IOBuffer::GetNextVirtualVec(): It was ignoring the VIP flag and always
allocated on the normal heap.


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


# 3caec287 01-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Resolved TODO in free_vnode(): There was a race condition between vnode
destruction and VMVnodeCache::AcquireUnreferencedStoreRef(). Solved by
adding a flag to VMVnodeCache and letting AcquireUnreferencedStoreRef()
fail, if set.
* Added TODO regarding replacing the snooze() waiting for busy vnodes.
* get_vnode(): Unlock sVnodeMutex while calling the put_vnode() hook on
error.


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


# be7328a9 07-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved VMCache related definitions to <vm/VMCache.h>.


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


# e50cf876 02-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the VM headers into subdirectory vm/.
* Renamed vm_cache.h/vm_address_space.h to VMCache.h/VMAddressSpace.


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


# b0db552c 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed vm_address_space to VMAddressSpace.


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


# 65d2b8a8 20-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduces VMCache::CanWritePage() returning whether the given cache can
theoretically write the given page.
* page writer: Fixed the incorrect check whether a temporary page can be
written by using the new CanWritePage().


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


# 4eaa43ac 11-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "flags" parameter to VMCache::Read().
* Use the new VMCache::Read() flags parameter to directly read into the
physical page in the page fault handler instead of mapping it first.


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


# 2a79a768 18-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* VMCache::Write(): Added "uint32 flags" argument which is supposed to
be passed on to the IORequest. Most relevantly physical pages can now
be written directly by passing B_PHYSICAL_IO_REQUEST.
* Added VMCache::WriteAsync() which is supposed to write pages
asynchronously. The base class version version falls back to the
synchronous Write(). Only VMVnodeCache implements WriteAsync() ATM,
VMAnonymousCache (swap support) still has to be adjusted accordingly.
* write_page() doesn't need to map the page anymore as it can write the
physical page directly.
* Modified the page writer to write pages asynchronously. This shouldn't
have any noticeable effect yet. It will though as soon as the I/O
scheduler reorders I/O operations.


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


# e6bd90c5 23-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since
this is no longer the case, the argument has become superfluous. For
read_pages() it always was. Removed the argument from the functions
and all functions that propagated it.
* Some whitespace at the end of lines was removed.


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


# 5c99d639 22-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/vm into trunk. This
introduces the following relevant changes:
* VMCache:
- Renamed vm_cache to VMCache, merged it with vm_store and made it a
C++ class with virtual methods (replacing the store operations).
Turned the different store implementations into subclasses.
- Introduced MergeStore() callback, changed semantics of Commit().
- Changed locking and referencing semantics. A reference can only be
acquired/released with the cache locked. An unreferenced cache is
deleted and a mergeable cache merged when it is unlocked. This
removes the "busy" state of a cache and simplifies the page fault
code.
* Added VMAnonymousCache, which will implement swap support (work by
Zhao Shuai). It is not integrated and used yet, though.
* Enabled the mutex/recursive lock holder asserts.
* Fixed DoublyLinkedList::Swap().
* Generalized the low memory handler to a low resource handler. And made
semaphores and reserved memory handled resources. Made
vm_try_resource_memory() optionally wait (with timeout), and used that
feature to reserve memory for areas.
...


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


# c950f17a 06-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Added a acquire_unreferenced_ref() to vm_store
* his has to be used by the page writer to make sure the vnode is still valid.
* This should have been the final nail on the Luposian bug - I haven't tested
it yet, but we'll certainly see :-)


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


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

* vm.h no longer includes vm_types.h - only those that actually need access
to the private VM types are including vm_types.h now.
* Removed vm_page, vm_area, vm_cache, and vm_address_space typedefs; it's
cleaner this way, and the actual types are only used in C++ files now,
anyway.
* And that caused changes in many files...
* Made commpage.h self-containing.
* Minor cleanup.


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


# 6d4aea47 25-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* Removed the vm_cache/vm_store ref_count duality that besides being a bit ugly
also created the page dameon cache retrieval problem: now, only areas (and
cache consumers) retrieve a reference to the store (and therefore, the vnode).
The page daemon doesn't need to care about this at all anymore, and the pseudo
references of the vm_cache could be removed again.
* Rearranged deletion of vnodes such that its ID can be reused directly after
fs_remove_vnode() has been called.
* vm_page_allocate_page() no longer panics when it runs out of pages, but just
waits for new pages to become available using the new sFreeCondition condition
variable - to make sure this happens in an acceptable time frame, it'll
trigger a run of the low memory handlers.
* Implemented a page_thief() that steals inactive pages from caches and puts
them into the free queue. It runs as a low memory handler.
* The file cache now sets the usage count on the pages it inserts into the
cache (needs some rework though, cache_io() doesn't do it yet).
* Instead of panicking, the kernel will currently dead lock in low memory
situations, since BFS does a bit too much in bfs_release_vnode().
* Some minor cleanup.


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


# 2d690920 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed system/core to system/kernel.


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


# f8154d172da77bd77316f14c76d428bae7376323 02-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

mmlr (distracted) + bonefish:
* Turn VMCache::consumers C list into a DoublyLinkedList.
* Use object caches for the different VMCache types and the VMCacheRefs.
The purpose is to reduce slab area fragmentation.
* Requires the introduction of a pure virtual VMCache::DeleteObject()
method, implemented in the derived classes.


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


# ab3d6a3eafbd2e5fe3d66315550ec2231914c585 02-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Style cleanup. No functional change.


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


# 377ecfe797a9f1009dd38702151d2a8c84723018 14-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed cache_type_to_string() to vm_cache_type_to_string() and made in
kernel private.
* Moved dumping code from dump_cache() to new VMCache::Dump().
* Override VMCache::Dump() in VMVnodeCache to also print the vnode.
* Removed no longer needed VMCache::GetLock().


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


# 435c43f5912b109e7d5cf682865d2061e62fad8c 02-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced type generic_io_vec, which is similar to iovec, but uses types
that are wide enough for both virtual and physical addresses.
* DMABuffer, IORequest, IOScheduler,... and code using them: Use
generic_io_vec and generic_{addr,size}_t where necessary.


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


# 1c1d16b3447cf06b258d52db375118bd71e3e981 19-Apr-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Adjusted indentation. No functional change.


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


# deee8524b7534d9b586cbcbf366d0660c9769a8e 26-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced {malloc,memalign,free}_etc() which take an additional "flags"
argument. They replace the previous special-purpose allocation functions
(malloc_nogrow(), vip_io_request_malloc()).
* Moved the I/O VIP heap to heap.cpp accordingly.
* Added quite a bit of passing around of allocation flags in the VM,
particularly in the VM*AddressSpace classes.
* Fixed IOBuffer::GetNextVirtualVec(): It was ignoring the VIP flag and always
allocated on the normal heap.


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


# 3caec2871a079cb604982ce7e5fc56865a7b438d 01-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Resolved TODO in free_vnode(): There was a race condition between vnode
destruction and VMVnodeCache::AcquireUnreferencedStoreRef(). Solved by
adding a flag to VMVnodeCache and letting AcquireUnreferencedStoreRef()
fail, if set.
* Added TODO regarding replacing the snooze() waiting for busy vnodes.
* get_vnode(): Unlock sVnodeMutex while calling the put_vnode() hook on
error.


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


# be7328a9f6b3c55eec71d403a0367d80fd4ebd12 07-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved VMCache related definitions to <vm/VMCache.h>.


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


# e50cf8765be50a7454c9488db38b638cf90805af 02-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the VM headers into subdirectory vm/.
* Renamed vm_cache.h/vm_address_space.h to VMCache.h/VMAddressSpace.


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


# b0db552cd921ff16d61400ee5a5f855f392e8b87 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed vm_address_space to VMAddressSpace.


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


# 65d2b8a8e9fefd59eb270d7c0030ebe85b75d553 20-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduces VMCache::CanWritePage() returning whether the given cache can
theoretically write the given page.
* page writer: Fixed the incorrect check whether a temporary page can be
written by using the new CanWritePage().


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


# 4eaa43ac48bb4936de09b85827893c9beb90b51c 11-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "flags" parameter to VMCache::Read().
* Use the new VMCache::Read() flags parameter to directly read into the
physical page in the page fault handler instead of mapping it first.


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


# 2a79a7686f90e5720024387dd90f8e058d13b044 18-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* VMCache::Write(): Added "uint32 flags" argument which is supposed to
be passed on to the IORequest. Most relevantly physical pages can now
be written directly by passing B_PHYSICAL_IO_REQUEST.
* Added VMCache::WriteAsync() which is supposed to write pages
asynchronously. The base class version version falls back to the
synchronous Write(). Only VMVnodeCache implements WriteAsync() ATM,
VMAnonymousCache (swap support) still has to be adjusted accordingly.
* write_page() doesn't need to map the page anymore as it can write the
physical page directly.
* Modified the page writer to write pages asynchronously. This shouldn't
have any noticeable effect yet. It will though as soon as the I/O
scheduler reorders I/O operations.


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


# e6bd90c58dbae64f3b464edcff90dcb06e63a716 23-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since
this is no longer the case, the argument has become superfluous. For
read_pages() it always was. Removed the argument from the functions
and all functions that propagated it.
* Some whitespace at the end of lines was removed.


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


# 5c99d639708df9b4e2cc847b38d510149d19ec78 22-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/vm into trunk. This
introduces the following relevant changes:
* VMCache:
- Renamed vm_cache to VMCache, merged it with vm_store and made it a
C++ class with virtual methods (replacing the store operations).
Turned the different store implementations into subclasses.
- Introduced MergeStore() callback, changed semantics of Commit().
- Changed locking and referencing semantics. A reference can only be
acquired/released with the cache locked. An unreferenced cache is
deleted and a mergeable cache merged when it is unlocked. This
removes the "busy" state of a cache and simplifies the page fault
code.
* Added VMAnonymousCache, which will implement swap support (work by
Zhao Shuai). It is not integrated and used yet, though.
* Enabled the mutex/recursive lock holder asserts.
* Fixed DoublyLinkedList::Swap().
* Generalized the low memory handler to a low resource handler. And made
semaphores and reserved memory handled resources. Made
vm_try_resource_memory() optionally wait (with timeout), and used that
feature to reserve memory for areas.
...


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


# c950f17a5156c4e3042c0a2429aff0ad1eb80391 06-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Added a acquire_unreferenced_ref() to vm_store
* his has to be used by the page writer to make sure the vnode is still valid.
* This should have been the final nail on the Luposian bug - I haven't tested
it yet, but we'll certainly see :-)


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


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

* vm.h no longer includes vm_types.h - only those that actually need access
to the private VM types are including vm_types.h now.
* Removed vm_page, vm_area, vm_cache, and vm_address_space typedefs; it's
cleaner this way, and the actual types are only used in C++ files now,
anyway.
* And that caused changes in many files...
* Made commpage.h self-containing.
* Minor cleanup.


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


# 6d4aea47962e0ea08b81327fbbf93b32ae821177 25-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* Removed the vm_cache/vm_store ref_count duality that besides being a bit ugly
also created the page dameon cache retrieval problem: now, only areas (and
cache consumers) retrieve a reference to the store (and therefore, the vnode).
The page daemon doesn't need to care about this at all anymore, and the pseudo
references of the vm_cache could be removed again.
* Rearranged deletion of vnodes such that its ID can be reused directly after
fs_remove_vnode() has been called.
* vm_page_allocate_page() no longer panics when it runs out of pages, but just
waits for new pages to become available using the new sFreeCondition condition
variable - to make sure this happens in an acceptable time frame, it'll
trigger a run of the low memory handlers.
* Implemented a page_thief() that steals inactive pages from caches and puts
them into the free queue. It runs as a low memory handler.
* The file cache now sets the usage count on the pages it inserts into the
cache (needs some rework though, cache_io() doesn't do it yet).
* Instead of panicking, the kernel will currently dead lock in low memory
situations, since BFS does a bit too much in bfs_release_vnode().
* Some minor cleanup.


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


# 2d690920ac4d0cd27eb3c118fb2b0862615869e0 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed system/core to system/kernel.


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