History log of /haiku/src/system/kernel/fs/Vnode.h
Revision Date Author Comments
# 5d4501aa 20-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

Assorted whitespace cleanup and typo fixes.


# 73ad2473 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

Remove remaining unnecessary 'volatile' qualifiers


# 47ea54c5 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Generalize use of Vnode::covered_by/covers

* Introduce Vnode flags for covered and covering. Can be used as a quick
check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
volume root vnodes to generally support covered/covering vnodes.


# 02be66ca 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced fs_mount::covers_vnode by Vnode::covers

Introduce a Vnode::covers field. It is currently only used for the root
node of an fs_mount, replacing fs_mount::covers_vnode.


# 2e21fc54 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Generalize use of Vnode::covered_by/covers

* Introduce Vnode flags for covered and covering. Can be used as a quick
check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
volume root vnodes to generally support covered/covering vnodes.


# 3cc71079 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced fs_mount::covers_vnode by Vnode::covers

Introduce a Vnode::covers field. It is currently only used for the root
node of an fs_mount, replacing fs_mount::covers_vnode.


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


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


# 54848900 02-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the unused vnode management to a new file. Well the few variables
used for it that is.
* The main cause for the heavy contention of the unused vnodes mutex was that
relatively few vnodes are actually used for a longer time. Mainly those are
the volume roots, mmap()ed files, and the files opened by programs. A good
deal of nodes -- particularly directories -- are just referenced for a very
short time, e.g. to resolve a path to a contained entry. This caused those
nodes to be added to and removed from the unused vnodes list very
frequently, thus resulting in a high contention of the mutex guarding it.
To address the problem I've introduced an approximation of a set of "hot"
vnodes, i.e. vnodes that have recently been marked unused. They are stored
in an array that by means of an r/w locker and atomic operations can most
of the time be accessed concurrently. Whenever it gets full, it is flushed
to the actual unused vnodes list.
* dec_vnode_ref_count(): No longer check the unused vnode count every time.
The called new vnode_unused() does only from time to time and returns when
the caller is expected to free some of the unused vnodes. As a side effect
this also fixes a bug I previously introduced: The unused vnode to be freed
was marked busy without being locked first.

The -j8 Haiku image test build shows that the changes reduce the contention
of the unused vnode list mutex to virtually zero without introducing any
significant contention of the new r/w lock. The VMCache lock contention also
seems to be decreased somewhat, which is probably not that surprising
considering that the page writer acquires/releases vnode references with the
cache lock held. The "pages" lock takes over even more contention, now
causing more than 100000 waits per second.
The total build time reduction is about 4.5%. Kernel time drops more than
10%.


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


# 8ccbb781 02-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the vnode structure (to by Vnode class at some time in the future) into
its own header/source files.
* Changed vnode's bit fields to a single, atomically changeable int32 using
flags instead. Added respective accessor methods.
* Added a per-vnode mutex-like lock, which uses 2 bits of the structure and
32 global "buckets" which are used for waiter lists for the vnode locks.
* Reorganized the VFS locking a bit:
Renamed sVnodeMutex to sVnodeLock and made it an r/w lock. In most situations
it is now only read-locked to reduce its contention. The per-vnode locks guard
the fields of the vnode structure and the newly introduced sUnusedVnodesLock
has taken over the job to guard the unused vnodes list.

The main intent of the changes was to reduce the contention of the sVnodeMutex,
which was partially successful. In my standard -j8 Haiku image build test the
new sUnusedVnodesLock took over about a fourth of the former sVnodeMutex
contention, but the sVnodeLock and the vnode locks have virtually no contention
to speak of, now. A lot of contention migrated to the unrelated "pages" mutex
(another bottleneck). The overall build time dropped about 10 %.



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


# 5d4501aa0187e1a8790784dc2ab3382a16660e93 20-Aug-2015 Michael Lotz <mmlr@mlotz.ch>

Assorted whitespace cleanup and typo fixes.


# 73ad2473e7874b3702cf5b0fdf4c81b747812ed9 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

Remove remaining unnecessary 'volatile' qualifiers


# 47ea54c55bed272f7c506b23d1ff8216e6a57a96 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Generalize use of Vnode::covered_by/covers

* Introduce Vnode flags for covered and covering. Can be used as a quick
check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
volume root vnodes to generally support covered/covering vnodes.


# 02be66ca1093b26d538f9aa56ede8564c910acdd 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced fs_mount::covers_vnode by Vnode::covers

Introduce a Vnode::covers field. It is currently only used for the root
node of an fs_mount, replacing fs_mount::covers_vnode.


# 2e21fc543649e665507240f0803de9dddc26f152 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Generalize use of Vnode::covered_by/covers

* Introduce Vnode flags for covered and covering. Can be used as a quick
check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
volume root vnodes to generally support covered/covering vnodes.


# 3cc710798baa42c155dd2e5c4c75306755ae2fd7 20-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced fs_mount::covers_vnode by Vnode::covers

Introduce a Vnode::covers field. It is currently only used for the root
node of an fs_mount, replacing fs_mount::covers_vnode.


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


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


# 5484890096d122519e722d0a31b478eaa7e8ea1d 02-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the unused vnode management to a new file. Well the few variables
used for it that is.
* The main cause for the heavy contention of the unused vnodes mutex was that
relatively few vnodes are actually used for a longer time. Mainly those are
the volume roots, mmap()ed files, and the files opened by programs. A good
deal of nodes -- particularly directories -- are just referenced for a very
short time, e.g. to resolve a path to a contained entry. This caused those
nodes to be added to and removed from the unused vnodes list very
frequently, thus resulting in a high contention of the mutex guarding it.
To address the problem I've introduced an approximation of a set of "hot"
vnodes, i.e. vnodes that have recently been marked unused. They are stored
in an array that by means of an r/w locker and atomic operations can most
of the time be accessed concurrently. Whenever it gets full, it is flushed
to the actual unused vnodes list.
* dec_vnode_ref_count(): No longer check the unused vnode count every time.
The called new vnode_unused() does only from time to time and returns when
the caller is expected to free some of the unused vnodes. As a side effect
this also fixes a bug I previously introduced: The unused vnode to be freed
was marked busy without being locked first.

The -j8 Haiku image test build shows that the changes reduce the contention
of the unused vnode list mutex to virtually zero without introducing any
significant contention of the new r/w lock. The VMCache lock contention also
seems to be decreased somewhat, which is probably not that surprising
considering that the page writer acquires/releases vnode references with the
cache lock held. The "pages" lock takes over even more contention, now
causing more than 100000 waits per second.
The total build time reduction is about 4.5%. Kernel time drops more than
10%.


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


# 8ccbb7815ced1c3900042f36ff32ccd1f7f812d9 02-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the vnode structure (to by Vnode class at some time in the future) into
its own header/source files.
* Changed vnode's bit fields to a single, atomically changeable int32 using
flags instead. Added respective accessor methods.
* Added a per-vnode mutex-like lock, which uses 2 bits of the structure and
32 global "buckets" which are used for waiter lists for the vnode locks.
* Reorganized the VFS locking a bit:
Renamed sVnodeMutex to sVnodeLock and made it an r/w lock. In most situations
it is now only read-locked to reduce its contention. The per-vnode locks guard
the fields of the vnode structure and the newly introduced sUnusedVnodesLock
has taken over the job to guard the unused vnodes list.

The main intent of the changes was to reduce the contention of the sVnodeMutex,
which was partially successful. In my standard -j8 Haiku image build test the
new sUnusedVnodesLock took over about a fourth of the former sVnodeMutex
contention, but the sVnodeLock and the vnode locks have virtually no contention
to speak of, now. A lot of contention migrated to the unrelated "pages" mutex
(another bottleneck). The overall build time dropped about 10 %.



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