The GCC "cc1plus" binary is over 40MB, so pre-faulting at most 10MB
of it only helped so much. Now, we map 1 MB for every time the cache
has been faulted "in full". This should warm up quite rapidly during
compile jobs, and stabilize after that (with future faults mostly
being CoW.)
Only active (accessed+used) pages will get pre-mapped anyway, so if
on a long-running system the page daemon debuffs all the pages in a
cache, we would just iterate through all of them but not map any here.
If that overhead proves to be a problem in the future, we can optimize
for it then (probably by keeping track of how many pages are eligible
for pre-mapping in this way.)
This significantly reduces lock contention in compile jobs. Compiling
libroot with a generated directory on ramfs and -j4, best of 3 runs:
before:
real 0m43.017s
user 1m2.811s
sys 0m24.900s
after:
real 0m29.367s
user 1m0.321s
sys 0m13.373s
Change-Id: I441abf43803c8666cdc13c6d007bc04439698b0b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8874
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
This solves a TODO for reporting CoW counts in area_info, and paves
the way for adaptive handling of pre-faulting based on how many
faults a cache has handled.
Change-Id: I4ecd7cf46b794c51acac87184fef49ea5ce76743
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8873
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We don't really need to clear these buffers, as they're basically
always used with user_strlcpy or precisely sized buffers, so there
should be no risk of "leaking" information to userland.
Per subsequent discussions, switching to BString::SetToFormat which completely
eliminates the need for allocating a fixed buffer and will avoid truncation.
Change-Id: Ic2a803594877a0a6fb1bc4eba937268351e6f45c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8837
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
As of awk version 5.0.0 the regexp library used switched to GNULIB.
This means that using \" is no longer escaping the quotation mark but only
matching a literal backslash followed by a quotation mark.
Another project that dealt with the same warning is here:
https://github.com/soimort/translate-shell/issues/285
Change-Id: If465b5966e448591acdae9e764c22bc2fce79f5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8836
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Instead of creating and destroying kernel stack areas on every thread
creation and destruction, use the object_cache's constructor/destructor
hooks to create areas when cached objects are created, and reuse them.
This avoids the last major cause of kernel map flushing during compile
jobs, however it's not as much of a performance improvement as I'd hoped,
seeming to be within the realm of noise (within a VM anyway.) On systems
like VirtualBox where ICIs are much more expensive, it may be a bigger
performance boost.
* alignment, cookie, constructor, destructor are rarely used
(in fact constructors/destructors are never used at present.)
* Add flags argument, this is more commonly used.
This allows a lot of the invocations of create_object_cache_etc
to be changed to invocations of just create_object_cache, simplifying
the code significantly.
* Add a new flag (-B, or --get-brightness), that changes the output
from screen mode to screen output
* This new flag is affected by the -s (short output) option for use
in scripts
* The wording for -s is changed to reflect the fact that it now
affects the new flag
Change-Id: I81145f401952fc026673e05a5fc03d4e3352fd3c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8865
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
See #17265; adds speed and acceleration sliders, as well as a reverse
scroll option. Tested on a Dell XPS 15. Only affects touchpad prefs,
not mouse prefs
Also, fix issues where revert button wasn't being enabled sometimes
when it should have been.
Also, switch to using a BMessage to store touchpad settings in their
file.
(a previous version of this patch added only the scroll setting)
Change-Id: I4d5ed3fadfd5bae1f7b686c904959f6e168b84a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8756
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Live updating menu classes listen for B_MODIFIERS_CHANGED
messages and update the item label and shortcut on Shift
or Control.
-- File --
Create link => Create relative link
Move to Trash => Delete
Cut => Cut more
Copy => Copy more
Paste => Paste links
Identify => Force identify
-- Window --
Close => Close all
Open parent enable/disable on Control to open root window
-- Window => Arrange by/Desktop --
Clean up => Clean up all
Create TLiveMenu and TLivePopUpMenu classes that inherit from
BMenu and BPopUpMenu respectively.
Create TLiveFileMenu, TLivePosePopUpMenu, TLiveWindowMenu and
TLiveWindowPopUpMenu subclasses for the File and Window menu
and context menus respectively.
Create TLiveMixin to share methods between menus. Pass in parent
window and use window shortcuts to enable/disable "Open parent".
Change-Id: I5dfbd4d468fad02894f1f31aa08d1abf630a4b5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2293
Reviewed-by: John Scipione <jscipione@gmail.com>
This yields the volume context menu on the Disks icon. Grab root
(Disks) icon before getting volume icon so Disks doesn't get the
generic volume icon. Don't add free space bar to Disks.
Add Mount menu to the Disks File menu and context menu. Mount
settings option has been removed as you can get to it from inside
the Mount menu instead.
SetupMountMenu() method is used to insert the Mount menu similar
to SetupOpenWith() and SetupNavMenus(). Add DetachMountMenu()
convenience method.
Fixes #5584
Change-Id: Ic9e272807a0a36b89cba7258b9937b09b2da32dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7151
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Create TShortcuts class that builds shortcut menu items and updates
label, modifiers, enabled status and target. Not every Tracker
shortcut is present but ones used multiple times and many others are.
Update shortcuts in ContainerWindow, DeskWindow, FilePanelPriv,
QueryContainerWindow, VirtualDirectoryWindow and GetInfo HeaderView.
There are two versions of the TShortcuts class, one with a window and
one without. The without-window version is used in the GetInfo window,
everywhere else uses the "smart" window version.
This patch is organizational except fixing two small BeOS bugs:
* Edit query item is always between Open and Open with...
* Repopulate menus when you switch directories in file panels.
Enable "Open parent" item in spatial mode as well as navigation
mode unless in Root, Desktop (Query or Query template) or volume root
if not in "Show disks" mode. Hold down control to override.
BContainerWindow updates:
* Absorb Set...Item() methods into TShortcuts. Add
UpdateMoveToTrashItem() for "Move to Trash"/"Delete" and many more.
* Absorb ShowContextMenu() improvements from Disks patch.
* Create AddIconSizeMenu() and eliminate duplicate shortcut handling.
* Put icon size menu in radio mode and refactor item marking.
Replace "New folder" with "New >" menu automatically. Create member
vars and convenience methods to facilitate this. Simplifies building
menus, adding a "New folder" item will automatically be updated to
"New >" if templates are available (except in FilePanel and on the
minimal build you'll just get "New folder").
Refactor Arrange by and Attributes menus. Create support methods.
Create menu on add, populate on update. Do cleanup of detached menu
on Quit().
Refactor SetupOpenWithMenu(). SetupEditQueryItem() got a similar
refactor to be added and removed dynamically. Add FSIsQueriesDir()
to FSUtils used to detect queries directory for Edit query.
* "Edit query" goes between Open and "Open with..." (long story).
UpdateMenu() calls Shortcut()->Update() for all known shortcuts.
Optimize adding/removing dynamic menus so that they are created
and destroyed once and reused again and again.
AddFile...(), fFile... and "FileContext" becomes
UpdatePose...(), fPose... and "PoseContext".
TTracker changes:
* Skip Desktop in OpenContainerWindow() we setup pose view earlier.
* Move DeskWindow init into DeskWindow constructor and call Init().
DeskWindow changes:
* Replace icon size menu with BContainerWindow::AddIconSizeMenu().
* Remove WindowContextMenu(), handle in BContainerWindow instead.
BPoseView changes:
* Rename kEditItem to kEditName -- better name. Save for Edit someday.
* Use BMessenger::SendMessage() instead of PostMessage(), safer.
BFilePanel updates:
Create the FilePanel menus fresh by overriding the AddMenus() method
instead of copying from BContainerWindow and deleting the items it
doesn't need. This allows us to omit most of the file panel checks.
Add UpdateFileMenu() to update the file menu on RepopulateMenus() and
MenusBeginning().
* Create an AddFavoritesMenu() method and use it to add the menu.
* Override RepopulateMenus() to update just the File and context menus.
* Create Update...Methods() overloading the BContainerWindow versions.
* SetTo() becomes SwitchDirectory()
Unify OpenParent() so that we can call BPoseView::OpenParent() and it
will call the container window or the file panel where appropriate.
Remove BPoseView::ParentIsRoot() and make CanOpenParent() work in both
cases. This means we don't have to check if you are in a file panel or
not when enabling/disabling the "Open parent" item and the Shortcuts
class can simply check CanOpenParent().
Call _inherited SwitchDirectory() to RepopulateMenus() on Root, Trash
and Volumes in FilePanel. This fixes a 25+ year old BeOS bug by
repopulating menus when you switch directories in file panels. Trash,
files in Trash and Root will get the appropriate menu options. For
example "Delete"/"Restore" instead of "Duplicate"/"Move to Trash".
Change-Id: Ic41b148cb6bcf14288cb5588038c13ea12426dc2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7197
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
"Show in Tracker" opens and selects a bookmark in Tracker. Useful
if "Rename" isn't good enough, when you need to edit the URL, Title,
or Keywords attributes.
Fixes a crash when trying to "Rename" a folder. Folders were added
without a message before, so trying to access them to FindRef() lead
to a crash.
Folders are now added with a message kFolderMsg which is also used
to identify them as folders (instead of checking if their message
is NULL as before).
It's not uncommon to have symlinks in the Bookmark bar. We now don't
traverse those to their origin when renaming or deleting, so only
the files in the "Bookmark bar" folder are affected, not the original
files.
Only when adding an item, we traverse a symlink for its icon.
Change-Id: I3f420995cf5c12930a1cf3a00bb4257d19c4d5a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8772
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
On some optimization levels we get warnings/errors about it being
potentially uninitialized (but not at -O2, hence this wasn't a
problem in nightly builds.)
The documentation comment says that only "caches starting from the top
cache to at least the cache the page lives in" are guaranteed to be locked.
So it should be safe to unlock all the lower caches that we didn't find
the page in here, and leave only the topmost cache locked, to reduce
contention.
(We can't do this in the CoW case, since there we may have to unmap
the read-only page when mapping in the new read-write page. But for
clean pages, since no lower cache had the page in question, we shouldn't
have anything mapped at all, and thus unlocking the lower caches ought
to be safe.)
We now will find its image struct using the standard iteration,
so just check for its address specifically.
Fixes commpage symbols printing in KDL after the recent refactor.
We insert pages from all over the underlying disk's area,
so in order to not trip asserts, the cache must be that large too.
(It's a "null" cache, so it doesn't have any commitment.)
Fixes #19373.
It checks whether the page or page's data is present in an underlying
"backing store", not whether the page is present in the cache itself.
No functional change intended.
The previous logic, which dates back to the NewOS kernel, inserted them
into the deepest cache instead if the fault was a read and not a write.
But this creates problems if the deepest cache is of a smaller size than
the topmost cache, because then we'll be inserting pages with offsets
past the cache's virtual_end. In the case there are multiple levels of
caches between the topmost and the deepest cache which all are smaller
than the topmost, then when/if the deepest cache is merged with the second-
deepest cache, those pages will get skipped and freed when they may still
be in-use, which was the cause of #19367.
To solve this, just insert new pages into the topmost cache always.
Inserting them into the deepest cache seems to have been an optimization
(and a savings of pages), and not a matter of correctness.
Move ColorListView and ColorItem to shared in BPrivate namespace.
ColorItem typedef to BPrivate::BColorItem for apps that are already
using this class.
Gravity screensaver:
* ColorItem => BColorItem.
* Use make_color() to set colors.
Make color drop message name agnostic, check for B_RGB_COLOR_TYPE.
Add be:sender and source to drag message.
Add _SetTermColors() convenience method to set colors on all tabs.
Change-Id: I5a9f55d3ab423ccaa341997cf444603373024553
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8846
Reviewed-by: John Scipione <jscipione@gmail.com>