12 2021 档案
摘要:struct pid & pid_namespace alloc_pid() & task_struct插入pid struct tasks[] hash list fork进程/线程时,copy_process()会给此线程alloc一个struct pid结构体。当是fork进程/线程时,cop
阅读全文
摘要:CPU cache Linux内存管理:ARM64体系结构与编程之cache(1) https://www.codenong.com/cs109826497/ http://www.wowotech.net/memory_management/458.html?from=timeline
阅读全文
摘要:kernel exception时打印出的ESR相关信息 <1>[ 7766.006249] Unhandled fault at 0xffffff800188d408 <1>[ 7766.006256] Mem abort info: <1>[ 7766.006259] ESR = 0x86000
阅读全文
摘要:write-back/write-through/write-allocate/write-no-allocate CPU读Cache时 ●若hit,则CPU直接从Cache中读取数据即可。 ●若miss,有两种处理方式: >Read through,即直接从内存中读取数据; >Read alloc
阅读全文
摘要:Understand the “Write Hit” and “Write Miss” in Symmetrix A Write Hit, also called Write Pending Write which happens when there is sufficient room in c
阅读全文
摘要:VFS四大struct:file、dentry、inode、super_block dentry dentry有什么作用?dentry保存了目录/文件到inode的映射,在open一个文件时,如果路径上的某个目录或者最后的文件没有对应的dentry,则会为其建立dentry并插入dentry has
阅读全文
摘要:open系统调用flow之do_last() 本文章来分析下open file系统调用最后一个主要的函数do_last() open系统调用来到do_last()时,主要看其nd参数,这个结构体里的path、last成员,此时的path表示open file完整路径最低一级路径,last表示open
阅读全文
摘要:vfs open系统调用flow之link_path_walk() do_filp_open()里将pathname保存到nameidata里,pathname是open file的完整路径名,调用path_openat,此时是flags是带了LOOKUP_RCU flag的 struct file
阅读全文
摘要:vfs open系统调用flow之具体文件系统lookup(ext4 fs lookup) ext4_lookup static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsigned int fla
阅读全文
摘要:vfs open系统调用flow之overall 最近在看vfs open系统调用的flow,这个flow也是比较的复杂了,涉及到open file path的解析、四大struct(file、dentry、inode、super_block)。 而且open系统调用会建立很多关系,比如如果某个文件
阅读全文
摘要:ARM GIC V3 gic_raise_softirq MPIDR_LEVEL_SHIFT(level) MPIDR_LEVEL_SHIFT(0) = (((1 << 0) >> 1) << 3) = 0 MPIDR_LEVEL_SHIFT(1) = (((1 << 1) >> 1) << 3)
阅读全文
摘要:softirq raise/处理 调用raise_softirq_irqoff(HRTIMER_SOFTIRQ)触发一个softirq,这个函数会将local_softirq_pending_ref (int型)per cpu变量对应bit置1,如果当前不在interrupt context(sof
阅读全文
摘要:hr timer 什么是hr timer(高精度定时器) https://blog.csdn.net/walkingman321/article/details/6151172 hr timer interrupt handler hrtimer interrupt handler is hrtim
阅读全文
摘要:per cpu variable per cpu变量可以export出来给其它模块使用 方法: 1.define per cpu variable DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}}; EXPORT_PER_C
阅读全文
摘要:migration/* kernel thread用途 console:/proc/13 # ps -Af |grep migration root 13 2 0 02:29:43 ? 00:00:00 [migration/0] root 16 2 0 02:29:43 ? 00:00:00 [m
阅读全文
摘要:soft lookup检测机制 soft lookup是如何检测的,它实现的文件在kernel/watchdog.c 它主要是会起一个hrtimer定时器,周期性产生hrtimer interrupt,这个irq handler函数是watchdog_timer_fn() 在这个irq handle
阅读全文
摘要:sched misc 查看sched信息命令 cat /proc/sched_debugcat /proc/schedstatsysctl:/proc/sys/kernel/sched_*sched_child_runs_first sched_rt_period_ussched_domain/ s
阅读全文
摘要:ext4 fs 关于ext4文件系统概述 https://www.cnblogs.com/eflypro/p/14075188.html
阅读全文
摘要:read file page cache generic_file_buffered_read()里的index表示此次read文件的位置,在要读的某个文件里的位置,这个index是以page为单位的last_index表示此次read的结束位置,同样其单位是page 这两个变量的值分别是根据kio
阅读全文
摘要:get_cpu_mask /* cpu_bit_bitmap[0] is empty - so we can back into it */ #define MASK_DECLARE_1(x) [x+1][0] = (1UL << (x)) #define MASK_DECLARE_2(x) MAS
阅读全文
摘要:struct arch_hw_breakpoint结构体 watchpoint or breakpoint(type)、watchpoint监测的数据长度、监测的地址,这些信息都保存在arch_hw_breakpoint结构体里 struct arch_hw_breakpoint { u64 add
阅读全文
摘要:cpumask struct cpumask __cpu_possible_mask struct cpumask __cpu_possible_mask在一个4core的SOC上面低4bit分别表示cpu0-cpu3,表示一个系统上配置了多少个cpu(core),不管它的状态是active还是in
阅读全文
摘要:kernel BUG_ON macro的实现以及brk指令触发异常后的异常处理callstack kernel里的两个macro BUG_ON(condition),如果condition条件满足,判断为真,则会造成一个debug exception; BUG(),这个没有条件判断,调用它则会直接造
阅读全文