Commit Graph

986 Commits

Author SHA1 Message Date
Marcus Overhagen
3d65babaa6 restore previous serial debug output setting when leaving kernel debugger
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20955 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-01 18:13:01 +00:00
Marcus Overhagen
cafc95e0af Make no-settings-file defaults match the empty-settings-file defaults.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20950 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-01 13:00:33 +00:00
Hugo Santos
8cfe0be38e slab/cache: a couple more fixes.
- on CACHE_DURING_BOOT init benaphore count with 1.
 - account for allocated space on early_allocate_pages.
 - fixed slab position calculation in small slabs.
 - we can now init all allocator sizes early rather than later.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-30 01:08:05 +00:00
Hugo Santos
698b6d7195 cache/slab: when CACHE_DURING_BOOT is specified, use vm_allocate_early to obtain pages for slabs, and create the associated areas on post bootup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 22:58:46 +00:00
Hugo Santos
39af445966 added object_cache_reserve to allow cache users to pre-allocate slabs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 21:45:23 +00:00
Hugo Santos
11debaf6e4 added CACHE_UNLOCKED_PAGES flag to allow caches' pages to be created with no locking instead of full locking.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 20:55:44 +00:00
Marcus Overhagen
d995743822 Enabled syslog debug output by default, added new syslog options to config file.
Reversed arguments in kernel settings file, now you only need to uncomment a line
to get the non-default setting. Explained default setting in comments.     


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 17:22:08 +00:00
Hugo Santos
14342a6767 cache allocator: keep allocation waste statistics. added debugger command 'show_waste'.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 15:28:31 +00:00
Hugo Santos
c49aa60ace cache allocator: for allocations > 8k create areas, and delete them on free.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 15:13:09 +00:00
Hugo Santos
0be6e97788 minimal cleanups
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 13:11:30 +00:00
Hugo Santos
9a9cba598a don't need TRACE_SLAB by default now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 03:41:10 +00:00
Hugo Santos
172b3066aa fixed the cache allocator's size_to_cache.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 03:33:51 +00:00
Hugo Santos
6bad493439 pushed the slab init a bit deeper. added a object cache based allocator, including a bootstrap mechanism to have it init during bootup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-29 02:23:37 +00:00
Hugo Santos
6e31ae98f9 some object cache / slab improvements.
- call the reclaimer callback when low on memory.
 - use the depot when on multi-cpu setups (for scalability).
 - fixed the amount of memory spent on slabs for very large objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-28 21:35:23 +00:00
Hugo Santos
11b5020f2f rewrote the object cache (slab) implementation a bit, preparing for further integration.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-28 18:53:58 +00:00
Hugo Santos
8a96ba39e3 some slab cleanups, split the C interface to another file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-28 09:37:38 +00:00
Ingo Weinhold
87ac9f1d46 Fixed boot loader BFS build which I broke with my recent changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20861 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-27 14:31:18 +00:00
Ingo Weinhold
5b1cb74b86 Even more correct return value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-27 10:47:21 +00:00
Ingo Weinhold
93ed453113 More correct return value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-27 10:45:57 +00:00
Hugo Santos
0cd08b100c ups, TRACE_SLAB was on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20852 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-27 08:07:30 +00:00
Hugo Santos
5d6551d69f removed some of the slab's initial heavy debugging. we now merge the links into the slab itself resulting in zero overhead per buffer with MergedLink strategy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 15:40:53 +00:00
Hugo Santos
d7ae189ecf slab: be smarter when picking the underlying strategy for the slab C API (based on requested object size).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 12:21:38 +00:00
Hugo Santos
e6fb3d3947 more slab fixes, also introduced a new strategy optimized for medium sized buffers (64 >= x < 512) with lengths other than power of 2 (has an overhead of 2 words per buffer).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 11:38:24 +00:00
Hugo Santos
dd89ad0e7e added locking to slab's Cache<>. Now we react to system's low memory conditions freeing up empty slabs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 07:31:19 +00:00
Hugo Santos
81bc570922 assorted slab fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 06:05:08 +00:00
Hugo Santos
81423c91c7 added initial slab code to the kernel. It is still unused, and there is still no VM interaction.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-26 03:41:24 +00:00
Axel Dörfler
5c03270bea Added block_cache_sync_etc() that allows you to sync single blocks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20811 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-25 12:07:30 +00:00
Axel Dörfler
6d1144bbca The thread context was destructed a bit too early: if a team was killed (or didn't
close all of its file descriptors), code outside of the core kernel would be executed
in the descriptor's close/free hooks.
Since the semaphore timeout code, and send_data()/receive_data() rely on the
thread being available in the thread hash, they wouldn't work anymore.
This fixes bug #1168. Thanks to Marcus for providing such a nice test case :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-25 08:25:10 +00:00
Axel Dörfler
1c4b5b8a6a Added a debugging command "devfs_node" to dump infos about the private devfs nodes for now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-24 14:04:26 +00:00
Axel Dörfler
be1f432648 Don't allow creating areas with a size of 0 bytes, courtesy of Vasilis Kaoutsis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-23 22:22:29 +00:00
Axel Dörfler
9504919814 Disabled priority boost on semaphore release completely now (after having pacified it
quite a bit in the past already); it somehow doesn't work right with how semaphores
are used in BeOS/Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20759 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-19 21:30:38 +00:00
Axel Dörfler
22428cc7b6 * More or less reverted my previous thread_yield() change: while this gives
threads with higher priorities a much better scheduling experience, it
  also creates a problem as soon as more than one higher priority thread
  waits on a resource held by a lower priority thread; the higher priority
  threads play ping-pong, and the lower priority thread doesn't get it's
  chance.
* Increased the probability of skipping a thread priority.
* I won't do any other changes on the scheduler, that's meianote's job now :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-19 21:25:19 +00:00
Travis Geiselbrecht
621b401de4 set the function attribute on the asm memcpy.
This should fix the loader problem some folks were seeing on beos binaries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-17 04:19:45 +00:00
Travis Geiselbrecht
3095921098 asm optimized user_memcpy(), which should help somewhat, since the old version was a byte-by-byte copy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 06:48:38 +00:00
Travis Geiselbrecht
831486a2d3 Turn the assembly optimized memcpy (simple rep movsd) back on for x86. Had to hack around the make system a bit, and the result is pretty nasty, specifically due to the amount of places in the system where various targets poke their fingers into the libroot directory.
The solution is less than optimal, but should work for now.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 06:17:14 +00:00
Travis Geiselbrecht
806f6f1161 fix a bug in _exit() that called the _IO_cleanup routine as if it was
a function pointer, which it isn't.
The mistake was probably made because there appears to be multiple stdio implementations
in the tree (BSD and glibc) so it's easy to look at the wrong code. Perhaps
we should clean that up.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 03:20:42 +00:00
Axel Dörfler
861b3c0b6f The busy page could also be in another cache that is layered upon the merged one,
so we can't easily check if the remaining mappings are valid - therefore I disabled
the check completely.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-11 15:50:11 +00:00
Jérôme Duval
9e7de14057 added the usual weak symbols to fix bug #1134
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 20:56:57 +00:00
Axel Dörfler
1407f23d9b * The test for existing mappings in vm_remove_consumer() was a bit too aggressive;
if the page is currently copied, the source page still has mappings.
* vm_copy_on_write_area() did not set the cache type for the upper cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20530 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-03 11:23:37 +00:00
Ingo Weinhold
1e768ed1d3 get_vnode_name():
* read_dir() is supposed to return B_OK and and a count of 0 when
  reaching the end of the directory. In case the node in question could
  not be found, we were looping infinitely.
* free_dir_cookie() was not invoked.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20519 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-03 04:29:24 +00:00
Axel Dörfler
70a11cecbd * pages_io() now handles it gracefully in case the fileVec array is too
small to hold the information for the requested I/O size.
* get_file_map() returned B_BUFFER_OVERFLOW already in case the array
  was exactly as large as needed.
* read_chunk_into_cache() and write_chunk_to_cache() will no longer
  override their local "size" variable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-02 11:13:03 +00:00
Ingo Weinhold
962b0b887d Added a wrapper function for the invocation of debugger commands. It
sets a fault handler, so that an invalid memory access while executing
the command (address typos always do the trick :-) won't result in
another KDL session on top of the current one, which wouldn't even be
"cont"able.

All pieces of code setting a fault handler do now save and reset the
previous one, so that e.g. a user_memcpy() in a debugger command doesn't
disturb the mechanism.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-01 17:15:37 +00:00
Ingo Weinhold
9bf1f552d9 Enabled setjmp()/longjmp() support in the kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20499 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-01 17:05:26 +00:00
Ingo Weinhold
6e442c70cb Reversed locking order of sImageLoadMutex and sImageMutex in
unload_kernel_add_on(). The former one could lead to deadlocks with
load_kernel_add_on() (e.g. occasionally the boot process would hang).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-31 23:06:09 +00:00
Ingo Weinhold
57a860987a A few more changes to pages_io():
* Added a few comments.
* Simplified the nested while loops by dropping the special handling for the
  first iovec and restructuring the innermost loop. This also rules out
  the possibility of a zero-length temporary vec. IMHO the readability
  has improved quite a bit (YMMV :-). Hopefully without introducing new
  bugs; please review!
* Corrected computation of totalSize in case less than size has been
  read/written.
* Also set *_numBytes in case all fileVecs have been processed. Only
  relevant in case the request extends beyond the end of file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-31 22:44:01 +00:00
Axel Dörfler
061816eefa * Fixed two bugs found by Ingo: the tempVec array bounds weren't checked when
filling them which could have written over the stack, and their iovec length
  was set for the wrong iovec, potentially clobbering any memory.
* The first tempVec was usually empty, anyway, as the wrong iovec was chosen
  to start from (usually one too early).
* The tempVec loop is now repeated until the whole fileVec is completed.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-31 09:54:56 +00:00
Ingo Weinhold
27d37d4d24 * Optional debug feature for tracking which page queue a page should be
in.
* New debugger command "find_page", which searches all page queues to
  find out, which one a page is actually in.
* Solved nasty race condition between the page scrubber and
  vm_page_allocate_page_run(): The page scrubber didn't mark the pages
  it was processing busy, so that vm_page_allocate_page_run() could claim
  them in the meantime. They would end up in the clear pages queue,
  although being assigned to a cache at the same time. This should
  finally solve bug #1056.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 19:48:51 +00:00
Axel Dörfler
0bfaee2899 parse_line() is now smart enough to detect quoted strings and escaped characters.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 13:44:46 +00:00
Axel Dörfler
3a1532ef98 In case the source cache of the current vm_cache_ref was in the process of
being merged in vm_cache_remove_consumer(), fault_find_page() tried again
with the current vm_cache_ref, but didn't realize it might have had inserted
a busy page in this cache already.
This fixes a deadlock, as this page would never get unbusy again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 12:14:43 +00:00
Axel Dörfler
94d37a4b51 * map_backing_store() did not set the private mapping's cache to CACHE_TYPE_RAM.
* Some more debug helpers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 09:45:50 +00:00