NJSD eBPF 技术文档 - 0924版本• 问题 • 相对kernel⽂件系统的实现(ext4, xfs)性能 差异⼤,延迟⾼FUSE⽂件IO读写流程 • 场景1 pytorch example word_language_model • LOOKUP inode 返回 fstat + timeout设置 • OPEN 打开 inode返回ok • GETATTR 返回fstat • READ inode 读取的内容不等从16KB到128KB CacheStatus, blocklist[ ] {fd, chunk, size, kernel file, ver} • ReadCache map BPF_MAP_TYPE_HASH • key inodeid • value CacheStatus, filemap[ ] {fd, chuk, size, kernel file, ver} • update list map0 码力 | 20 页 | 7.40 MB | 6 月前3
CurveFS Client 概要设计fuse_entry_param,返回给fuse write void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf, size_t size, off_t off, struct fuse_file_info *fi); 首先根据inode id 从缓存中查找到对应inode结构; 如果inode缓存中不存在对应的inode, 则从mds获取inode所在copyset,metaserver ip等信息,然后从metaserver获取inode结构,缓存之; 判断inode结构中,对应请求[off, size]位置的空间是否有分配:如果未分配或只有部分分配空间,则调用空间分配器分配空间,并根据空间分配器返回结果,修改inode结构(包括file length); inode修改需要持久化到底层并修改本地cache; 调用curve e修改需要持久化到底层并修改本地cache;© XXX Page 6 of 11 read void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi); 首先根据inode id 从缓存中查找到对应inode结构; 如果inode缓存中不存在对应的inode,0 码力 | 11 页 | 487.92 KB | 6 月前3
CurveFs 用户权限系统调研protocol (read-only) */ unsigned proto_minor; /** * Maximum size of the write buffer */ unsigned max_write; /** * Maximum size of read requests. A value of zero indicates no * limit. However filesystem does not specify a * limit, the maximum size of read requests will still be * limited by the kernel. * * NOTE: For the time being, the maximum size of read requests© XXX Page 11 of 33 * must 。目前Linux 的 ACL 存储实现就是基于这种扩展属性的。 Inode Table中保存有若干个 Ext4_inode ,每个 Inode 大小为 ext4_super_block 中指定的 s_inode_size, 然而一个 Inode 不一定用到这么多的大小,节点信息只用到 128 个字节的空间。剩下的部分作为扩展文件属性 (Xattr),扩展属性内部是由一个扩展属性头和若干个扩展属性实体项构成的。© XXX0 码力 | 33 页 | 732.13 KB | 6 月前3
Open Flags 调研flags, mode_t mode); int openat2(int dirfd, const char *pathname, const struct open_how *how, size_t size); open系统调用会打开pathname指定的文件(如果不存在,如果携带O_CREAT flag则会创建),返回一个文件描述符fd(该fd是进程打开文件描述符表的index),在后续系 Page 22 of 23 // chubaofs writeflush func cfs_write(id C.int64_t, fd C.int, buf unsafe.Pointer, size C.size_t, off C.off_t) C.ssize_t { ... var wait bool if f.flags&uint32(C.O_DIRECT) != 0 || f.flags&uint32(C offset, uint64_t size, const char *buf, const struct iovec *iov, int iovcnt) { ... if ((f->flags & O_SYNC) || (f->flags & O_DSYNC)) { _flush_range(in, offset, size); } } else0 码力 | 23 页 | 524.47 KB | 6 月前3
CurveBS IO Processing Flowof 0 to 4MB in /dev/sda, and chunk2 corresponds to the address space of 4 to 8MB in /dev/sda. The size of chunk can be configured 3. Each file (/foo/bar) contains chunks scattered all over the storage CurveBS consists of chunks. The default size of chunk is 16MB. If the file directly maps to chunk, a 4TB file will consist of 256KB chunks when the chunk size is set to 16MB. There will be lots of granularity of space allocation. Multiple chunks are aggregated into one segment. The default segment size can be 1GB. it only requires 4KB segments for a 4TB file, according to 4KB records in KV. The0 码力 | 13 页 | 2.03 MB | 6 月前3
Curve核心组件之snapshotclone快照目标卷名 snapshotName string 快照名 seqNum uint64_t 快照版本号 chunkSize uint32_t chunk的size segmentSize uint64_t segment的size fileLength uint64_t 卷的大小 time uint64_t 快照创建时间 status enum 快照的创建状态 Etcd中的快照元数据:快照的元数据和数据组织 version uint8_t 文件格式协议版本号 sn uint64_t chunk文件的版本号 correntSn uint64_t chunk的修正版本号 locationSi ze size_t 可缺省,当前为CloneChunk时表示 location占用的字节数 location char[] 可缺省,当前为CloneChunk时表示 克隆源字段 bits uint32_t0 码力 | 23 页 | 1.32 MB | 6 月前3
Curve文件系统空间分配方案11 message AllocateSpaceRequest { required uint64 fsId = 1; // ID required uint32 size = 2; // optional AllocateHint allocHint = 3; } message AllocateSpaceResponse { required * @brief * * @param size * @param allocateHint * @param extents * @return uint64_t */ virtual uint64_t Allocate(uint32_t size, const AllocateHint& allocateHint0 码力 | 11 页 | 159.17 KB | 6 月前3
Curve文件系统元数据持久化方案设计Raft Snapshot +---------+---------+------+-----------------+-----+-----------+ | CURVEFS | version | size | key_value_pairs | EOF | check_sum | +---------+---------+------+-----------------+-----+-----------+ "CURVEFS"),用于标识该文件为 curvefs 元数据持久化文件 version 4 文件版本号(当文件格式变化时,可以 100% 向后兼容加载旧版持久化文件) size 8 键值对数量 key_value_pairs / 键值对(当 size 为 0 时,该字段为空) EOF 1 特殊标记常量 (0XFF),表示内容已结束 check_sum 8 保存校验和 (根据前 5 个部分内容计算得出)0 码力 | 12 页 | 384.47 KB | 6 月前3
Curve支持S3 数据缓存方案uint64 offset = 3; required uint64 len = 4; // file logic length required uint64 size = 5; // file size in object storage }; message Inode { required uint64 inodeId = 1; required uint32 write流程会对后台线程处于wait状态的情况触发notify唤醒,同时修改DataCacheNum_。 3.后台会遍历DataCache,达到flushwait的时间,或者DataCache size为chunksize,满足一个条件则调用DataCache的flush。 4.更新元数据,清理DataCache缓存,DataCacheNum_减1。 5.遍历完一轮DataCache后,获取Da0 码力 | 9 页 | 179.72 KB | 6 月前3
TGT服务器的优化group_reporting • [disk01] • filename=/dev/sdx • [disk02] • filename=/dev/sdy • size=10G • [disk03] • filename=/dev/sdz • size=10GTgt优化前的FIO性能Tgt优化后的FIO性能0 码力 | 15 页 | 637.11 KB | 6 月前3
共 15 条
- 1
- 2













