mcexec/mm: user memory policy control for heap, stack, etc.

This commit is contained in:
Balazs Gerofi
2017-02-07 04:28:31 +09:00
parent afb7cb3a1e
commit 182202523e
7 changed files with 59 additions and 7 deletions

View File

@ -1430,7 +1430,8 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
/* Small allocations mostly benefit from closest RAM,
* otherwise follow user requested policy */
unsigned long ap_flag =
(len >= AP_USER_THRESHOLD || flags & MAP_STACK) ?
(!(flags & MAP_STACK) && len >= AP_USER_THRESHOLD) ||
((flags & MAP_STACK) && !(thread->proc->mpol_flags & MPOL_NO_STACK)) ?
IHK_MC_AP_USER : 0;
if (ap_flag) {