This picks up the major work of allowing multiple heap implementations
and enable dlmalloc as an alternate heap to the simple existing one
(now called 'miniheap').
Also added a novm page allocator for memory management on systems too small
or missing an mmu to have a vm. Not much more than a simple bitmap allocator
that the heap pulls from. Allows for other heaps and/or users of physical
memory to coexist and span multiple banks of memory.
Pass arch_mmu_flags (instead of flags) to arch_mmu_pick_spot routine.
This bug would mostly affect ARMv7 platforms with enabled support
for non-secure memory.
Change-Id: Ic97ee6d3f05528170d66ab5033b24adf1d0c514e
Use the reserved cortex-m vectors 8 and 9 for a magic cookie and
pointer to a debugger info structure. This structure contains
pointers to the threadlist, the current thread pointer, and
offsets to important members of the thread structure. With
this information, an attached debugger can walk the threadlist
and obtain state, name, registers, etc for each thread.
Use global define WITH_DEBUGGER_INFO to enable this.
Allow setting the realtime flag on low priority threads to disable the
tick without also loosing ipi interrupts.
Change-Id: Ia30e4d20105a65945918fc996c3114c3852963a9
Some architectures might have resrictions on selecting
virtual address depending on properties of particular
VM allocation. This CL allows arch to provide a hook into
virtual address allocator to handle such restictions.
Change-Id: I28e912dcf2cf260b7e6666b6a9384178e41bfa73
If mark_pages_in_use fails to mark the kernel code (or data) as used,
it will get corrupted as the heap starts reusing using it.
Change-Id: I48f62bb68dcbad3268304aa2a1e63e9956128064
-Fixes bug where the code would walk off the end of an arena, not
detecting the case where there is no way to satisfy the request.
Change-Id: I16434f13faa6d5d76aaba5bf3c458d230e4db888
The existing runqueues are scanned on resched until a thread that is
not pinned to another cpu is found.
Per-pu runqueues can be added later to avoid this scan.
Change-Id: Idd7dbddb4b79ef38a0ccd0c42b53f8867020e6cd
Conflicts:
kernel/thread.c
The new priority of the thread may mean that a different thread should run.
Change-Id: Ia683613bb825929b506ea885c6ef303d9748c6a0
Signed-off-by: Arve Hjønnevåg <arve@android.com>
The post SMP algorithm wasn't taking into account time on any given core
if the core was currently idle at the time the load interrupt fired.
Also track rescheduling ipis and condense the output slightly.
-Each cpu's idle thread now doesn't sit in the run queue and is only
selected when no other threads are ready to run. This means there is
now an implicit affinity for the idle threads for each cpu, and reduces
the amount of idle thread thrashing without real affinity (or per cpu
run queues).
-Fix some bitmap logic in the mp_reschedule and mp_mbx_reschedule_irq
code path that probably resulted in not enough reschedules.
-Change a few spots for mp reschedule ipis in general thread path. Add
ipi to thread_resume, remove one from thread_create_etc.