mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
nova: avoid warnings because of oom handling
Use kernel branch which is more accurate in accounting memory, which avoids kernel messages of following form: [0] warning: insufficient resources ... Fixes #1830
This commit is contained in:
parent
b1b3c7bf34
commit
1d5aa4ca7e
@ -1 +1 @@
|
||||
0cdaf637a3a1c087b6350142316230c9e963a8d7
|
||||
001f770ae2ae32c6f43e295355021065f4a28ee5
|
||||
|
@ -4,7 +4,7 @@ DOWNLOADS := nova.git
|
||||
|
||||
# r9 branch - use r9_debug for more verbose kernel messages
|
||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||
REV(nova) := 12032f96fd3f09c248cad9d76527d4b3ac087fef
|
||||
REV(nova) := c852537f73209f9d9d4d2bec50e01d8fec76214e
|
||||
DIR(nova) := src/kernel/nova
|
||||
|
||||
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
||||
|
@ -51,7 +51,7 @@ int Platform_pd::assign_parent(Native_capability parent)
|
||||
|
||||
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
|
||||
signed pd_id, bool create)
|
||||
: _thread_cnt(0), _pd_sel(~0UL) { }
|
||||
: _thread_cnt(0), _pd_sel(Native_thread::INVALID_INDEX) { }
|
||||
|
||||
|
||||
Platform_pd::~Platform_pd()
|
||||
@ -59,7 +59,8 @@ Platform_pd::~Platform_pd()
|
||||
/* invalidate weak pointers to this object */
|
||||
Address_space::lock_for_destruction();
|
||||
|
||||
if (_pd_sel == ~0UL) return;
|
||||
if (_pd_sel == Native_thread::INVALID_INDEX)
|
||||
return;
|
||||
|
||||
/* Revoke and free cap, pd is gone */
|
||||
Nova::revoke(Nova::Obj_crd(_pd_sel, 0));
|
||||
@ -74,6 +75,9 @@ void Platform_pd::flush(addr_t remote_virt, size_t size)
|
||||
Flexpage_iterator flex(remote_virt, size, remote_virt, size, 0);
|
||||
Flexpage page = flex.page();
|
||||
|
||||
if (pd_sel() == Native_thread::INVALID_INDEX)
|
||||
return;
|
||||
|
||||
while (page.valid()) {
|
||||
Nova::Mem_crd mem(page.addr >> 12, page.log2_order - 12, revoke_rwx);
|
||||
Nova::revoke(mem, true, true, pd_sel());
|
||||
|
@ -89,7 +89,7 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
res = create_ec(_sel_ec(), _pd->pd_sel(), _location.xpos(),
|
||||
utcb, initial_sp, _sel_exc_base, thread_global);
|
||||
if (res == Nova::NOVA_PD_OOM && Nova::NOVA_OK != _pager->handle_oom()) {
|
||||
_pd->assign_pd(Native_thread::INVALID_INDEX);
|
||||
_pager->assign_pd(Native_thread::INVALID_INDEX);
|
||||
PERR("creation of new thread failed %u", res);
|
||||
return -4;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ CC_WARN += -Wframe-larger-than=64
|
||||
CC_OPT += -mpreferred-stack-boundary=2 -mregparm=3
|
||||
else
|
||||
ifeq ($(filter-out $(SPECS),64bit),)
|
||||
CC_WARN += -Wframe-larger-than=128
|
||||
CC_WARN += -Wframe-larger-than=144
|
||||
CC_OPT += -mpreferred-stack-boundary=4 -mcmodel=kernel -mno-red-zone
|
||||
else
|
||||
$(error Unsupported environment)
|
||||
|
Loading…
Reference in New Issue
Block a user