" is only supported in non-legacy memory mode\n");
return -1;
}
+ if (internal_cfg->single_file_segments &&
+ internal_cfg->hugepage_unlink) {
+ RTE_LOG(ERR, EAL, "Option --"OPT_SINGLE_FILE_SEGMENTS" is "
+ "not compatible with --"OPT_HUGE_UNLINK"\n");
+ return -1;
+ }
return 0;
}
__func__, strerror(errno));
goto resized;
}
+ if (internal_config.hugepage_unlink) {
+ if (unlink(path)) {
+ RTE_LOG(DEBUG, EAL, "%s(): unlink() failed: %s\n",
+ __func__, strerror(errno));
+ goto resized;
+ }
+ }
}
/*
/* ignore failure, can't make it any worse */
} else {
/* only remove file if we can take out a write lock */
- if (lock(fd, LOCK_EX) == 1)
+ if (internal_config.hugepage_unlink == 0 &&
+ lock(fd, LOCK_EX) == 1)
unlink(path);
close(fd);
}
return -1;
}
+ /* if we've already unlinked the page, nothing needs to be done */
+ if (internal_config.hugepage_unlink) {
+ memset(ms, 0, sizeof(*ms));
+ return 0;
+ }
+
/* if we are not in single file segments mode, we're going to unmap the
* segment and thus drop the lock on original fd, but hugepage dir is
* now locked so we can take out another one without races.