container_delete_cb时间统计:
继续分解耗时长的函数container_destroy:
打点发现该接口耗时,原因是这个地方做了遍历,在运行到 zfs 的时候还会起一个进程,导致一个大约6毫秒的耗时:
实际对我的镜像而言,这个遍历没有任何作用,测试下来,下面数组中的任何一个回调都没执行,请确认该if (bdevs[i].ops->detect(path))操作是否为有效操作?是否可以删除以优化性能?!
static const struct lxc_storage_type bdevs[] = {
{ .name = "dir", .ops = &dir_ops, },
{ .name = "zfs", .ops = &zfs_ops, },
{ .name = "lvm", .ops = &lvm_ops, },
{ .name = "rbd", .ops = &rbd_ops, },
{ .name = "btrfs", .ops = &btrfs_ops, },
{ .name = "overlay", .ops = &ovl_ops, },
{ .name = "overlayfs", .ops = &ovl_ops, },
{ .name = "loop", .ops = &loop_ops, },
{ .name = "nbd", .ops = &nbd_ops, },
#ifdef HAVE_ISULAD
//isulad: block device
{ .name = "blk", .ops = &blk_ops, }
#endif
};
Hi firstadream, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: iSulad, and any of the maintainers: @haomintsai , @lifeng_isula , @haozi007 , @jingxiaolu
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
感谢
我们镜像默认应该是dir_detect会退出,但是由于进行lxc-destory的时候,镜像的merged目录已经删除了,导致dir_detect失效,从而遍历了所有的bdevs。
bool dir_detect(const char *path)
{
struct stat statbuf;
int ret;
if (!strncmp(path, "dir:", 4))
return true;
ret = stat(path, &statbuf);
if (ret == -1 && errno == EPERM)
return log_error_errno(false, errno, "dir_detect: failed to look at \"%s\"", path);
if (ret == 0 && S_ISDIR(statbuf.st_mode))
return true;
return false;
}
登录 后才可以发表评论