Pre-map file mappings from /dev/shm (--mpol-shm-premap mcexec argument)

This commit is contained in:
Balazs Gerofi
2017-03-12 14:34:34 +09:00
parent c5079898c2
commit 9b5ccb5a33
8 changed files with 157 additions and 7 deletions

View File

@ -158,6 +158,7 @@ static int enable_vdso = 1;
static int mpol_no_heap = 0;
static int mpol_no_stack = 0;
static int mpol_no_bss = 0;
static int mpol_shm_premap = 0;
static int no_bind_ikc_map = 0;
static unsigned long mpol_threshold = 0;
static unsigned long heap_extension = (2*1024*1024);
@ -1312,6 +1313,12 @@ static struct option mcexec_options[] = {
.flag = &mpol_no_bss,
.val = 1,
},
{
.name = "mpol-shm-premap",
.has_arg = no_argument,
.flag = &mpol_shm_premap,
.val = 1,
},
{
.name = "no-bind-ikc-map",
.has_arg = no_argument,
@ -1798,6 +1805,10 @@ int main(int argc, char **argv)
desc->mpol_flags |= MPOL_NO_BSS;
}
if (mpol_shm_premap) {
desc->mpol_flags |= MPOL_SHM_PREMAP;
}
desc->mpol_threshold = mpol_threshold;
desc->heap_extension = heap_extension;