have one anymore anyway.
* Removed unnecessary setting the list links to NULL after removing a node.
* Replaced "element == NULL" check in Insert() by an assert. This just hid
potential errors.
* Added Insert{Before,After}() methods and declared the Insert() version
with the InsertBefore() semantics obsolete.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34873 a95241bf-73f2-0310-859d-f6bbb57e9c96
playing with the unused list manually. This also clears the vnode's unused
flag, which wasn't done before and would thus cause corruption of the
unused list a bit later.
* fs_unmount():
- Fixed an iteration bug I introduced previously. The iterator would be
advanced twice per iteration, leading to NULL pointer dereferencing
when the vnode count was odd and skipping the checks for every other
vnode.
- All vnodes are going to be freed, so vnode_to_be_freed() has to invoked
for every one of them. The code wasn't adjusted correctly when
introducing the hot vnodes handling.
* Adjusted/improved some comments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34871 a95241bf-73f2-0310-859d-f6bbb57e9c96
available in the boot loader.
* Simplified parse_ip_address() and use style conforming identifiers.
* Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34870 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
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
* let BuildSetup set HAIKU_HOST_IS_BIG_ENDIAN according to HOST_GCC_MACHINE
* minor cleanup in BuildSetup
* when building ICU, set the endianness indicator suffix according to
HAIKU_HOST_IS_BIG_ENDIAN
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34864 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Skip mappings to non-physical memory in the PPC MMU code. Gets the
PPC kernel booting a little further.
Thanks! Fixes ticket #5193.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34863 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fix a typo in the comments: unintialized -> uninitialized.
Thanks a lot!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34857 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fix duplicate assignment which is probably a merging artifact.
This patch was also a requirement for a working PPC KDL prompt. I didn't
apply the patches in order... Thanks a lot!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34856 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fix a warning in VM tracing output, which prevented the compilation since
warnings are treated as errors.
Thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34855 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The kernel's _start entry function expects now a second argument, the
current CPU index. The PPC boot loader didn't initialize GPR4, passing
its second argument, the kernel entry address, as CPU index, causing
smp_cpu_rendezvous() to loop forever. This fix gets the PPC boot to a
kernel debug prompt. The CPU index is currently fixed to 0.
Thanks a lot!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34854 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Choosing Reboot from the menu will now reboot the system instead of
returning to the OpenFirmware prompt. Places, where returning to the
prompt was desirable have been adapted to maintain their current behavior.
Thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34852 a95241bf-73f2-0310-859d-f6bbb57e9c96
* If retrieving an IP address from the non-standard /chosen/dhcp-response
fails, try to parse it from /options/default-client-ip instead.
Thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34850 a95241bf-73f2-0310-859d-f6bbb57e9c96
the value, otherwise it would not work correctly in some tricky conditions,
inserting unnecessary undo steps or none at all for example when changing a
value, applying and then changing it back manually and switching focus.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34848 a95241bf-73f2-0310-859d-f6bbb57e9c96
in VMCache, but, if anything, that makes a -j8 build marginally slower. I
guess busy vnodes are encountered so rarely that the additional overhead for
a more intelligent algorithm isn't really worth it. Reduced the wait time,
though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34845 a95241bf-73f2-0310-859d-f6bbb57e9c96
duplicating firmware names in firmware_get() of the freebsd compat layer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34844 a95241bf-73f2-0310-859d-f6bbb57e9c96
stores the value right-shifted by 12 bits, now, since those bits are not
relevant. This saves some bits and also resolves a TODO.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34842 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
it do that? This fixes the kernel build, and probably GCC4, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34840 a95241bf-73f2-0310-859d-f6bbb57e9c96
sure that the kernel's frame buffer console points to the right data.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34835 a95241bf-73f2-0310-859d-f6bbb57e9c96
so that it can make use of the firmware installed by the OptionalPackage
Wifi-ipw2100+fw.
* Updating OptionalPackages to use the latest Wifi-ipw2100+fw package.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34833 a95241bf-73f2-0310-859d-f6bbb57e9c96
* When interrupts are disabled, it is still safe to capture the kernel stack
trace. The respective TODO preceded the introduction of the "kernelOnly"
flag.
* Actually made "kernelOnly" work. The wrong flag was passed to
arch_debug_get_stack_trace() in case it was false, so we never captured
user stack traces.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34832 a95241bf-73f2-0310-859d-f6bbb57e9c96
directory iteration code, a mutex to protect the iteration cookie and one
to protect the cookie list have been introduced.
Overall this reduces the contention of the rootfs lock significantly. The
Haiku image -j8 build gets only marginally faster though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34831 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Changed the rw_lock_{read,write}_unlock() return values to void. They
returned a value != B_OK only in case of user error and no-one checked them
anyway.
* Optimized rw_lock_read_[un]lock(). They are inline now and as long as
there's no contending write locker, they will only perform an atomic_add().
* Changed the semantics of nested locking after acquiring a write lock: Read
and write locks are counted separately, so read locks no longer implicitly
become write locks. This does e.g. make degrading a write lock to a read
lock by way of read_lock + write_unlock (as used in the VM) actually work.
These changes speed up the -j8 Haiku image build on my machine by a few
percent, but more interestingly they reduce the total kernel time by 25 %.
Apparently we get more contention on other locks, now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34830 a95241bf-73f2-0310-859d-f6bbb57e9c96
values are not really useful, since they should only be != B_OK in case of
user error, and will be changed to void.
* Added tests for write lock to read lock degrading.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34829 a95241bf-73f2-0310-859d-f6bbb57e9c96
TermView::MessageReceived for B_SIMPLE_DATA, so that a drop with the
right mouse button is handled correctly. Fixes ticket #5172.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34828 a95241bf-73f2-0310-859d-f6bbb57e9c96
a driver which publishes a device as "/dev/kernel_unit_tests". Commands
can be issued by writing to the device (e.g.
"echo help > /dev/kernel_unit_tests"), output is written to serial port/
syslog.
* Added a few tests for rw_lock.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34827 a95241bf-73f2-0310-859d-f6bbb57e9c96
the function shall nevertheless return the length of the string that would
be written, if the buffer were large enough.
Added a touch of C++ while doing that. :-)
* Fixed the instances in boot loader, kernel, and kernel modules where the
wrong semantics were expected. The majority of uses actually.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34826 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now the reference count get accessed only once, leading to true atomarity.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34823 a95241bf-73f2-0310-859d-f6bbb57e9c96