.ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516" .section .note.GNU-stack,"",@progbits```可以看到__sync_fetch_and_add 的汇编实现就是在 add 指令前声明了 lock 指令前缀。#### 1.2.2 Kernel 中的原子累加Kernel 中的 atomic_inc 函数,把参数 v 指向的内存数据进行进行加 1。```static __always_inline voidatomic_inc(atomic_t *v){ instrument_atomic_read_write(v, ...