-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make simple example will fail if I enable the metadata cache hash debug #370
Comments
I have fixed the build error, it is my type error. but after I enable metadata cache hash debug. I suffer the core crash from simple example. it is very easy to reproduce, could you please help? include Makefile simple src |
Thank you for reporting this problem. We will investigate this. |
thank you so much. here is stact trace for the core dump. |
and also, I cannot understand the metadata layout design detail. what is the seq mode what is the stripping mode. is there any debug message to help me understand better for these? |
@gwnet The difference between seq and stripping mode is that in the seq mode the metadata for consecutive cache lines is written under consecutive addresses, while in stripping mode metadata for consecutive cache lines is written on consecutive pages. For example in seq mode if metadata record size is 32 bytes, then metadata for cache lines 0, 1 and 2 will be written at offsets 0, 32 and 64 respectively. On the other hand in stripping mode, assuming metadata record size of 32 bytes and page size of 4096 bytes, metadata for cache lines 0, 1 and 2 will be written at offsets 0, 4096 and 8192 respectively. Then after reaching end of metadata section it starts from beginning shifted by one record, e.g 32, 4128, 8224... effectively forming "stripes" across all the pages in metadata section. Seq:
Stripping:
|
thank you so much!~ I can understand your example now. but what is benefit of seq and stripping, how we pick seq or stripping based on the real scenario? |
@gwnet Based on empirical observations, using stripping can improve performance on some types of NAND drives. |
@robertbaldyga Thank you so much. |
@gwnet Regarding to erase before write policy differences - that might be the case. |
thank you so much. I got it. :) I have another perf issue, I will open new issue. :) |
Initial issue: debug macros, to be resolved with P3. |
===if I change OCF_METADATA_HASH_DEBUG as 1.
#define OCF_METADATA_HASH_DEBUG 0
#if 1 == OCF_METADATA_HASH_DEBUG
#define OCF_DEBUG_TRACE(cache)
ocf_cache_log(cache, log_info, "[Metadata][Hash] %s\n", func)
#define OCF_DEBUG_PARAM(cache, format, ...)
ocf_cache_log(cache, log_info, "[Metadata][Hash] %s - "format"\n",
func, ##VA_ARGS)
#else
===== then I suffer below build error ==== could you please help?
===== or can you show me to how to understand and debug metadata hash map easily?
and also I see there is RB-Tree in the code, what is it for?
gcc -g -Wall -Iinclude/ -Isrc//ocf/env/ -c -o src/ocf/eviction/eviction.o src/ocf/eviction/eviction.c
gcc -g -Wall -Iinclude/ -Isrc//ocf/env/ -c -o src/ocf/eviction/lru.o src/ocf/eviction/lru.c
gcc -g -Wall -Iinclude/ -Isrc//ocf/env/ -c -o src/ocf/metadata/metadata.o src/ocf/metadata/metadata.c
gcc -g -Wall -Iinclude/ -Isrc//ocf/env/ -c -o src/ocf/metadata/metadata_collision.o src/ocf/metadata/metadata_collision.c
gcc -g -Wall -Iinclude/ -Isrc//ocf/env/ -c -o src/ocf/metadata/metadata_hash.o src/ocf/metadata/metadata_hash.c
src/ocf/metadata/metadata_hash.c:2:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘-’ token
^
In file included from src/ocf/metadata/../ocf_cache_priv.h:13:0,
from src/ocf/metadata/metadata.h:10,
from src/ocf/metadata/metadata_hash.c:5:
src/ocf/metadata/../metadata/metadata_structs.h:193:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/../metadata/metadata_structs.h:203:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/../metadata/metadata_structs.h:213:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/../metadata/metadata_structs.h:245:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/../metadata/metadata_structs.h:248:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/../metadata/metadata_structs.h:251:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
In file included from src/ocf/metadata/metadata.h:16:0,
from src/ocf/metadata/metadata_hash.c:5:
src/ocf/metadata/metadata_superblock.h:68:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_superblock.h:75:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_superblock.h:81:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
In file included from src/ocf/metadata/metadata_hash.c:5:0:
src/ocf/metadata/metadata.h:124:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/metadata.h:155:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/metadata.h:165:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
In file included from src/ocf/metadata/metadata_hash.c:7:0:
src/ocf/metadata/metadata_raw.h:130:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/metadata_raw.h:133:4: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv);
^
src/ocf/metadata/metadata_raw.h:287:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_raw.h:302:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_calculate_metadata_size’:
src/ocf/metadata/metadata_hash.c:246:2: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘int64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, "Cache lines = %lld", cache_lines);
^
src/ocf/metadata/metadata_hash.c:314:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘int64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, "Diff pages = %lld", diff_lines);
^
src/ocf/metadata/metadata_hash.c:315:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘int64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, "Cache lines = %lld", cache_lines);
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_raw_info’:
src/ocf/metadata/metadata_hash.c:368:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 6 has type ‘uint64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, " : entries = %llu",
^
src/ocf/metadata/metadata_hash.c:372:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 6 has type ‘uint64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, " : page offset = %llu",
^
src/ocf/metadata/metadata_hash.c:374:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 6 has type ‘uint64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, " : pages = %llu",
^
src/ocf/metadata/metadata_hash.c:394:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 7 has type ‘uint64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, "%s capacity %llu %s",
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_config_init’:
src/ocf/metadata/metadata_hash.c:440:2: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 7 has type ‘uint64_t’ [-Wformat=]
OCF_DEBUG_PARAM(cache, "Cache line size = %lu, bits count = %llu, "
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:1192:2: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl;
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_medatata_hash_load_segment’:
src/ocf/metadata/metadata_hash.c:1216:2: warning: implicit declaration of function ‘ocf_metadata_raw_load_all’ [-Wimplicit-function-declaration]
ocf_metadata_raw_load_all(cache, &ctrl->raw_desc[segment],
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_load_superblock_finish’:
src/ocf/metadata/metadata_hash.c:1387:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:1439:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_medatata_hash_flush_segment’:
src/ocf/metadata/metadata_hash.c:1537:2: warning: implicit declaration of function ‘ocf_metadata_raw_flush_all’ [-Wimplicit-function-declaration]
ocf_metadata_raw_flush_all(cache, &ctrl->raw_desc[segment],
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_flush_superblock_finish’:
src/ocf/metadata/metadata_hash.c:1550:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:1587:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c:1620:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_medatata_hash_flush_all_set_status’:
src/ocf/metadata/metadata_hash.c:1681:2: warning: implicit declaration of function ‘ocf_metadata_hash_set_shutdown_status’ [-Wimplicit-function-declaration]
ocf_metadata_hash_set_shutdown_status(cache, shutdown_status,
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_flush_all_finish’:
src/ocf/metadata/metadata_hash.c:1701:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:1737:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_load_all_finish’:
src/ocf/metadata/metadata_hash.c:1829:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:1859:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_load_recovery_legacy_finish’:
src/ocf/metadata/metadata_hash.c:2001:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:2018:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c: In function ‘ocf_metadata_hash_load_recovery_atomic_finish’:
src/ocf/metadata/metadata_hash.c:2143:15: error: called object is not a function or function pointer
context->cmpl(context->priv, error);
^
src/ocf/metadata/metadata_hash.c: At top level:
src/ocf/metadata/metadata_hash.c:2162:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c:2189:3: error: unknown type name ‘ocf_metadata_end_t’
ocf_metadata_end_t cmpl, void *priv)
^
src/ocf/metadata/metadata_hash.c:2724:2: error: unknown field ‘flush_all’ specified in initializer
.flush_all = ocf_metadata_hash_flush_all,
^
src/ocf/metadata/metadata_hash.c:2724:15: error: ‘ocf_metadata_hash_flush_all’ undeclared here (not in a function)
.flush_all = ocf_metadata_hash_flush_all,
^
src/ocf/metadata/metadata_hash.c:2727:2: error: unknown field ‘load_all’ specified in initializer
.load_all = ocf_metadata_hash_load_all,
^
src/ocf/metadata/metadata_hash.c:2727:14: error: ‘ocf_metadata_hash_load_all’ undeclared here (not in a function)
.load_all = ocf_metadata_hash_load_all,
^
src/ocf/metadata/metadata_hash.c:2728:2: error: unknown field ‘load_recovery’ specified in initializer
.load_recovery = ocf_metadata_hash_load_recovery,
^
src/ocf/metadata/metadata_hash.c:2728:19: error: ‘ocf_metadata_hash_load_recovery’ undeclared here (not in a function)
.load_recovery = ocf_metadata_hash_load_recovery,
^
src/ocf/metadata/metadata_hash.c:2733:2: error: unknown field ‘set_shutdown_status’ specified in initializer
.set_shutdown_status = ocf_metadata_hash_set_shutdown_status,
^
src/ocf/metadata/metadata_hash.c:2733:25: error: ‘ocf_metadata_hash_set_shutdown_status’ undeclared here (not in a function)
.set_shutdown_status = ocf_metadata_hash_set_shutdown_status,
^
src/ocf/metadata/metadata_hash.c:2734:2: error: unknown field ‘flush_superblock’ specified in initializer
.flush_superblock = ocf_metadata_hash_flush_superblock,
^
src/ocf/metadata/metadata_hash.c:2734:22: error: ‘ocf_metadata_hash_flush_superblock’ undeclared here (not in a function)
.flush_superblock = ocf_metadata_hash_flush_superblock,
^
src/ocf/metadata/metadata_hash.c:2735:2: error: unknown field ‘load_superblock’ specified in initializer
.load_superblock = ocf_metadata_hash_load_superblock,
^
src/ocf/metadata/metadata_hash.c:2735:21: error: ‘ocf_metadata_hash_load_superblock’ undeclared here (not in a function)
.load_superblock = ocf_metadata_hash_load_superblock,
^
make[1]: *** [src/ocf/metadata/metadata_hash.o] Error 1
make[1]: Leaving directory `/home/wayne/open-cas-linux/ocf/example/simple'
make: *** [all] Error 2
[root@localhost simple]#
Socket error Event: 32 Error: 10053.
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(10.239.70.152-lab) at 20:40:05.
Type `help' to learn how to use Xshell prompt.
[C:~]$
The text was updated successfully, but these errors were encountered: