计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
Kernel【效率与协作】Avoid common Linux kernel mistakes — atomic context violations, allocation failures, and locking traps.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
spin_lock held = cannot sleep — no kmalloc(GFP_KERNEL), no mutex_lock, no copy_from_userspin_lock_irqsave, not plain spin_lockrcu_read_lock() section cannot sleep — no blocking calls inside RCU read-sidemight_sleep() annotation — add to functions that may sleep, catches bugs with CONFIG_DEBUG_ATOMIC_SLEEPGFP_ATOMIC can return NULL — always check, don't assume successvmalloc memory not physically contiguous — cannot use for DMAkzalloc over kmalloc — uninitialized memory leaks kernel info to userspacecopy_from_user returns bytes NOT copied — 0 means success, not failure%s with user pointer in printk — kernel crash or info leak__user annotation is documentation — doesn't enforce anything, you must use copy functionsREAD_ONCE/WRITE_ONCE for lockless shared data — prevents compiler from caching/reorderingsmp_wmb() before publishing pointer — ensures data visible before pointer isgoto err_* pattern standard — cleaner than nested ifsmutex_trylock returns 1 on success — opposite of pthread_mutex_trylock