Commit Graph

60031 Commits

Author SHA1 Message Date
Jérôme Duval
38ce902686 posix: add posix_fadvise(), only error checks.
should help for ports.

Change-Id: Id504bdb79cb68db4b615f58848e0e1a86ced8d2b
Reviewed-on: https://review.haiku-os.org/c/1467
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-21 15:07:43 +00:00
Adrien Destugues
66cb2efaa8 Move StripeView to libshared
Change-Id: Ib8ff2f731f9d34e04854f1c2ec288a3db1036793
Reviewed-on: https://review.haiku-os.org/c/1458
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-05-21 06:55:45 +00:00
Adrien Destugues
33fc4f4063 Revert "debug_server: Remove the "Write core file" button."
This reverts commit 02079c66f3.

Change-Id: I95a4bbef67e2a982da49a18105a4cbd85c4e11e9
Reviewed-on: https://review.haiku-os.org/c/1457
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-05-21 06:55:45 +00:00
Augustin Cavalier
d906fe3cc7 freebsd_network: Allocate a new root device for every attach.
This also means that when attach fails, we destroy the root device.
This should fix stale root devices getting left around when attach
fails.

Probably helps with or even outright fixes #15016.
2019-05-20 11:51:44 -04:00
Augustin Cavalier
6d880c9085 SerialConnect: Fix build on 64-bit. 2019-05-20 11:05:46 -04:00
Jérôme Duval
3802df804f pthread_key: set value planned for destruction to NULL.
* This fixes bug fix #10951.

Change-Id: I152cea3651b3307171ea4d6a0c49aceae2f0f797
Reviewed-on: https://review.haiku-os.org/c/1456
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-05-20 14:09:15 +00:00
Augustin Cavalier
33f7f28798 kernel & runtime_loader: Don't load from non-packaged when "Disable user
add-ons" is set.

Confirmed to fix #14361. It is finally possible to un-brick an install
with a bad system library in non-packaged without having to use another
install to do so.

Change-Id: Iafea7821f02cb34e77c766b1f97d1c19206b1081
Reviewed-on: https://review.haiku-os.org/c/1452
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-20 14:08:28 +00:00
Augustin Cavalier
69712d5c00 OS.h: Reorder includes alphabetically. 2019-05-19 12:37:14 -04:00
Adrien Destugues
d4b3a3277d SerialConnect: implement PopLine to get items from scrollback
Allows to make the scrollback visible again when resizing, instead of
adding blank lines at the bottom.

Change-Id: I7a14188cdcb14bcd197325b935d8cfe2435ae80f
Reviewed-on: https://review.haiku-os.org/c/1464
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-19 14:00:48 +00:00
Adrien Destugues
1eb386084c SerialConnect: add a clear/reset menu.
Change-Id: I0435ba679e19094d201d65ac0c6290cd194ec344
Reviewed-on: https://review.haiku-os.org/c/1463
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-19 13:46:19 +00:00
Adrien Destugues
506f9764d4 Some notes about openboot.
As I keep looking for the commands to do anything...

Next step is to figure out network booting and set up an easy way to
test haiku_loader.
2019-05-19 14:31:21 +02:00
Augustin Cavalier
ba390da3b4 libroot: Name mmap areas by the name of the image that allocated them.
This adds an average overhead of 10-15 us, which seems acceptable
(without the previous patch it adds 200-250 us, which is less so),
and it makes "listarea" output much more enlightening for applications
like app_server or WebKit which use a lot of them.

Change-Id: I48a4148e6e9fb0d1a8bbf67294deeafad9372f44
Reviewed-on: https://review.haiku-os.org/c/1462
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-18 18:09:43 +00:00
Augustin Cavalier
dee722ce4f runtime_loader: Optimize a special case of get_nearest_symbol.
If the caller does not want the symbol name/address/etc., we don't
need to spend the time finding it, and can just return after
finding the image.

Change-Id: I138f8bd4071ffc25738dac4d6c0c6d3fe25edf1c
Reviewed-on: https://review.haiku-os.org/c/1461
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-18 18:09:43 +00:00
Augustin Cavalier
44b903f97a rpmalloc: Disable ASLR for heap areas.
On 32-bit at least, our ASLR is too aggressive and fragments
the address space very quickly to the point where at 500MB (1/4)
usage, area insertion begins to fail.
2019-05-18 13:51:19 -04:00
Augustin Cavalier
fb683851b1 rpmalloc: Disable assert on failing to map memory.
We want applications to be able to handle out-of-memory
conditions gracefully, not just trigger an assert every time.
I disabled this before, looks like I missed it in the final
patch.
2019-05-17 16:35:58 -04:00
Augustin Cavalier
dd249016c2 USB: Check and set the Device object state appropriately.
The Device object gets an ID before it begins initializing, and
loses its ID after it fully finishes tearing down, so simply
verifying the Device object is non-NULL is not enough to verify
that we can use it. We need to call InitCheck() every time.

In Device itself, we should also unset fInitOK when beginning
teardown, so that anyone who still has a handle can no longer
use this Device object while teardown occurs (which, depending
on the number of pipes, pending transfers, etc. may take some
time.)

Fixes #14949 and almost certainly any other USB-related KDLs
in these codepaths.
2019-05-17 16:24:06 -04:00
Augustin Cavalier
f8fdf848d0 HTTPStreamer: Another build fix I forgot to commit.
Sorry for the noise...
2019-05-17 16:13:07 -04:00
Augustin Cavalier
5731cdeb5f media_client: Fix build after previous commit. 2019-05-17 16:03:35 -04:00
Augustin Cavalier
218a8c03cb Revert the Codec Kit.
All of Barrett's individual reverts have been squashed into this
one commit, save a few actual bugfixes.

Change-Id: Ib0a7d0a841d3ac40b1fca7372c58b7f9229bd1f0
2019-05-17 14:43:32 -04:00
Augustin Cavalier
086528f66a USB & XHCI: Refactor endpoint initialization to support SuperSpeed better.
SuperSpeed (USB3) devices have a "companion descriptor" along with the
endpoint descriptors that describes certain other attributes they have,
which are important for the controller to schedule transfers properly.
Previously we were just using USB2 values; now we are properly using USB3
ones.

Tested on an Intel Lynx Point controller. As far as I can tell, no
regressions, but #15000 is not fixed anyway.
2019-05-16 20:31:11 -04:00
Michael Lotz
c8836afc0a rpmalloc: Use create_area instead of mmap.
It has lower overhead and allows to name the areas so that they are
labeled as heap areas.

Note that we can still use munmap for releasing. It has the nicer
interface of using the base address and length which we already know
instead of needing the area id that would have to be queried with an
additional syscall.

Change-Id: I338c4043ecc2947b82b8fe9fd69a99ce3fa23138
2019-05-16 16:04:34 -04:00
Michael Lotz
8ccd1402bf rpmalloc: Port to native TLS.
The native TLS has just a little less overhead which quickly adds up in
heavy use.

Change-Id: I6223dfdc0f9298952fdde5eb47d5112bc7887653
2019-05-16 16:04:34 -04:00
Augustin Cavalier
7132b79eaf rpmalloc: Import and set as default.
Hoard, the LGPL-licensed locking thread-caching allocator that we have
used by default since libroot's introduction, is showing its age.
It is a "pseudo-sbrk-based" allocator (it predates our actual sbrk,
so instead it uses a single Be area), which has serious limitations:
as we cannot ever move the area, we can only resize it "in place",
and so once we hit the end of the ~1.5GB reserved part of the address
space for the heap, we are usually out of luck if we need more memory.

On 32-bit userspace has only 2GB of address space anyway, but on
64-bit where address space is not a resource worth worrying about,
this can be a serious problem for applications that want to use a
lot of RAM. As more and more large applications get ported to Haiku,
the time for a mmap-based allocator has come.

For posterity's sake, here are all the possible options there were,
and why this one was selected rather than one of them, beginning
with the immediate rejects:

 * nedmalloc. Unmaintained since 2014 and all benchmarks show it
   underperforming vs. virtually all other allocators.
 * bmalloc. Significantly worse-performing vs. other options on
   this list with no apparent advantages.
 * hoard3. Now GPL only, which is obviously not acceptable for
   use as a system library.
 * ptmalloc2. glibc's default allocator; underperforms vs.
   even most of the above-listeds.

And now on to the honorable mentions:

 * tcmalloc. This is Google's allocator; it's designed for server
   and other high-performance workloads. As a result, it almost
   never unmaps memory unless ordered to do so in a very explicit
   way, which obviously is unacceptable behavior for a general-purpose
   allocator.

 * jemalloc. This is FreeBSD and NetBSD's default allocator as well
   as finding use in Firefox and Rust. It is again designed for
   performance, with significantly higher memory overhead than
   other allocators, especially for small heaps; which is of course
   a problem for us, as we want to retain our light footprint.

Finally this brings us to rpmalloc. It's not as well-travelled as
tcmalloc or jemalloc, but by benchmarks done by itself [0] and
by developers of other allocators [1], it seems to typically hit
the "sweet spot" of very good performance with lower (if not the lowest)
memory use out of all the other allocators it's tested against;
even beating jemalloc in certain benchmarks for speed, too.

You can see a description of the allocator's design in its README [2].

[0]: https://github.com/rampantpixels/rpmalloc/blob/master/BENCHMARKS.md
[1]: https://github.com/ezrosent/allocators-rs/blob/master/info/elfmalloc-performance.md
[2]: https://github.com/rampantpixels/rpmalloc#rpmalloc---rampant-pixels-memory-allocator

In general testing thus far on Haiku, it appears to be a consistent
5-10% performance boost (1m28s real -> 1m23s real) when doing
the "HaikuDepot compile" benchmark. Memory usage by most apps
after a cold boot changed negligibly (launch_daemon: 444K -> 476K,
app_server: 15.86MB -> 15.49MB, Tracker: 6.19MB -> 4.49MB.)

The only adverse affect I have observed so far is that a certain few
WebKit double-frees cause crashes/asserts faster than they did before
(e.g. Google Maps crashes after less than a minute instead of a few
minutes.)

That being said, any new or strange behaviors, please report
immediately. Backing out this change should be as easy as
reverting the changes to the libroot/posix Jamfile. If nothing
else comes up in a few weeks, then I'll remove Hoard from
the repository.

Fixes #13554.

Change-Id: Id2871601b1e99dcf022fbef2c53008ee6c3f233b
2019-05-16 16:04:33 -04:00
Augustin Cavalier
c5f96e5b4a net80211: Merge a memory leak fix from FreeBSD. 2019-05-16 15:11:01 -04:00
Calvin Hill
6ee7bb4f7b cpu_type.h: Allow cpu_type functions to be accessible from C.
This allows cpu_type.h to be used in C-based software,
with the get_cpu_*() functions all accessible via C as well
as C++ code.

Tested changes with sysinfo, AboutHaiku and Pulse.

Change-Id: Ide87d8e3f2ba5f0f1890f385b1ac90c677bcc274
Reviewed-on: https://review.haiku-os.org/c/1453
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-16 17:07:38 +00:00
Augustin Cavalier
49f507c4b5 XHCI: Remove unused parameter to ConfigureEndpoint.
No functional change intended.
2019-05-15 18:11:13 -04:00
Augustin Cavalier
ec5b988026 packagefs: Use more descriptive error codes on failing activations. 2019-05-15 16:18:36 -04:00
Augustin Cavalier
f6f19105dc package_daemon: Actually return transaction errors instead of OK always.
This "fixes" #10959, though now the varying potential causes of that
will now print actual errors earlier instead of the error message
in that ticket.
2019-05-15 16:18:35 -04:00
Andrew Lindesay
f85e030047 HaikuDepot: Load Languages from HDS
The HaikuDepot application has, thus far had its
own hard-coded list of languages that the user is
able to choose when (a) creating a new account or
(b) creating a user-rating.  This change will mean
that those languages are loaded from the HDS
server dynamically and in this way the user can
choose from the full list.  There have also been
improvements to the way in which the languages are
displayed in the menu as well.

Change-Id: If7cb7b87f348ca59d503d276a22444e72d0e6168
Reviewed-on: https://review.haiku-os.org/c/1425
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-15 19:03:48 +00:00
Augustin Cavalier
9fe74faa61 HaikuPorts: Bump python, openssh, git for ncurses6. 2019-05-15 13:31:45 -04:00
Augustin Cavalier
f7072b7d5a hardlink_packages: Fix arguments check.
Thanks Jessica for the review!
2019-05-15 13:19:34 -04:00
Augustin Cavalier
8e05933bc8 HaikuPorts: Add libopenmpt_x86 on x86_gcc2. 2019-05-14 22:43:57 -04:00
Augustin Cavalier
4bca5362cd hardlink_packages: Use subprocess instead of os to check for package_repo. 2019-05-14 22:43:25 -04:00
Alexander von Gluck IV
aefa412c98 ppc: Minor tweaks to move PowerPC build towards working
Change-Id: Id9a4e0fd483d2a0c05cf2a8475d3689a13bcc5f6
2019-05-14 21:13:58 -05:00
Augustin Cavalier
0f916d6641 tools/hardlink_packages: Check that the package_repo command exists. 2019-05-14 22:04:56 -04:00
Augustin Cavalier
54e53dabfc HaikuPorts: Add openmpt for x86_64. 2019-05-14 21:42:42 -04:00
Augustin Cavalier
fc985c6121 HaikuPorts: Add llvm7_x86_libs for x86_gcc2. 2019-05-14 21:39:08 -04:00
Augustin Cavalier
92ca8543cd kernel/lib: Add another new file for zstd. 2019-05-14 20:47:20 -04:00
Augustin Cavalier
0feba5ebec kernel/lib: Add new file for zstd. 2019-05-14 20:19:29 -04:00
Augustin Cavalier
77d551c2f1 Jamfile: gutenprint -> gutenprint8. 2019-05-14 19:32:29 -04:00
Jérôme Duval
89f1fd6512 Bump gutenprint version.
needs gutenprint8 packages to be uploaded.

Change-Id: I1204ff8b1bb85cc0eb615082b205280daabbc290
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2019-05-14 19:11:41 -04:00
Augustin Cavalier
f95a6bc18a HaikuPorts: Synchronize packages; add libpsl and gutenprint8. 2019-05-14 19:03:02 -04:00
Augustin Cavalier
e661fdd17d repositories: Move the README into the appropriate docs/develop directory. 2019-05-14 19:00:18 -04:00
Jérôme Duval
df0ba1eca1 vfs: _user_ioctl: any buffer value is allowed for some ops.
some ops want an integer value instead of a pointer as arg parameter ( #15058 ).

http://pubs.opengroup.org/onlinepubs/9699919799/functions/ioctl.html clearly specifies that:
"The type of arg depends upon the particular control request, but it shall be either an
integer or a pointer to a device-specific data structure."

add a test for functions which should return ENOTTY as errno.

Change-Id: I4a98af73b17c79c3460123d3794ee866f8719898
Reviewed-on: https://review.haiku-os.org/c/1447
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-14 16:12:31 +00:00
Augustin Cavalier
32cbf55317 freebsd_network: Fix logic inversion introduced in the last change.
Thanks to Stephan for noticing!
2019-05-14 12:03:00 -04:00
Jeroen Oortwijn
72f7f7d976 USB_hid.h: Add Report Type constants
From "Device Class Definition for Human Interface Devices (HID)
Ver. 1.11", par. 7.2.1, page 51.

Change-Id: I4628f8ca940758aaf4a09290e9fa407d30374e7a
Reviewed-on: https://review.haiku-os.org/c/1450
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-14 07:24:09 +00:00
Jeroen Oortwijn
419190fdc2 usb_hid: Use In Range data instead of state
According to the HID Usage Tables document (Hut1_12.pdf), the In Range
usage is a Momentary Control (MC) (par. 16.3.1). A MC has a Logical
Minimum of 0 and a Logical Maximum of 1 (par. 3.4.1.3).

As the In Range usage is a bit quantity, the value can't be outside
the Logical Minimum and Maximum and therefore can't be in an invalid
state.

Now the inRange boolean value properly changes.
The pointer still moves to the upper left corner when the pen is out
of range, though. Maybe the input_server add-on doesn't use this value?

Change-Id: Idf511ac237158e90eb2e8f01422757655a7eea3a
Reviewed-on: https://review.haiku-os.org/c/1449
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-05-14 07:24:09 +00:00
Jeroen Oortwijn
7625dca0e9 input_server/tablet: Only send event messages when pen is in range.
When the pen is moved out of range, the Wacom tablet sends one last
message with all values set to 0 and the In Range value set to false.
Don't send mouse event messages in this case.

Change-Id: I419d57cede47a6ef40a160322f3025ef372ecaa3
Reviewed-on: https://review.haiku-os.org/c/1448
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-05-14 07:24:09 +00:00
Augustin Cavalier
45c3eb3a3c pkgman: Split "interactive" and "show progress" logic.
Previously we didn't show progress in non-interactive mode. Now
we do, so long as stdout is a TTY.

Fixes #14603.
2019-05-13 19:32:30 -04:00
Augustin Cavalier
7115cef989 Jamrules: Include the UserBuildConfig before processing repositories.
Repository processing triggers HAIKU_REVISION computation, and it
is intended that the UserBuildConfig can override or set HAIKU_REVISION.

Fixes #14834.
2019-05-13 19:21:48 -04:00