checking the physical frame buffer location.
* This allows us to map the whole frame buffer at once, which means there is no
need anymore to remap the memory on mode change.
* Also, this will ease the burden of the MTRRs, as the memory size will be
properly aligned.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34206 a95241bf-73f2-0310-859d-f6bbb57e9c96
all MTRRs at once.
* Added a respective x86_set_mtrrs() kernel function.
* x86 CPU module:
- Implemented the new hook.
- Prefixed most debug output with the CPU index. Otherwise it gets quite
confusing with multiple CPUs.
- generic_init_mtrrs(): No longer clear all MTRRs, if they are already
enabled. This lets us benefit from the BIOS's setup until we install our
own -- otherwise with caching disabled things are *really* slow.
* arch_vm.cpp: Completely rewrote the MTRR handling as the old one was not
only slow (O(2^n)), but also broken (resulting in incorrect setups (e.g.
with cachable ranges larger than requested)), and not working by design for
certain cases (subtractive setups intersecting ranges added later).
Now we maintain an array with the successfully set ranges. When a new range
is added, we recompute the complete MTRR setup as we need to. The new
algorithm analyzing the ranges has linear complexity and also handles range
base addresses with an alignment not matching the range size (e.g. a range
at address 0x1000 with size 0x2000) and joining of adjacent/overlapping
ranges of the same type.
This fixes the slow graphics on my 4 GB machine (though unfortunately the
8 MTRRs aren't enough to fully cover the complete frame buffer (about 35
pixel lines remain uncachable), but that can't be helped without rounding up
the frame buffer size, for which we don't have enough information). It might
also fix#1823.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34197 a95241bf-73f2-0310-859d-f6bbb57e9c96
This is something must must not do in an idle thread or we get the scheduler
into trouble.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34196 a95241bf-73f2-0310-859d-f6bbb57e9c96
to be cloned.
* Added "flags" parameter to the SetTo(const void*,...) version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34155 a95241bf-73f2-0310-859d-f6bbb57e9c96
to physical memory whose address would accidentally satisfy the
IS_USER_ADDRESS() check.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34136 a95241bf-73f2-0310-859d-f6bbb57e9c96
parameter and request->IsWrite(). The parameter means whether we want to
write to the request's I/O buffer (therefore renamed it to writeToRequest),
while request->IsWrite() indicates whether the request is a write request.
One can only write to a read request's buffer and vice versa.
IOBuffer::LockMemory() also wants to know whether the request is a write
request, not whether we want to write to the memory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34135 a95241bf-73f2-0310-859d-f6bbb57e9c96
stack after that has just been changed, and does not contain the data one
would assume.
* This fixes the leaking the vm_translation_map_arch_info objects, and thus
bug #4957.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34090 a95241bf-73f2-0310-859d-f6bbb57e9c96
aren't monotonically increasing which this code was assuming. This fixes bug
#4917.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34074 a95241bf-73f2-0310-859d-f6bbb57e9c96
* /etc now points to /boot/common/etc/, and the remaining contents of the former
"etc" are put there now, as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33986 a95241bf-73f2-0310-859d-f6bbb57e9c96
as the BeOS scheduler. This makes MediaPlayer playback much better, as high
priority threads could lose their quantum to a worker thread twice in a row
with 4% probability before.
* I did not yet change the simple scheduler as well yet; maybe this isn't the
final one either.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33965 a95241bf-73f2-0310-859d-f6bbb57e9c96
Mikhail Panasyuk: since worker threads often end up with B_NORMAL_PRIORITY,
it might be a good idea to give system threads a higher priority.
* Minor cleanup (mostly automatic whitespace).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33961 a95241bf-73f2-0310-859d-f6bbb57e9c96
* When DEBUG_SPINLOCK_LATENCIES is 1, the system will panic if any spinlock is
held longer than DEBUG_LATENCY micro seconds (currently 200). If your system
doesn't boot anymore, a new safemode setting can disable the panic.
* Besides some problems during boot when the MTRRs are set up, 200 usecs work
fine here if all debug output is turned off (the output stuff is definitely
problematic, though I don't have a good idea on how to improve upon it a lot).
* Renamed the formerly BeOS compatible safemode settings to look better; there
is no need to be compatible there.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33953 a95241bf-73f2-0310-859d-f6bbb57e9c96
accesses the scheduler data inside the thread structure, freeing it first lead
to a crash when a thread couldn't be created.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33940 a95241bf-73f2-0310-859d-f6bbb57e9c96
and it's still a valid call.
* This fixes ktrace_printf() from userland.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33934 a95241bf-73f2-0310-859d-f6bbb57e9c96
file systems, so those checks don't have to be duplicated there, anymore.
* Minor cleanup, mostly automatic whitespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33895 a95241bf-73f2-0310-859d-f6bbb57e9c96
debug_output().
* Added a second buffer to be used when interrupts are turned off, otherwise
dprintf_args() will now use a mutex guarded buffer to fill with vfprintf() -
the actual sending to the outputs still needs the spinlock, so things only
slightly improved.
* Moved private functions into the private section of the source file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33809 a95241bf-73f2-0310-859d-f6bbb57e9c96
should improve the kernel latencies, as things like
vm_page_allocate_page_run() is very expensive.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33807 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Now, killing a team shut properly cause the app_server to close the windows
of that team, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33777 a95241bf-73f2-0310-859d-f6bbb57e9c96
ID.
* Accidently, this should also fix bug #4839.
* Optimized _get_next_sem_info() a whole lot by iterating over the team's
semaphore list.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33773 a95241bf-73f2-0310-859d-f6bbb57e9c96
to the owning team.
* Instead, the team now maintains a list containing the ports it owns.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33771 a95241bf-73f2-0310-859d-f6bbb57e9c96
* This makes sem_delete_owned_sems() a lot more efficient; before it would need
to scan the entire semaphore table.
* This speeds up the test build of the kernel by another 2 seconds (with
KDEBUG=2) on my laptop.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33743 a95241bf-73f2-0310-859d-f6bbb57e9c96
iterated over all known thread *IDs* with interrupts disabled.
Now it iterates over the team's thread list (going from back to front, since
new threads are added at the front of the singly linked queue).
* Alexandre restarted Tracker quite a lot, and let the shell script run to
reproduce a certain bug - and then wondered why ProcessController would
take several seconds to open its windows until it passed through more than
8 million IDs... :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33737 a95241bf-73f2-0310-859d-f6bbb57e9c96
(hopefully) correct place.
* It seems to be even harder to understand basic locking primitives: when you
think about it, it shouldn't surprise you that conditional variables never
return B_WOULD_BLOCK. This fixes gdb again.
* Added tracing support to the ports subsystem.
* get_port_message() will now resize the port heap if needed (but will also
take timeouts into account while doing so, more or less). The initial port
space is 4MB (as before), the growth rate is the same, and the system wide
limit is arbitrarily set to 64 MB (all swappable). A team limit has been set
to 8 MB, but is not enforced yet. Since ports are using up address space in
the kernel, those seems to be proper limits.
* This also fixes a strange, and rare lockup where the mouse cursor would still
move, but everything else would basically hang, but look perfectly normal from
KDL on the first look. As recently happened on Brecht's laptop, and debugged
by mmlr and me: the cbuf space got used up when lots of windows wanted to
redraw after a workspace switch. The app_server wouldn't answer anymore to
client requests, but thought it would have done so, as LinkSender::Flush()
doesn't care if it got a B_NO_MEMORY (the ports will now block until memory
is available if possible, so that should not be a problem anymore).
* Improved "port" KDL command, it now also prints the messages in the port.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33735 a95241bf-73f2-0310-859d-f6bbb57e9c96
was used this way in the debugger. Doing this later should be harmless,
AFAICT, but Ingo will probably know better.
* Beware, though, the debugger currently does not work anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33730 a95241bf-73f2-0310-859d-f6bbb57e9c96
* its own heap allocator instead of cbuf - this makes cbuf superfluous, and I
therefore removed it from the kernel. The heap is swappable, so lifts the
kernel's resource usage a bit. In the future, the heap should grow as well;
right now it should be at least as good as before.
* it no longer uses spinlocks, but just mutexes now for better scalability - it
was not usable with interrupts turned off anyway (due to its semaphore usage).
* it no longer uses semaphores, but condition variables.
* Needed to move the port initialization to a later point, as swappable memory
wasn't usable that early.
* All ports test are still passing, hopefully I didn't mess anything up :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33728 a95241bf-73f2-0310-859d-f6bbb57e9c96
the bin sizes ensure that when hitting this case it always allocates multiple
pages. This makes it more flexible for other use cases though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33726 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed some minor issues of heap_create_allocator() when it should use the
kernel heap to allocate its heap structure.
* Fixed an off by one error in the max bin check.
* Changed the KDL "heap" command to allow the "stats" for any heap as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33725 a95241bf-73f2-0310-859d-f6bbb57e9c96
fit into the existing area. In that case further reallocs could then assume the
wrong previous size and then not copy enough from the original buffer, leading
to lost bytes at the end of the new buffer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33724 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Allow an allocator to be created on the heap to allow for non-locked
allocators to be created.
* Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33721 a95241bf-73f2-0310-859d-f6bbb57e9c96
read out in the ConditionVariableEntry::WaitStatus(). That way you can notify
with a specific status that can be read out on the other end.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33718 a95241bf-73f2-0310-859d-f6bbb57e9c96
turned on. That should explain Bruno's problems to get debug output from an
accelerant. Thanks to Michael for the hint!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33651 a95241bf-73f2-0310-859d-f6bbb57e9c96
high contention of the read lock (I experimented with the VM page mapping
lock)), it actually hurt the compile performance pretty obviously.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33647 a95241bf-73f2-0310-859d-f6bbb57e9c96
makes the reader case a lot less expensive, and should relieve the thread
spinlock contention a bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33643 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Check for overflows in memory allocation. If someone happened to (erroneously)
try to allocate a negative amount of memory we could overflow and crash
because of the sizes getting messed up.
* Review and update the alignment logic which was a bit broken for the huge
allocation case (reaching the area threshold). Also assert the results so
next time this will be easier to spot.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33638 a95241bf-73f2-0310-859d-f6bbb57e9c96
when you enter arch_cpu_shutdown(), so you must not try to load the ACPI
module to reboot. DaaT, that should fix the problem you showed me.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33617 a95241bf-73f2-0310-859d-f6bbb57e9c96
idea to always send SIGKILL to the main thread, though. I'm not really getting
more insight by reading the POSIX specs.
* Anyway, in the mean time, this fixes bug #4784.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33599 a95241bf-73f2-0310-859d-f6bbb57e9c96
broke their placement at the end of the reserved area, which was the main
reason #4778 happened so often (it would have been more hidden else).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33598 a95241bf-73f2-0310-859d-f6bbb57e9c96
space was becoming tight. This actually fixes#4778.
* Fixed overflow problem in find_reserved_area().
* Cleaned up the test app, added license.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33597 a95241bf-73f2-0310-859d-f6bbb57e9c96
the RESERVED_AVOID_BASE flag of those, and introduced a way to fill them
from the start. This caused #4778.
* Turned IS_VALID_SPOT() macro into an inline function.
* Removed already resolved TODO comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33581 a95241bf-73f2-0310-859d-f6bbb57e9c96
them (which you previously could use to easily crash/take over Haiku).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33570 a95241bf-73f2-0310-859d-f6bbb57e9c96
Locker.cpp.
* The services are now using recursive_locks, and rw_locks instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33548 a95241bf-73f2-0310-859d-f6bbb57e9c96
in the free and/or clear queue. This performs better in the case where only few
pages are free/clear but performs worse in the case where there are a lot of
usable pages. It's not used anywhere but it might come in handy one time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33527 a95241bf-73f2-0310-859d-f6bbb57e9c96
PageWriteTransfer. This makes the transfer accept virtually contiguous pages,
where the offset is contiguous on either end of the current transfer, but where
the pages aren't physically contiguous. It will then add seperate iovecs for
these pages (32 at max right now). This reduces the number of IO requests
generated and allows for optimizations down the IO path (like in the physical to
virtual mapping case for example).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33526 a95241bf-73f2-0310-859d-f6bbb57e9c96
need for the IO -> InternalIO indirection as it is always fed virtual buffers,
which simplifies things a bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33525 a95241bf-73f2-0310-859d-f6bbb57e9c96
is virtual already it just returns the vecs directly, if it is physical it takes
over the task of virtualizing the vecs either using vm_map_physical_memory_vecs,
if there are multiple vecs or more than one page, or falls back to page wise
mapping if mapping fails or is not needed. In the best case, scattered physical
pages are mapped into one linear virtual buffer so that subsystems operating on
virtual memory only get a single vector and can then burst read/write.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33524 a95241bf-73f2-0310-859d-f6bbb57e9c96
takes a list of iovecs describing the physical pages to be mapped. With it one
can map a set of physically disjoint pages into one linear virtual range. This
is a private API right now, but we might want to make it public as
map_physical_memory_vecs alongside map_physical_memory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33523 a95241bf-73f2-0310-859d-f6bbb57e9c96
are required to be physically contiguos, which should be reworked to put them
into seperate iovecs. Still this manages to combine a great deal of page
writes into larger bursts already. Reduces the amount of IO requests being
scheduled (and greatly benefits media where page wise writes are slow when
they are accessed through a non-IOScheduler path, i.e. USB mass storage until
that is properly implemented).
* Abstracted per page page writing tasks into a PageWriteWrapper class.
* Abstracted per transfer page writing tasks into PageWriteTransfer class which
formerly was the PageWriterCallback.
* Use both classes from the PageWriterRun and from
vm_page_write_modified_page_range to remove code duplication.
* Adjusted synchronous VMAnonymousCache::Write() to cope correctly with larger
iovecs and more than one iovec. It assumed that there was exactly one page per
vector previously.
* Introduced MaxPagesPerWrite() and MaxPagesPerAsyncWrite() to VMCache to allow
a cache to specify restricitions. VMAnonymousCache does restrict the max pages
to 1 for WriteAsync right now as I didn't feel like reworking that one to cope
with non single page writes just yet.
* Pulled out PageWriteTransfer methods for better readability.
* Some typo fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33507 a95241bf-73f2-0310-859d-f6bbb57e9c96
reads or writes for old style drivers, map the physical memory at once. Since
USB is pretty much the only one affected and there small reads/writes are
exponentially slower, the performance gain of the burst transfer far outweighs
the additional overhead of the mapping. Still this could be further optimized
and will eventually be superseeded by also providing a physical memory API in
USB. For now it should bring back USB reads to an acceptable level. Writes are
still page wise though because of how writing back memory works in general.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33503 a95241bf-73f2-0310-859d-f6bbb57e9c96
always return the source string length, we can't really prevent an overflow
of the source address.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33489 a95241bf-73f2-0310-859d-f6bbb57e9c96
when scanning for drivers, as that reverts the standard locking order with
locks like the device manager lock. There is now a dedicated scan_lock for
each directory.
* get_device_name() now locks itself which also adds a missing lock in the
B_GET_PATH_FOR_DEVICE ioctl().
* Minor refactoring; the directory init code was duplicated over several places
in the source file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33465 a95241bf-73f2-0310-859d-f6bbb57e9c96
address overflows. Apparently at least the x86 string instructions generate
a general protection fault instead of a page fault, and we only use the fault
handler in the latter case (maybe we should change that, too). Fixes#4714.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33436 a95241bf-73f2-0310-859d-f6bbb57e9c96
code is no longer loaded, e.g. when the module has been unloaded or the tracing
buffer was reattached from a previous session.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33389 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added new header headers/private/system/disk_device_types.h, which defines
the <DiskDeviceTypes.h> constants as macros and which can be used where the
constants cannot be used. The constants are defined using the macros, so now
there's only one place where the string literals should be specified.
* Use the macros in the partitioning systems. I was too lazy to also adjust the
file systems -- most of them seem to hard-code the string literal yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33386 a95241bf-73f2-0310-859d-f6bbb57e9c96
- Fixed vfs_get_vnode_from_fd() return type.
- Added vfs_open_vnode().
- Added a "bool traverseLeafLink" parameter to vfs_get_fs_node_from_path().
It was always resolving symlinks.
* device manager/devfs:
- devfs: get_node_for_path() no longer resolves leaf symlinks. That still
doesn't help with file disk devices, as creating partition wouldn't work
anyway.
- Pulled the module-related implementation part of BaseDevice into new class
AbstractModuleDevice and made all methods of BaseDevice virtual. Small
adjustments to devfs to be happy with the new BaseDevice interface.
- Added BaseDevice subclass FileDevice, which maps the interface to a file's
file descriptor. Still got a few TODOs, but should basically work.
- Use FileDevice for publishing file disk devices in devfs. Now those do
actually work, though there's some BFS trouble with one of the images I
tested.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33385 a95241bf-73f2-0310-859d-f6bbb57e9c96
aren't routed correctly over the 8259, it seems.
- Removed passing the hpet_regs around, since there's a static variable.
- Added lots of debug dprintfs.
- Fixed setting the timer interrupt to edge
- Timer is initialized once.
- Use the timer 0 instead of 2.
- Renamed register definitions to be more readable
- Use 64 bits registers and unions where applicable.
- Other things I don't remember
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33345 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also shortened some defines using "TN" instead of "TIMER". It's also
the same scheme used in the specs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33334 a95241bf-73f2-0310-859d-f6bbb57e9c96
Lowered its priority of hpet timer so it doesn't get picked up first
(yet)
Changed the debug output to be conditional.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33292 a95241bf-73f2-0310-859d-f6bbb57e9c96
factor to avoid compiler issues.
- Removed some useless and commented debug stuff.
- Now prints also the global HPET configuration.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33291 a95241bf-73f2-0310-859d-f6bbb57e9c96
1000. XenServer boots correctly and in reasonable time,
now (meaning hpet timers work). I guess on real hw the bios doesn't
correctly program the hpet timers, so we'll need a bit more work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33289 a95241bf-73f2-0310-859d-f6bbb57e9c96
XenServer actually boots (but slow as hell) with hpet timers enabled, real hardware does
not.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33287 a95241bf-73f2-0310-859d-f6bbb57e9c96
if they were not already ordered. Or, to say id differently, it was completely
broken.
Luckily no one noticed....
Also disabled again printing the timers, since it could print not available ones.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33235 a95241bf-73f2-0310-859d-f6bbb57e9c96
checked the existence of the apics.
Moved the code to disable the local apic from arch_timer.c to arch_int.cpp, so
we also avoid installing the interrupt handler for it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33149 a95241bf-73f2-0310-859d-f6bbb57e9c96
can cause overflows.
* Added a generic IS_VALID_SPOT() macro that checks for overflows and checks if
the area will fit with the given constraints.
* Use the macro to simplify the places where these checks are necessary.
* Use the provided "end" limit instead of the address space end. It currently
doesn't matter but makes more sense.
* Rename newBase variables to alignedBase as that's what they are.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33061 a95241bf-73f2-0310-859d-f6bbb57e9c96
to insert areas so we don't overflow.
* Consequently use the area end (base + size - 1) where appropriate which
prevents overflows in a few places.
* Properly check for reaching the address space end.
* If we've already found a spot we don't need to recheck if we've found one.
* Simplify the B_EXACT_ADDRESS checks down to a simpler single if statement
instead of the four seperate ones.
* Properly calculate the search end for B_EXACT_ADDRESS as well, it's also
base + size - 1.
* Block the full last page now that this actually works without overflowing.
* Some style changes and added spacing.
This should now really fix#2550. Previously the overflow protection didn't
actually work because on allocation we overflowed and completely missed the
protecting area.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33037 a95241bf-73f2-0310-859d-f6bbb57e9c96
and 0xcccccccc (and 64 pages thereafter) in any way will always lead to a crash.
Before it could happen that these ranges were allocated for an area and then
accessing these would not be as evident anymore. Only enabled when the
corresponding paranoid setting is enabled (which it currently is).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33033 a95241bf-73f2-0310-859d-f6bbb57e9c96
of the VM functions handling areas are overflow safe. If an area is created that
spans across the last page many places will run into an integer overflow. This
mostly concerns the area allocation path in find_and_insert_area_slot() and also
vm_create_anonymous_area() where the loop for mapping pages for B_FULL_LOCK
areas overflows and runs more times than it should leading to #2550.
This could be seen as a workaround. The real fix would be to make everything
overflow safe. The thing is that this does also concern the user of the area
which could easily have forgotten to check for overflows as well, so I am a bit
uneasy with handing out areas that could easily lead to such hard to debug
problems. Since this is really an edge case and this single step safes quite a
bit of extra checks I'd actually be OK with keeping it that way.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33032 a95241bf-73f2-0310-859d-f6bbb57e9c96
mapped pages and a non-read and non-write protection to block a certain address
range from being used by anything.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33030 a95241bf-73f2-0310-859d-f6bbb57e9c96
end up as 0 again in any case. It certainly looks correct without it, removing
so it doesn't confuse the next one reading over it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32994 a95241bf-73f2-0310-859d-f6bbb57e9c96
many pages as are actually missing, not the full count.
* Take into account that free_page_queue_count() can be less than sReservedPages
(when some of the reserved pages have been allocated already) in
vm_page_num_unused_pages(). Before it could return negative and therefore
wrapped numbers.
* Simplify the page scrubber loop by continuing early. Also avoids a needless
interrupt spin lock acquisition when there's nothing to do.
* Some minor coding style cleanup.
* Fix a typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32980 a95241bf-73f2-0310-859d-f6bbb57e9c96
allows for BFS based LiveCDs. Still this whole name matching feels hacky.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32976 a95241bf-73f2-0310-859d-f6bbb57e9c96
This allows for synchronous uses where subrequests are forked off and waited on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32936 a95241bf-73f2-0310-859d-f6bbb57e9c96
only some sub requests worked. Previously we would have simply canceled all
of the subrequests in the loop because we cancel after the first error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32914 a95241bf-73f2-0310-859d-f6bbb57e9c96
* An off by one error prevented the very last block of a device to be accessed
through IO.
* In case of error the request wasn't notified causing anyone (the page writer
for example) to wait forever for the request to complete.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32913 a95241bf-73f2-0310-859d-f6bbb57e9c96
for the page list but not the area one. Since multiple pages can be allocated
at once, even an area that is not at the top of the list can become empty. In
such a case the area list would previously have lost entries. Also because
we can remove more than one page from any area, not just the top one, we may
need to move forward in the list so that it stays ordered by free pages.
+alphabranch
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32880 a95241bf-73f2-0310-859d-f6bbb57e9c96