摘要: DPDK eal初始化 内存管理:大页,内存池 驱动 开启调试信息 make config T=x86_64-native-linuxapp-gcc export EXTRA_CFLAGS='-O0 -g3 -ggdb' make -j8 dpdk通过makefile编译 meson + ninja 阅读全文 »
posted @ 2025-02-23 21:06 yghr 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 概述 fbarray是一个固定大小的多进程共享的内存块数组。 struct rte_fbarray { char name[RTE_FBARRAY_NAME_LEN]; /**< name associated with an array */ unsigned int count; /**< nu 阅读全文 »
posted @ 2024-12-08 17:15 yghr 阅读(19) 评论(0) 推荐(0) 编辑
摘要: mesh结构 msg_cache + rr_cache缓存数据 msg_cache里的entry是msgreply_entry,rr_cache里的entry是ub_packed_rrset_key。 ub_packed_rrset_key的rrset_id_type通过alloc_get_id方法 阅读全文 »
posted @ 2024-11-05 00:06 yghr 阅读(16) 评论(0) 推荐(0) 编辑
摘要: unbound入口在run_daemon方法。 daemon_init方法,分配struct daemon结构体,设置信号处理方法,初始化openssl库,设置时区,设置daemon->need_to_exit为0,初始化模块栈(modstack_init方法)设置deamon->mods结构体(s 阅读全文 »
posted @ 2024-11-05 00:04 yghr 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 在一个pthread_once方法内又再次调用了这个pthread_once导致死锁。 分析下这个pthread_once的源码: 可以看到这个pthread_once_t结构体就是一个整形数字加自旋锁。 int ___pthread_once (pthread_once_t *once_contr 阅读全文 »
posted @ 2024-08-06 23:46 yghr 阅读(25) 评论(0) 推荐(0) 编辑
摘要: gcc函数调用 进入一个函数后的栈布局 /* + + | 第6个参数后的参数(如果有) | + + | 返回地址(调用函数的下一个指令)| + + | 上一个函数rbp | + + | 当前函数局部变量 | + + */ makecontext方法实现 void __makecontext (uco 阅读全文 »
posted @ 2024-07-31 23:40 yghr 阅读(24) 评论(0) 推荐(0) 编辑
摘要: unbound可以通过配置文件中的cache-max-ttl来设置缓存的最大缓存时间,这个会保存MAX_TTL全局变量(默认值是10天)。 unbound在处理递归响应时的调用链是comm_point_udp_callback -> outnet_udp_cb -> serviced_udp_cal 阅读全文 »
posted @ 2024-06-14 01:09 yghr 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 对进程进行采集,采集后会在当前目录下生成一个perf.data文件 perf record -e cpu-clock --call-graph dwarf [-t 线程id] [-p 进程id] 这里只针对cpu时间进行了采样,通过perf list命令还可以看到更多采样事件。 简单分析 perf 阅读全文 »
posted @ 2024-06-09 19:18 yghr 阅读(31) 评论(0) 推荐(0) 编辑
摘要: localtime方法会加锁,当TZ环境变量为空或者变更时,还会读取文件,还有个问题就是这个方法返回的指针是一个全局变量,可以使用redis无锁的localtime方法来优化这个性能。 localtime方法调用链:localtime -> __localtime64 -> __tz_convert 阅读全文 »
posted @ 2024-06-09 19:05 yghr 阅读(122) 评论(0) 推荐(0) 编辑
摘要: redis 5.0 命令处理流程 初始化事件驱动数据结构: initServer 中调用 aeCreateEventLoop 方法初始化 server.el 属性,然后调用 listenToPort 方法设置 listen 的 fd,并为这些 fd 绑定读事件 anetTcpHandler。 ane 阅读全文 »
posted @ 2024-03-31 22:46 yghr 阅读(18) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示