67483 Commits

Author SHA1 Message Date
Augustin Cavalier
07f87734c5 BColumnListView: Don't invalidate if the row is below the visible rect.
Another significant invalidations optimization.
hrev58647
2025-02-15 21:49:31 -05:00
Augustin Cavalier
6f0caabcf7 HaikuDepot: Re-invalidate and re-derive labels in ItemCountView sporadically.
Instead of unconditionally calling _DeriveLabel() and Invalidate()
every time (both expensive operations), use a bool to track whether
we've already invalidated, and derive the label in Draw() if it
was set.

Significantly decreases the invalidations done on full-list rebuilds.
hrev58646
2025-02-15 21:22:55 -05:00
Augustin Cavalier
341d251a45 BScrollBar: Avoid unnecessary invalidations when changing properties.
* _UpdateThumbFrame() calls Invalidate() already, don't call it again
   in SetRange unnecessarily.

 * If the new and old thumb frames are the same, skip invalidation.

Saves a lot of Invalidate() calls in HaikuDepot on building the
"all packages" list especially.
2025-02-15 21:12:30 -05:00
Augustin Cavalier
fbb27923df HaikuDepot: Use more optimal string operations in searching.
* package->Name() is always lowercase, don't bother using lowercase
   operations on it.

 * Use IFindFirst rather than transforming the string; this uses
   strcasestr internally which operates per-character.

Loosely based on a patch by oco in #19421.
2025-02-15 21:10:00 -05:00
Autocomitter
ab36abde53 Update translations from Pootle hrev58645 2025-02-15 08:07:47 +00:00
Jérôme Duval
64a0bc243c pthread_key: when calling destructors, iterates over keys again
when a non-null value is found, up to PTHREAD_DESTRUCTOR_ITERATIONS (4).
* fixes LLVM unit test SanitizerCommon.PthreadDestructorIterations.
Change-Id: I1f9f4d3e8723261326e6e22b0f0d23907dccb59f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8979
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58644
2025-02-14 18:27:12 +00:00
Augustin Cavalier
97a87f98c6 BFS: Avoid putting and re-getting the same block again in CachedBlock.
This case happens now and again, including a few dozen times in the
bootloader, hundreds of times on boot, and thousands of times
when running "git status" on larger repositories.

It reduces block_cache contention in "git status buildtools" specifically
from ~10m1s wait time to ~9m13s, and overall time from ~36.2s to ~33.5s
(in a 4-core VM.)
hrev58643
2025-02-14 13:23:14 -05:00
Augustin Cavalier
15acd461ea kernel/vm: Don't use VMArea before NULL-checking it.
Fixes #19417.
hrev58642
2025-02-14 09:17:22 -05:00
Augustin Cavalier
a75fe7d4fd kernel/vm: Handle "less" in FindClosestArea correctly when encountering reserved areas.
This only matters when the area exactly at the address is a reserved one,
which probably does not happen so often (this case is only used from
AreaRangeIterator at the moment.)
2025-02-14 09:13:38 -05:00
Jérôme Duval
74b5b25f77 virtio_pci: accept any pci revision for modern devices
as in the specification.

Change-Id: I74d667daea386d3189095542d8f515fc3711a910
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8978
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58641
2025-02-14 12:59:38 +00:00
Jérôme Duval
12b22e8e48 strace: mapping type handler for _kern_map_file()
Change-Id: I1f315c285668221fb9ff15165c81dfcd753d7df8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8977
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2025-02-14 12:59:38 +00:00
Autocomitter
083e763302 Update translations from Pootle hrev58640 2025-02-14 07:15:20 +00:00
Augustin Cavalier
19f1423287 libroot/os: Re-enable "was not actually locked!" assertion.
It was disabled because hoard2 triggered it far too often.
But now that we're using OpenBSD malloc with different glue,
this isn't an issue anymore.

Closes #18451.

Change-Id: I9a3b1190edbbe0ae3cedfe4df2993441d1f2d629
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8975
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58639
2025-02-13 22:43:57 +00:00
Augustin Cavalier
9cd1e917ef libroot/posix: Enable OpenBSD malloc by default.
jam HaikuDepot with nothing to do, best of many runs:

hoard2
real    0m3.519s
user    0m3.348s
sys     0m0.159s

openbsd
real    0m3.481s
user    0m3.327s
sys     0m0.147s

time printf "continue\nsave-report\nquit\nk\n" | Debugger -c Debugger -s 1000

hoard2
real    0m2.295s
user    0m2.505s
sys     0m0.128s

openbsd
real    0m2.896s
user    0m2.809s
sys     0m0.579s

The performance difference in Debugger is due to OpenBSD malloc
actually decommitting memory. If we disable decommit, then
OpenBSD malloc is faster than hoard2 in this case also.

In some particular cases this is a huge speedup. For example, the link
of the "lto-dump" program in GCC seems to hit a pathological case in
hoard2 and our glue code for it; with hoard2 it takes around 23 seconds,
but with this allocator it takes only 2 seconds (!). Overall the
performance difference is much more modest, though.

Overall, system memory usage seems to be up about ~5% (318 MB -> 334 MB
just after boot), and that seems to mostly be due to the allocator
filling its initial caches faster when allocations occur, rather than
lazily allocating.

Change-Id: I071d8f76fbbfa11547bd6da6bf649d111414e780
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8974
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2025-02-13 22:43:57 +00:00
Augustin Cavalier
69cb8e25ff libroot/posix: Add glue code, global caching logic, and integrate OpenBSD malloc.
* PagesAllocator: A process-global caching strategy for the allocator.
   It deals with allocating virtual addresses and memory, and gives us
   back some of the performance that's lost by having an actual
   decommitment strategy (which the hoard2 glue code doesn't.)

   It uses two SplayTrees to manage free lists, and resizes areas
   on allocate if they aren't next to a free chunk (which saves a lot of
   time for large reallocations.)

   There's still room for improvement here, see inline TODOs. But overall
   we get pretty good performance with it.

 * Add a TLS slot for the allocator glue to use. Right now it just puts
   integers in there (since thread IDs are not evenly distributed),
   but we could put a data structure pointer in there as well, potentially.

Change-Id: I56ddb0b022a468dc04275075ed7e174b339c8ca4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8335
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2025-02-13 22:43:57 +00:00
Augustin Cavalier
b4508f498f libroot/posix: Import OpenBSD malloc source.
Exactly as-is. Modifications and integration will come in
the next commit.

Change-Id: I685483992d7f593fc46154ddea85a91798044faa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8973
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2025-02-13 22:43:57 +00:00
John Scipione
759dfd5ae3 Tracker: invert inactive select color so it is how it was
Change-Id: I5d79fc733496746bceb7003cb7d8a70555d87732
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8972
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58638
2025-02-13 02:02:59 +00:00
Augustin Cavalier
bf13ecf7cf registrar: Avoid cloning buffers when delivering messages in most cases.
If we succeed in sending the message on the first try, then we don't
need to allocate anything at all.

This two allocations and a memcpy in the fast path (which is
hit the vast majority of the time, it appears.)
hrev58637
2025-02-12 16:42:00 -05:00
Augustin Cavalier
ff808e1b64 registrar: Use BStackOrHeapArray in MessageDeliverer for flattened messages.
Saves unnecessary allocations (and reallocations).
2025-02-12 16:36:33 -05:00
Augustin Cavalier
0f4bfb43ed registrar: Style cleanup to MessageDeliverer.
No functional change.
2025-02-12 16:27:44 -05:00
Augustin Cavalier
0d23e179a6 BMessage: Allocate more temporary data on the stack if possible.
Some methods already did, but used a very large size of 16KB.
Reduce that to 4KB, do it in more places, and use BStackOrHeapArray
where possible.

Change-Id: Ia2d64582e76da6c1850e502107c07cb10bcd8226
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8969
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58636
2025-02-12 20:46:50 +00:00
Augustin Cavalier
dfdffe1ac6 BList: Allocate lazily.
Rather than allocating a block in the constructor, just wait to
do it until we actually need to add items to the list. This saves
over 200,000 allocations when running "pkgman search" alone.

Change-Id: Ia6a21b963efded2bb4973edc2ba22ff026e01737
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8630
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2025-02-12 20:46:50 +00:00
Augustin Cavalier
31343db0d3 tests/kernel/vm: Add checks for the end of the reservation to resize_area_tests. hrev58635 2025-02-11 18:57:36 -05:00
Augustin Cavalier
7ff241033f kernel/vm: Implement more cases of resizing with reservations.
* Handle resizing areas past a reservation, fixing a longstanding TODO.
   (The kernel address space implemenation still has the same TODO however.)

 * Handle resizing areas past or inside more than one reservation at once.

 * When an area shrinks, and it's touching/inside a reservation, expand
   the reservation downwards at least to its original size.

Add tests for all these behaviors (they're passing.)
hrev58634
2025-02-11 16:08:17 -05:00
Augustin Cavalier
8ff99b6ed7 kernel/vm: Drop check for RESERVED_AREA_ID in area_for.
These are actually not returned from VMAddressSpace, it seems.
2025-02-11 16:00:55 -05:00
Augustin Cavalier
7c2bd6bfcd docs/develop: Delete "How to Merge Patches from NetBSD Trunk".
This is now obsolete as the preferred merge strategy is just to
copy the whole directories and then reinstate the __HAIKU__
directives, same as for the FreeBSD network drivers and other
such code.
hrev58633
2025-02-11 00:30:49 -05:00
John Scipione
c78383f720 Tracker: Populate Tracker add-ons into main menu bar
This is used by some Tracker add-ons including TrackRunner and TrackGit.

Fixes #19386

Change-Id: I329eb9f1f8b2abf2872593d8f4417fa82de0b521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58632
2025-02-11 03:59:26 +00:00
Jérôme Duval
74e01ea162 BMenuField: SetLabel(): do nothing if current and new label are NULL
Change-Id: Ia4bb6f99d3b633a23a43624208e16cb7e4ae0399
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8940
Reviewed-by: X512 X512 <danger_mail@list.ru>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58631
2025-02-10 21:53:08 +00:00
Augustin Cavalier
218230135f XHCI: Adjust SMI disabling and only do it if the LEGSUP capability was found.
Otherwise we'll try to write to some random register at or past the end.

Adjust the bitmasks: rename XHCI_LEGCTLSTS_DISABLE_SMI to RESERVED_BITS
and define it in hex. Also add the "read-only" bits as a separate
declaration, and don't touch those either; then remove the setting
of the "events SMI" bits.
hrev58630
2025-02-10 15:30:04 -05:00
Augustin Cavalier
53fc5edad8 XHCI: Bail if we get all-1s from an EEC read.
It probably means it's invalid. OpenBSD does the same.
May help with #19407.
2025-02-10 15:30:04 -05:00
Augustin Cavalier
72a67f8d8a ACPI: Always use the loader-reported root pointer.
We always did under EFI but not under BIOS. Now, the BIOS loader
reports the root pointer as well, so we don't need to find it again.

Change-Id: Ie83adb53f098d44f2688a1a327c084f94afa2673
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8941
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58629
2025-02-10 20:18:51 +00:00
Jérôme Duval
46dd344bdd strace: Add tracing for rlimit syscalls.
Change-Id: I1e99622027f04fb93d00ebd94b45e05f7142fbec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8965
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58628
2025-02-10 20:17:28 +00:00
John Scipione
3953c0e7cd Tracker: Fix list icon click regression, Fixes #19414
Change-Id: I96d8995087bf8621ff580ad3b4ed54ae59786e32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8964
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58627
2025-02-10 20:16:08 +00:00
Augustin Cavalier
7c77e55210 runtime_loader: Invoke call_atexit_hooks_for_range for all regions.
This is necessary when the TEXT section is split.

At this point it may make more sense for libroot to register such
atexit hooks with runtime_loader rather than allocating them itself,
in line with the above comment's suggestion, but that can be investigated
some other time.
hrev58626
2025-02-10 12:27:40 -05:00
Augustin Cavalier
cd98a7e751 runtime_loader: Use find_loaded_image_by_address in another case. 2025-02-10 12:26:29 -05:00
Pascal Abresch
e911918d38 HaikuControlLook: Fix ArrowShape color for Scrollbar buttons
Previously this would simply tint the passed in background color.
After hrev58595 this was changed to pass the proper Foreground color instead.

The codepath to disable/enable the color was missed in an oversight,
this puts back the original tint color for the foreground aswell.

Fixes: #19406

Change-Id: I6f75d24316e8ca3ecdb78f11fc8dede88f082780
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8958
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58625
2025-02-10 16:51:27 +00:00
Pascal Abresch
b6987eac0c kits/tracker: TFilePanel:SwitchDirectory abort if file does not exist
Change-Id: Ie8c66f50b025d788c23e2c0f8837da66244fc4e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8960
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58624
2025-02-10 16:51:05 +00:00
Jérôme Duval
146617c29b runtime_loader: dlsym(RTLD_NEXT) searches all regions for the caller address
clang/lld can put code in multiple regions.

Change-Id: I495e3f12105ef2e894809da7e4a91bac08a12fd6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8961
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58623
2025-02-10 07:37:47 +00:00
John Scipione
7d6ff0554b Tracker: Fix one more artifact drawing issue
... related to Pose and TextWidget not exactly matching.

Change-Id: Ic9c3f2ecc9a9dc4af4c200bc5a16b9f46d72f9b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8954
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58622
2025-02-09 03:02:07 +00:00
John Scipione
c368793cd4 Tracker: Fixup drop context move to enabled status
regression from hrev58560.

Change-Id: Ic62292c2eb38e486cf18f0e4e9535ff6154b0c87
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8953
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2025-02-09 03:02:07 +00:00
John Scipione
2cf974a04e Tracker: Do not create symbolic link on same folder
Fixes #19403

Change-Id: Ib590822308b819d60715139c536d60e4e14c510f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8950
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58621
2025-02-08 22:37:07 +00:00
John Scipione
475412d382 Tracker: Fix minor underline issue from hrev58610
Change-Id: I80098f8bb10ab5eb1b8c39b5acb698ea0163bd85
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8949
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2025-02-08 22:37:07 +00:00
John Scipione
0464dc83d9 BMenuItem: Fix Alt+1 to switch to icon mode in Tracker
... by setting the incoming shortcut instead of the old one
in BMenuItem::SetShortcut().

Fixes #19405 a regression hrev58611.

Change-Id: Iecf19a323f6b6ead288e3f1ef1169376b11cddb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8948
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2025-02-08 22:37:07 +00:00
John Scipione
e4ef7b6075 Tracker: Redirect B_DELETE to BTextView if focused on one
Fixes #19404 a regression from hrev58560.

Change-Id: Iea6df69e04f5dccb8f91be506b5b7f85686c5eb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8947
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
hrev58620
2025-02-08 22:02:29 +00:00
John Scipione
a502215d78 BPopUpMenu: Adds Alt back to pop up windows
... by calling Install() on Go() in BPopUpMenu.

Install() prepares item shortcuts and set missing targets to the
target window. Combined with hrev58611 for regular menus this
passes most of the shortcut prep work on to BWindow.

Fixes pop up portion of #19395 a regression from hrev58589.

Change-Id: I8a1615502e0d6e0b75f9cd3ca2a45d08b53d11ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8946
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
hrev58619
2025-02-08 17:59:44 +00:00
John Scipione
f28ee3ec24 BPopUpMenu: style updates, update copyright year to 2025
... and style fixes. Add myself as author.

Change-Id: I213ba5e1dabf1cf15db86c307fb3484231947332
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8945
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
hrev58618
2025-02-08 16:08:30 +00:00
Autocomitter
220fa7be4f Update translations from Pootle hrev58617 2025-02-08 08:08:54 +00:00
William Johnson
03d5061185 Installer: Do not copy SSH host keys into target.
Fixes #19113.

Change-Id: I8e837ba236de44fb76a6668e297bb1a554e62b24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8944
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58616
2025-02-07 20:07:44 +00:00
Augustin Cavalier
a3d331623c kernel/vm: Use CObjectDeleter in vm_copy_area rather than a custom class.
No functional change intended.
hrev58615
2025-02-07 13:50:40 -05:00
Augustin Cavalier
738615d678 kernel/file_cache: Use CObjectDeleter to unreserve pages.
There are error paths out of this method that may not have
properly unreserved pages, so use a CObjectDeleter so that
all possible cases are covered.
2025-02-07 13:50:19 -05:00