device path + child partition name. When a "raw" device is unpublished the node
removal notification triggers the partition and child partitions to be
unpublished/removed. Since in that case the "raw" node is already unpublished
trying to resolve it in devfs_unpublish_partition() again to unpublish the child
partitions would fail, leaving the child partition nodes behind. When a new raw
device would then become available publishing its partitions would fail because
of these left behind nodes, causing bug #4587. Seeing that this code is more
compact and straight forward anyway I don't quite see why it was changed in the
first place.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34967 a95241bf-73f2-0310-859d-f6bbb57e9c96
LockAllSourceCaches()) and moved it to the beginning of the file.
* Removed sMappingLock and adjusted the locking policy for mapping/unmapping
pages: Since holding the lock of the affected pages' caches is already
required, that does now protect the page's mappings, too. The area mappings
are protected by the translation map lock, which we always acquire anyway
when mapping, unmapping, or looking up mappings.
The change results in a -j8 Haiku image build speedup of almost 10%. The
total kernel time drops almost 30%.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34965 a95241bf-73f2-0310-859d-f6bbb57e9c96
Apparently (at least when running in VMware >=2) the boot loader can still
map the same physical page more than once -- in the ACPI or HPET code I
suppose -- which would lead to this situation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34954 a95241bf-73f2-0310-859d-f6bbb57e9c96
following function might otherwise not be shown correctly in ELF tools.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34952 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Moved hash computations out of the critical sections.
* Replaced the LRU entry queue by an array of entry "generations", each
containing a sparse array of entries of that generation. Whenever a
generation is full, we clear the oldest generation and continue with that
one. The main advantage of this algorithm is that entry cache's mutex could
be replaced by an r/w lock, that most of the time only has to be read
locked in Lookup(). This does dramatically decrease contention of that
lock.
The total -j8 Haiku image build speedup is marginal, but the kernel time
drops about 7% (now being smaller than the real time).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34950 a95241bf-73f2-0310-859d-f6bbb57e9c96
don't need it. That prevents us from ending up with the page being mapped
multiple times (under VMware at least) and thus fixes#5208.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34948 a95241bf-73f2-0310-859d-f6bbb57e9c96
allocate all pages the given range intersects with. When not page aligned
it could fail to allocate the last page.
* mmu_free():
- Adjusted semantics to be compatible with mmu_map_physical_memory().
- The validity check was broken, because page number and addresses were
mixed, and because KERNEL_BASE + kMaxKernelSize doesn't mark the end of
the allocated virtual ranges.
- The final check against sNextVirtualAddress was broken.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34947 a95241bf-73f2-0310-859d-f6bbb57e9c96
would yield double inversion of the caret position, causing #5006
* cleanup with respect to when the selection can be highlighted and/or the
caret can be shown/hidden
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34944 a95241bf-73f2-0310-859d-f6bbb57e9c96
protected by the global vnodes lock. The contention mostly moves to other
locks, though. The total -j8 Haiku image build time is only reduced
minimally.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34938 a95241bf-73f2-0310-859d-f6bbb57e9c96
contention about two orders of magnitude. Most of it seems to be taken over
by other locks, though. Yields only small improvements for the -j8 Haiku
image build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34937 a95241bf-73f2-0310-859d-f6bbb57e9c96
table. It is now inline and uses double-checked locking. This reduces the
contention on the lock to insignificant. Total -j8 Haiku image build speedup
is marginal, but the total kernel time drops 12%.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34934 a95241bf-73f2-0310-859d-f6bbb57e9c96
access to a vm_page. It is basically an atomically accessed thread ID field
in the vm_page structure, which is explicitly set by macros marking the
critical sections. As a first positive effect I had to review quite a bit of
code and found several issues.
* Added several TODOs and comments. Some harmless ones, but also a few
troublesome ones in vm.cpp regarding page unmapping.
* file_cache: PrecacheIO::Prepare()/read_into_cache: Removed superfluous
vm_page_allocate_page() return value checks. It cannot fail anymore.
* Removed the heavily contended "pages" lock. We use different policies now:
- sModifiedTemporaryPages is accessed atomically.
- sPageDeficitLock and sFreePageCondition are protected by a new mutex.
- The page queues have individual locks (mutexes).
- Renamed set_page_state_nolock() to set_page_state(). Unless the caller says
otherwise, it does now lock the affected pages queues itself. Also changed
the return value to void -- we panic() anyway.
* set_page_state(): Add free/clear pages to the beginning of their respective
queues as this is more cache-friendly.
* Pages with the states PAGE_STATE_WIRED or PAGE_STATE_UNUSED are no longer
in any queue. They were in the "active" queue, but there's no good reason
to have them there. In case we decide to let the page daemon work the queues
(like FreeBSD) they would just be in the way.
* Pulled the common part of vm_page_allocate_page_run[_no_base]() into a helper
function. Also fixed a bug I introduced previously: The functions must not
vm_page_unreserve_pages() on success, since they remove the pages from the
free/clear queue without decrementing sUnreservedFreePages.
* vm_page_set_state(): Changed return type to void. The function cannot really
fail and no-one was checking it anyway.
* vm_page_free(), vm_page_set_state(): Added assertion: The page must not be
free/clear before. This is implied by the policy that no-one is allowed to
access free/clear pages without holding the respective queue's lock, which is
not the case at this point. This found the bug fixed in r34912.
* vm_page_requeue(): Added general assertions. panic() when requeuing of
free/clear pages is requested. Same reason as above.
* vm_clone_area(), B_FULL_LOCK case: Don't map busy pages. The implementation is
still not correct, though.
My usual -j8 Haiku build test runs another 10% faster, now. The total kernel
time drops about 18%. As hoped the new locks have only a fraction of the old
"pages" lock contention. Other locks lead the "most wanted list" now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34933 a95241bf-73f2-0310-859d-f6bbb57e9c96
canceled status, so we need to collect the corresponding sem release. Otherwise
we would run directly into the old cancel status the next time we schedule.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34932 a95241bf-73f2-0310-859d-f6bbb57e9c96
performance tests, but I wrote this code before David got around to improve
his color space assembler code and didn't want to throw it away. Turned
off for the time being, since David's version works fine.
* Supply a codec sub_id in the media_codec_info. This allows matching
decoders to encoders, which comes in handy for Smart Rendering in Clockwerk.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34931 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Use the configured source color space when converting instead of hardcoding
B_RGB32. (Resolved TODO)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34929 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96