Commit Graph

47998 Commits

Author SHA1 Message Date
Pawel Dziepak
f256b4aca7 kernel: Use SimpleRunQueue as run queue type everywhere 2013-10-09 01:20:40 +02:00
Pawel Dziepak
0896565a6e kernel: Support sched_yield() properly
sched_yield() should not yield to the threads with lower priority.
2013-10-09 01:18:55 +02:00
Pawel Dziepak
ee69e53630 kernel: Minor improvements, separate priority and yield logic 2013-10-08 21:36:49 +02:00
Pawel Dziepak
9363e99b19 kernel: Remove Thread::next_priority 2013-10-08 20:21:35 +02:00
Pawel Dziepak
346e789a21 kernel: Fix style issues 2013-10-08 20:15:21 +02:00
Pawel Dziepak
94f4574d78 kernel: Move thread retrieving code to separate function 2013-10-08 20:13:10 +02:00
Pawel Dziepak
03e3a82953 kernel: Allow threads to yield CPU properly 2013-10-08 06:41:20 +02:00
Pawel Dziepak
bab69bdb47 kernel: Force high priority threads to yield less often 2013-10-08 04:53:30 +02:00
Pawel Dziepak
547b8c76c7 kernel: Cancel penalty only if the thread actually waits
Require the thread to give up CPU for at least one time slice before
cancelling its penalty.
2013-10-08 04:50:23 +02:00
Pawel Dziepak
21808e8f0b kernel: Limit maximum priority penalty
The maximum penalty the thread can receive is now limited depending on
the real thread priority. However, since it make it possible to starve
threads with priority lower than that limit. To prevent that threads
that have already earned the maximum penalty are periodically forced
to yield CPU to all other threads.
2013-10-08 02:54:58 +02:00
Pawel Dziepak
4cba4ff1df kernel/util: Use private/kernel/debug.h 2013-10-08 01:36:30 +02:00
Pawel Dziepak
31e65090db kernel: Use standard compliant version of variadic macros 2013-10-08 01:34:55 +02:00
Pawel Dziepak
e083bca041 kernel: Allow threads to always finish their time slice
Until now, when the thread has been preempted by higher priority
thread it was then placed at the end of its priority FIFO and given
a new time slice. This patch changes it allowing the thread to
complete its time slice (when the higher priority threads are done),
unless there was very little time left in which case this time is added
to the next time slice.

Apart from making the algorithm more fair this change allows to identify
CPU bound threads more easily. (Earlier they could 'hide' by being
preempted by higher priority thread and consequently never using
their whole time slice).
2013-10-08 01:08:05 +02:00
Pawel Dziepak
565e7a977d kernel: Update SchedulerTracing::EnqueueThread 2013-10-07 21:52:45 +02:00
Pawel Dziepak
72f844835e kernel: Do not require double parentheses in TRACE statements. 2013-10-07 21:29:10 +02:00
Pawel Dziepak
82c26e1f1f kernel: Punish CPU bound threads
This patch appears to fix #8007.

Thread that consume its whole quantum has its priority reduced. The penalty
is cancelled when the thread voluntarily gives up CPU. Real-time threads
are not affected.

The problem of thread starvation is not solved completely. The worst case
latency is still unbounded (even in systems with bounded number of threads).
When a middle priority thread is constantly preempted by high priority
threads it would not earn the penalty, thus the lower priority threads
still can be starved. Moreover, the punishment is probably too aggressive
as it reduces priority of virtually all CPU bound threads to 1.
2013-10-07 21:11:32 +02:00
Pawel Dziepak
6d7e291233 kernel: Allow scheduler initialization to fail 2013-10-05 20:45:07 +02:00
Pawel Dziepak
9ad558f01c kernel: Use the new runqueue in non-MP scheduler 2013-10-05 20:22:59 +02:00
Pawel Dziepak
b8c1df9b00 kernel: Add O(1) lookup and insertion priority queue 2013-10-05 20:16:06 +02:00
Pawel Dziepak
7039b950fb x86[_64]: Fix style issues 2013-10-05 18:03:00 +02:00
Pawel Dziepak
149c82a8ec kernel/util: Add bitmap implementation 2013-10-03 04:27:49 +02:00
Pawel Dziepak
7087b865e2 x86[_64]: Remove superfluous memset()s 2013-10-03 04:26:21 +02:00
Pawel Dziepak
36cc64a9b3 x86[_64]: Add CPU cache topology detection for AMD and Intel CPUs 2013-10-02 23:48:03 +02:00
Pawel Dziepak
1f50d09018 kernel/util: Add bit hack utilities 2013-10-02 21:24:46 +02:00
Pawel Dziepak
26c3861891 x86[_64]: Fix some style issues 2013-10-02 21:18:56 +02:00
Pawel Dziepak
fa6f78aee7 x86[_64]: Use uint32 for maximum CPUID leaf number 2013-10-02 21:03:34 +02:00
Pawel Dziepak
c9b6f27d94 x86[_64]: Add CPU topology detection for AMD processors 2013-10-02 02:34:35 +02:00
Pawel Dziepak
f1644d9d0b x86[_64]: Set level shift by counting bits in mask 2013-10-02 01:55:07 +02:00
Pawel Dziepak
fafeda52ea x86[_64]: Do not return too soon from detectCPUTopology() 2013-10-02 01:49:10 +02:00
Pawel Dziepak
8ec897323e x86[_64]: Add CPU topology detection for Intel processors 2013-10-02 01:19:17 +02:00
Pawel Dziepak
4110b730db x86[_64]: Add support for CPUID sub-leaves
Some CPUID leaves may contain one or more sub-leaves accessed by setting
ECX to an appropriate value.
2013-10-01 20:31:18 +02:00
Pawel Dziepak
c48c3f88a9 build: Reenable debug mode for tarfs 2013-10-01 19:32:51 +02:00
Pawel Dziepak
ffd5393620 kernel/util: Make exit() available in bootloader as well 2013-10-01 19:31:48 +02:00
Adrien Destugues
94bf728825 Add more keywords, variables and functions 2013-10-01 18:54:59 +02:00
Adrien Destugues
7650931572 Rename parameters to avoid compile error
* warning: declaration of `signal' shadows global declaration
2013-10-01 17:17:28 +02:00
Adrien Destugues
37343ca1f6 Remove which command from default image
* This was a script relying on a working /etc/profile, which may not be
there
 * Instead, use GNU which, available as an haikuport recipe
 * Since the command does not seem to be needed for Haiku to run (and
also because I don't know how to do it), GNU which isn't in the default
 install.
 * Typing "which" in a terminal still works, as that uses an alias
defined directly in /etc/profile.
2013-10-01 16:32:21 +02:00
Pawel Dziepak
7aecb0b276 kernel/util: Make exit() available in kernel mode
Since we are using libraries originally intendent for user mode in kernel
mode providing them with some userland functions is inevitable. This
particular patch is to make zlib happy and able to call exit() when
its debug assertions fails.
2013-10-01 15:51:07 +02:00
Pawel Dziepak
d06885888d kits/support: Skip debug check in boot loader 2013-10-01 15:47:53 +02:00
Pawel Dziepak
1238bebddc build: Add stub _get_thread_info() needed by support/Referenceable.cpp
This is a step towards fixing #10042.

When DEBUG is set BReferenceable::~BReferenceable() performs some checks
ensuring that the object is destroyed correctly. These checks require
information on thread stack, which is obtained by get_thread_info().

_get_thread_info() stub is added (actually, readded) which always returns
B_ERROR. Moreover, the check in BReferenceable destructor is modified
so that it does not fail when get_thread_info() fails.
2013-10-01 15:06:17 +02:00
Julian Harnath
d46d383800 usb_disk: retry when usb disk not ready
* Resolves #10043
* Fixes a non-booting issue due to hrev46099
2013-09-30 22:32:48 -05:00
Alexander von Gluck IV
df0a1762ab usb_disk: fix line endings; no functional change
* Occurred in hrev46099
* Line endings dos2unix
* Remove extra lines at end of file
* Jerome! Get a better text editor :-)
2013-09-30 22:32:47 -05:00
Rene Gollent
88cd0fd25b HaikuDepot: improve progress tracking.
- PackageManager: Adjust progress listener interface to also supply
  the package name to the hook. Adjust implementors.

- PackageActions now get a pointer to the model. InstallPackageAction
  uses that to resolve the package name given in the download progress hook
  to the package currently being downloaded, and updates progress accordingly.
  Consequently, if one requests installation of a package that has dependencies,
  Depot now correctly updates the download progress status of those
  accordingly, rather than updating the original package repeatedly.
2013-09-30 23:07:45 -04:00
François Revol
8bf87f9341 Actually fix the build
Looks like I was too quick on previous commit.

It seems -pthread is actually not that much needed on Linux though...
although the manpage says "compile and link with -pthread". Go figure.

Now dlopen() uses RTLD_LAZY | RTLD_LOCAL for Linux, which seems
to work here.
2013-10-01 03:57:24 +02:00
François Revol
4135f9cde3 Fix build
Declare a HOST_PTHREAD_LINKFLAGS variable to hold the flags
required to link with pthreads, and use it for the solver addon.

Works on GNU/Linux, please test and fix for other platforms.
2013-10-01 02:37:54 +02:00
Oliver Tappe
bbecca8c24 Update libsolv and zlib packages for consolidation.
* only the source package are actually relevant, as the source paths
  within older versions of those source packages no longer match the
  expectations of the build system
2013-10-01 01:00:03 +02:00
Oliver Tappe
ec5bf7bdf8 Adjust paths in source packages to what haikuporter produces. 2013-10-01 01:00:02 +02:00
Ingo Weinhold
5fd3766e03 libroot_build: fs_darwin: fdopendir(): close FD on success
fdopendir() is supposed to consume the specified FD on success.
2013-09-30 21:41:56 +02:00
Niels Sascha Reedijk
f04f7042c5 Determine how to invoke sed with extended regexp
This will require re-running configure
2013-09-30 21:41:54 +02:00
Niels Sascha Reedijk
a69102a1f3 Add HOST_LIBSUPC++ to fix compilation on MacOS X 2013-09-30 21:41:50 +02:00
Niels Sascha Reedijk
57405de578 Always use dlopen and dlsym to load libsolv
Previous implementation used weak symbols on all platforms except Haiku. Mac OS X also does not support this use of weak symbols. In the discussion of #10028 it was decided that probably more platforms will have problems with this approach, so instead use the approach that always works.
2013-09-30 21:41:45 +02:00