pager: use host physical for PMIx shared memory

Change-Id: Idfebc768ba03b5536a0e5eb1c6076769806fa7aa
This commit is contained in:
Balazs Gerofi
2019-09-17 14:00:46 +09:00
committed by Masamichi Takagi
parent e35ec09da1
commit d15a396d5a

View File

@ -972,6 +972,25 @@ static int pager_req_create(ihk_os_t os, int fd, uintptr_t result_pa)
goto out;
}
/* OpenMPI /tmp shared memory hack */
{
char *pathbuf, *fullpath;
pathbuf = kmalloc(PATH_MAX, GFP_ATOMIC);
if (pathbuf) {
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
if (!IS_ERR(fullpath)) {
if (!strncmp("/tmp/ompi.", fullpath, 10)) {
dprintk("%s: treating %s as a device file..\n",
__func__, fullpath);
kfree(pathbuf);
error = -ESRCH;
goto out;
}
kfree(pathbuf);
}
}
}
inode = file->f_path.dentry->d_inode;
if (!inode) {
error = -EBADF;
@ -1419,6 +1438,23 @@ static int pager_req_map(ihk_os_t os, int fd, size_t len, off_t off,
#define ANY_WHERE 0
if (prot_and_flags & MAP_LOCKED) prot_and_flags |= MAP_POPULATE;
/* OpenMPI /tmp shared memory hack */
{
char *pathbuf, *fullpath;
pathbuf = kmalloc(PATH_MAX, GFP_ATOMIC);
if (pathbuf) {
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
if (!IS_ERR(fullpath)) {
if (!strncmp("/tmp/ompi.", fullpath, 10)) {
dprintk("%s: pre-populating %s..\n",
__func__, fullpath);
prot_and_flags |= MAP_POPULATE;
}
kfree(pathbuf);
}
}
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
down_write(&current->mm->mmap_sem);