Sequence counter
2026-5-29
Sequence counter是内核的一个读写同步机制。内核描述:a reader-writer consistency mechanism with lockless readers (read-only retry loops), and no writer starvation.用在几乎不写
gcc show marco content
2026-5-29
#define str2(x) #x#define str(x) str2(x) #pragma message str(seqprop_preemptible(&d_seq))
使用bmon监视网络速度
2026-5-29
sudo bmon
negative dentry
2026-6-1
dentry有一个d_flags字段,dentry最重要的状态,保存在这个flags里面。这个d_flags,有时由dentry->d_lock保护。有时由dentry->d_seq保护。有时由smp_load_acquire()读取有时又直接访问。核心思想理解:dentry处于不同的状态下,用不同
inode lifetime
2026-5-27
本文阅读fs/inode.c,进行学习。new inode分配inode一般在fs的lookup函数,或者create函数中,调用new_inode(sb)分配inode,然后fill inode,初始化inode的fops等成员。fs/inode.cstruct inode *new_inode(
CAS (compare and swap)
2026-6-10
CAS是计算机科学中的一个重要概念,用来实现锁机制和原子操作等。先来看一个例子:long v = 0;long count = 1000000;void thread1(){ for (int i = 0; i < count; i++) v++;}void threa
load acquire / store release
2026-6-12
C+11 memory model中提到了relaxed/acquire/release等内存模型。GCC提供了Memory Model Aware Atomic Operations的内置函数 Built-in Functions.原子操作内存模型有:__ATOMIC_RELAXED__ATOMI
on same cacheline, arm may be strong memory order
2026-6-13
众所周知arm是weakly ordered CPU. 参考1给出了详细的例子。也就是说在CPU0: X = 1; Y = 1;CPU1: if (Y == 1) assert(x == 1);由于X = 1; 可能发生在Y = 1; 后面。所以CPU1观察到Y = 1时,X可能还不是1,所以断言会
software RAID
2026-6-17
官方名称:RAID arraysMD (multiple device)内核选项:+CONFIG_MD=y+CONFIG_BLK_DEV_MD=m+# CONFIG_MD_BITMAP_FILE is not set+CONFIG_MD_LINEAR=m+CONFIG_MD_RAID0=m+CONF
Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.