Pre-map file mappings from /dev/shm (--mpol-shm-premap mcexec argument)
This commit is contained in:
@@ -98,6 +98,7 @@ typedef unsigned long __cpu_set_unit;
|
||||
#define MPOL_NO_HEAP 0x01
|
||||
#define MPOL_NO_STACK 0x02
|
||||
#define MPOL_NO_BSS 0x04
|
||||
#define MPOL_SHM_PREMAP 0x08
|
||||
|
||||
struct program_load_desc {
|
||||
int num_sections;
|
||||
|
||||
@@ -770,6 +770,7 @@ enum {
|
||||
MF_ZEROFILL = 0x0010,
|
||||
MF_REG_FILE = 0x1000,
|
||||
MF_DEV_FILE = 0x2000,
|
||||
MF_PREMAP = 0x8000,
|
||||
MF_END
|
||||
};
|
||||
|
||||
@@ -863,9 +864,8 @@ static int pager_req_create(ihk_os_t os, int fd, uintptr_t result_pa)
|
||||
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
|
||||
if (!IS_ERR(fullpath)) {
|
||||
if (!strncmp("/dev/shm/Intel_MPI", fullpath, 18)) {
|
||||
//mf_flags = (MF_PREFETCH | MF_ZEROFILL);
|
||||
mf_flags = (MF_ZEROFILL);
|
||||
dprintk("%s: filename: %s, zerofill\n",
|
||||
mf_flags = (MF_PREMAP | MF_ZEROFILL);
|
||||
dprintk("%s: filename: %s, premap & zerofill\n",
|
||||
__FUNCTION__, fullpath);
|
||||
}
|
||||
else if (strstr(fullpath, "libmpi") != NULL) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user