This commit is a large "big bang" commit of a composite of changes
that would have been challenging to put in place over a PR train.
The changes yield a significant performance improvement in general
but also lay the foundation for being able to make further smaller
gains over time. The changes should also improve stability of the
application. This commit is a high-risk change and would ideally
be coupled with testing.
The key things which have changed in this commit;
- Code reformatting has been applied at the same time.
- Data models are now largely immutable with builder-style
constructors.
- The code base was previously handling locking of data obtained
from the central model manually in many places which was
prone to mistakes. Now accessing data is, from the clients'
perspective, largely lock-free.
- The removal of locks now removes lock-contention in various
areas of the application including startup which helps with
improving performance.
- Repositories of data such as categories and languages are
now also immutable.
- To simplify data immutability, packages' data is stored in the
central model separately from depots' data.
- Large package data mutations are now done in chunks of packages
rather than package-by-package which means reduced messaging
within the application; especially around the GUI.
- The resolution of data / mutations' notifications is larger
so that changes are not being considered on each property of
a package which simplifies the processing logic in a number of
places.
- Package change-notification is driven out of the central model
rather than from each and every package. There is scope for
further simplification in this space.
- Where logic already knows what data is changed, it is able to
control the change-notification process rather than cause a
large number of object-comparisons to be required.
- The data-loaders from the local package manager and from HDS
have been re-written to work with immutable models.
- The icon repositories have been re-written to make a one-time
notification that icons have changed rather than notify for
every package.
- Data updates reflection in the UI has been changed to work in
chunks of packages rather than package by package which
reduces the quantity of UI window-invalidation / redraws and
also reduces the quantity of re-calculation of scrollbars and
other UI elements.
- Some UI elements have their metrics calculated lazily rather
than up-front which yields a significant performance gain.
Change-Id: Iefaf4a137411e379e4c461ebc8c783fd1646bcf4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9093
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Andrew Lindesay <[email protected]>
See inline comment: otherwise we could deadlock waiting for busy pages.
At the same time, make page_faults_allowed just an int16 and drop
atomics and extra checks, they aren't needed.
Fixes#19441.
Change-Id: I1b7cc06f66b44c3520fa36497c076ee5a6320706
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9120
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Make PositionToolTip update even when not attached to a window.
* Always use the "hover" message to update the tooltip,
never SetPosition.
* Use BControl::Invoke so that hover messages are sent instantly.
* Position the tooltip above the slider always.
Combined with the fixes to the Interface Kit, this provides a much
nicer experience for slider time tooltips.
Change-Id: Ib7f884ca91c253ed7e6639946fd2378166137d80
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9122
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Ideally we would only hide our own tooltip and nobody else's, so
a TODO is added for that case.
This method is called for all mouse events if we get B_OUTSIDE_VIEW
or B_EXITED_VIEW as their "transit", but since tooltips themselves
get all mouse events and thus B_OUTSIDE_VIEW, this had the effect
of hiding all tooltips immediately instead of after the delay.
It was previously ignored if the tooltip was already open.
Note that, combined with the previous commit, this means that
the "where" passed in will basically always be used (except for
"sticky" tooltips.) Applications or classes that use this private
API but pass in wrong or bogus positions will now need to be fixed.
Instead of re-fetching the mouse position. This avoids tooltips "jumping"
when they may have resized by only a few pixels and don't need to be
repositioned.
It's in POSIX-2024. Remove the libgnu implementation and just import
the changes from latest FreeBSD (dc36d6f9bb1753f3) instead.
While at it, put the non-standard sort functions behind
_DEFAULT_SOURCE.
Unfortunately there are some marked "public" that also use it,
so we can't just move the remainder to an internal file and then
drop libio.h from public consumption.
Delete all the unused portions of the public libio.h while at it.
Adjust the two legacy stdc++ headers that still included it;
it seems they didn't themselves depend on any of the definitions it
contained. However, streambuf.h actually did, so put that definition in
libio.h so that it's always present.
(The stdc++ implementation will get the 'real' _G_config.h from
libroot glibc.)
It's set in _G_config.h, but this file doesn't include that,
so in many cases the "unlocked" function was called instead.
(Most of the stdc++ .cc files did have it set, though.)
It's needed by GCC2 stdc++, but we shouldn't be including it
for all consumers of <stdio.h>, which we were. Drop it,
and adjust all the things that were relying on <stdio_pre.h>'s
definition of __PRINTFLIKE to use the _PRINTFLIKE defined
in BeBuild.h instead.
Hopefully should not cause any breakage; the libroot
implementation of __freading depended on this, but
I didn't see anything else which did.
With how we currently use virtual address spaces, the old and
new computations should produce identical results even on LA57,
but this should be more correct if we ever do use more than just
48 bits of the address space.
Change-Id: I61915fceff8e7998032e0a9895010ef9c26b7b94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9121
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Check if the area is a stack, and panic() if so.
* Check names before accessing any area, and don't try
to do anything with areas that we didn't create.
Makes frees pointing to stack data have much more useful
diagnostics than just "generic segfault".
Without this, we will fail to free the last level of page tables.
This bug has apparently been present since LA57 was originally
introduced years ago, however it was likely not a problem before
now because only the BIOS bootloader has support for it, while
systems that support LA57 are more likely to be booted via EFI.
While at it, fix the address mask for non-LA57 in
DebugGetReverseMappingInfo.
Should fix#19460.
The MemoryManager maps and unmaps pages manually, so this isn't
strictly necessary, but it helps with memory accounting in e.g.
ProcessController.
Fixes the kernel_team disappearing from ProcessController's list
(and also having too-low memory amounts) as noticed in #19460.
"int" of course is also an abbrevation for "integer", so having
two abbreviations is sometimes confusing. The BeOS functions
just use "interrupt" (e.g. "install_io_interrupt_handler"); it
seems we inherited the "int" abbreviation from NewOS.
The basic kernel methods and files related to interrupts are
here adjusted to drop the abbreviation and just use "interrupt(s)".
The architecture-specific functions ("arch_int_*") are mostly
moment left alone for now, though of course architecture-specific
usages of the generic kernel methods are adjusted.
Change-Id: Ic113ea1280a3c78e25f8ca3cc55b24ed5f594eae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9119
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This doesn't get all the filesystems that were missing these checks
(e.g. I didn't adjust the more "WIP" filesystems like XFS and BTRFS)
but it does get most of them.
* Restore logic for excluding app_server side of bitmaps
(though this may not work for server-cloned areas, only
server-allocated ones.)
* Leave TODO in place for media buffers.
* Add all kernel-writable areas of the system (kernel) team
to writable memory, but exclude the block_cache.
Fixes display of kernel memory information in ProcessController's
memory usage menu.
Otherwise it won't be reset at all and we will begin with the
previous thread's FPU state, both for userland and kernel threads.
Also clear the FPU state in x86_return_to_userland, just like
in syscall exit.
Change-Id: Ie46d0e64a680c860c7fbff8dc57116625724eadd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9092
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
The XSAVE area can be quite large (1-2KB+), so rather than always
putting it on the kernel stack, just use the arch_thread FPU state.
Change-Id: Ie64c3ea3ca52cd8a4425ae1da69792588a69832a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9090
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>