Friday 15 December 2023

read / copy / update

OSの授業で、Linux kernel 読んでたんですが、最近は syscall dispatch 部分は C なので。

いや、あれは C っていうのかは微妙ではあるか。

Fedoraのdebug build な kernel な VMと、gdb で読む環境が singularity で用意してあるのでばっちりです。

で、fd_get から読んでくわけですが、記憶とかなり違う。いや、昔は syscall table は C のマクロとかじゃなかった。

で、

 635 * read-side critical sections may be preempted and they may also block, but
 636 * only when acquiring spinlocks that are subject to priority inheritance.
 637 */
 638 static __always_inline void rcu_read_lock(void)
 639 {
 640 __rcu_read_lock();
 641 __acquire(RCU);
 642 rcu_lock_acquire(&rcu_lock_map);
 643 RCU_LOCKDEP_WARN(!rcu_is_watching(),
 644 "rcu_read_lock() used illegally while idle");
  what is rcu?

 ChatGPT
 RCU, which stands for "Read-Copy-Update," is a synchronization mechanism used in computer programming, particularly in operating

あぁ、copy on write みたいなのが file write にもあって、それを rcu って呼んでるのか。

意外だけど、教科書にはないな。

No comments: