zvfs: submodule init
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
*.o
|
*.o
|
||||||
*.d
|
*.d
|
||||||
*.so
|
*.so
|
||||||
func_test
|
zvfs/func_test
|
||||||
zvfs_meta.txt
|
zvfs_meta.txt
|
||||||
|
zvfs/zvfs_meta.txt
|
||||||
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "spdk"]
|
||||||
|
path = spdk
|
||||||
|
url = https://github.com/spdk/spdk.git
|
||||||
|
branch = v24.05
|
||||||
38
Makefile
Executable file → Normal file
38
Makefile
Executable file → Normal file
@@ -1,37 +1,9 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
.PHONY: all clean zvfs
|
||||||
# Copyright (C) 2017 Intel Corporation
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
|
|
||||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../spdk)
|
all: zvfs
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk
|
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk
|
|
||||||
|
|
||||||
LIBZVFS := libzvfs.so
|
zvfs:
|
||||||
APP := func_test
|
$(MAKE) -C zvfs
|
||||||
|
|
||||||
C_SRCS := zvfs.c zvfs_hook.c
|
|
||||||
|
|
||||||
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev
|
|
||||||
|
|
||||||
LIBS += $(SPDK_LIB_LINKER_ARGS)
|
|
||||||
LDFLAGS += -shared -rdynamic -Wl,-z,nodelete -Wl,--disable-new-dtags \
|
|
||||||
-Wl,-rpath,$(SPDK_ROOT_DIR)/build/lib \
|
|
||||||
-Wl,-rpath,$(SPDK_ROOT_DIR)/dpdk/build/lib
|
|
||||||
SYS_LIBS += -ldl
|
|
||||||
|
|
||||||
all: $(LIBZVFS) $(APP)
|
|
||||||
@:
|
|
||||||
rm -rf zvfs_meta.txt
|
|
||||||
|
|
||||||
$(LIBZVFS): $(OBJS) $(SPDK_LIB_FILES) $(ENV_LIBS)
|
|
||||||
$(LINK_C)
|
|
||||||
|
|
||||||
$(APP): func_test.c
|
|
||||||
$(CC) -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(CLEAN_C) $(LIBZVFS) $(APP)
|
$(MAKE) -C zvfs clean
|
||||||
|
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk
|
|
||||||
12
README.md
12
README.md
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
## usage
|
## usage
|
||||||
```shell
|
```shell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
cd /home/lian/share/10.1-spdk/spdk
|
cd /home/lian/share/10.1-spdk/spdk
|
||||||
./configure --with-shared
|
./configure --with-shared
|
||||||
make -j
|
make -j
|
||||||
@@ -23,15 +25,15 @@ zvfs的测试结果:
|
|||||||
1. iosize = 4K:95MiB/s
|
1. iosize = 4K:95MiB/s
|
||||||
2. ioszie = 128K:1662MiB/s
|
2. ioszie = 128K:1662MiB/s
|
||||||
|
|
||||||
相当于spdk读写的90%性能。
|
相当于spdk测试工具读写的90%性能。
|
||||||
|
|
||||||
对比系统调用:
|
对比系统调用:
|
||||||
1. O_DIRECT
|
1. O_DIRECT
|
||||||
1. 大块:43MiB/s
|
1. 大块4K:43MiB/s
|
||||||
2. 小块:724MiB/s
|
2. 小块128K:724MiB/s
|
||||||
2. !O_DIRECT
|
2. !O_DIRECT
|
||||||
1. 大块:1460MiB/s
|
1. 大块4K:1460MiB/s
|
||||||
2. 小块:1266MiB/s
|
2. 小块128K:1266MiB/s
|
||||||
|
|
||||||
### spdk_nvme_perf 性能基准测试
|
### spdk_nvme_perf 性能基准测试
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
1
spdk
Submodule
1
spdk
Submodule
Submodule spdk added at 40a5c21897
37
zvfs/Makefile
Executable file
37
zvfs/Makefile
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# Copyright (C) 2017 Intel Corporation
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
|
||||||
|
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../spdk)
|
||||||
|
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||||
|
include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk
|
||||||
|
include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk
|
||||||
|
|
||||||
|
LIBZVFS := libzvfs.so
|
||||||
|
APP := func_test
|
||||||
|
|
||||||
|
C_SRCS := zvfs.c zvfs_hook.c
|
||||||
|
|
||||||
|
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev
|
||||||
|
|
||||||
|
LIBS += $(SPDK_LIB_LINKER_ARGS)
|
||||||
|
LDFLAGS += -shared -rdynamic -Wl,-z,nodelete -Wl,--disable-new-dtags \
|
||||||
|
-Wl,-rpath,$(SPDK_ROOT_DIR)/build/lib \
|
||||||
|
-Wl,-rpath,$(SPDK_ROOT_DIR)/dpdk/build/lib
|
||||||
|
SYS_LIBS += -ldl
|
||||||
|
|
||||||
|
|
||||||
|
all: $(LIBZVFS) $(APP)
|
||||||
|
@:
|
||||||
|
|
||||||
|
$(LIBZVFS): $(OBJS) $(SPDK_LIB_FILES) $(ENV_LIBS)
|
||||||
|
$(LINK_C)
|
||||||
|
|
||||||
|
$(APP): func_test.c
|
||||||
|
$(CC) -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(CLEAN_C) $(LIBZVFS) $(APP)
|
||||||
|
|
||||||
|
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk
|
||||||
@@ -16,8 +16,8 @@ static double time_diff_sec(struct timespec a, struct timespec b)
|
|||||||
|
|
||||||
static int test_single_file_perf(const char *path)
|
static int test_single_file_perf(const char *path)
|
||||||
{
|
{
|
||||||
// size_t io_size = 128 * 1024;
|
size_t io_size = 128 * 1024;
|
||||||
size_t io_size = 4096;
|
// size_t io_size = 4096;
|
||||||
size_t max_size = 2ULL * 1024 * 1024 * 1024; /* 最大 2GB,循环覆写 */
|
size_t max_size = 2ULL * 1024 * 1024 * 1024; /* 最大 2GB,循环覆写 */
|
||||||
size_t max_count = max_size / io_size;
|
size_t max_count = max_size / io_size;
|
||||||
int test_sec = 10;
|
int test_sec = 10;
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct spdk_thread *global_thread = NULL;
|
struct spdk_thread *global_thread = NULL;
|
||||||
const char *json_file = "/home/lian/share/10.1-spdk/zvfs/zvfs.json";
|
const char *json_file = "/home/lian/share/10.1-spdk/zvfs/zvfs/zvfs.json";
|
||||||
|
|
||||||
// mount
|
// mount
|
||||||
void zvfs_do_mount(void *arg);
|
void zvfs_do_mount(void *arg);
|
||||||
@@ -599,7 +599,7 @@ int zvfs_env_setup(void) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_log_set_print_level(SPDK_LOG_NOTICE);
|
spdk_log_set_print_level(SPDK_LOG_ERROR);
|
||||||
spdk_log_set_level(SPDK_LOG_NOTICE);
|
spdk_log_set_level(SPDK_LOG_NOTICE);
|
||||||
spdk_log_open(NULL);
|
spdk_log_open(NULL);
|
||||||
|
|
||||||
Reference in New Issue
Block a user