- 博客(34)
- 资源 (9)
- 收藏
- 关注
原创 调度子系统1_调度子系统初始化
unsigned int sysctl_sched_rt_period = 1000000;int sysctl_sched_rt_runtime = 950000;// 参考:// SMP负载均衡// http://soft.chinabyte.com/os/22/12359522.shtml// linux组调度浅析// http://hi.baidu.com/_kouu
2013-11-29 19:55:09 2552 1
原创 时间子系统17_hard lockup机制
// 使能hard lockup探测// 调用路径:watchdog_enable->watchdog_nmi_enable// 函数任务:// 1.初始化hard lockup检测事件// 2.hard lockup阈值为10s// 2.向performance monitoring子系统注册hard lockup检测事件// 3.使能hard lockup检测事件//
2013-11-28 14:38:48 2822
原创 时间子系统16_soft lockup机制
// 1.debug选项LOCKUP_DETECTOR,开启/关闭kernel中的soft lockup和hard lockup探测// 2.实现:kernel/watchdog.c// 3.实现原理:// 1.涉及到了3部分内容:kernel线程,时钟中断,NMI中断// 优先级:kernel线程 < 时钟中断 < NMI中断。// 2.利用它们之间优先级的区别,调试系统运行
2013-11-28 13:34:51 2499
原创 时间子系统15_获取系统时间
// 获取系统时间// 注:将timespec转换为timeval1.1 void do_gettimeofday(struct timeval *tv){ struct timespec now; getnstimeofday(&now); tv->tv_sec = now.tv_sec; tv->tv_usec = now.tv_nsec/1000;}// 获取纳秒级系统时
2013-11-27 21:51:06 1828
原创 时间子系统14_全局时间维护
// 更新全局时间// 函数任务:// 1.更新last_jiffies_update,记录距离上次更新jiffies经历的ns// 2.更新jiffies_64,墙上时间,计算cpu负载// 3.更新下次周期时钟的到期时间// 注:// 1.在关中断情况下调用该函数// 2.last_jiffies_update,记录距离上次更新经历的时钟周期(ns)1.1 stati
2013-11-27 20:47:56 1737
原创 时间子系统13_clockevent周期触发模式
// 设置clockevent周期处理函数// 函数参数:// broadcast,指示此设备是否为全局广播设备// 调用路径:tick_setup_periodic->tick_set_periodic_handler1.1 void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast){
2013-11-26 19:41:01 2175
原创 时间子系统12_clockevent设备注册
// 向系统注册时钟事件设备// 函数任务:// 1.添加设备到clockevent_devices链表// 2.通知tick device管理机制有clockevent设备注册1.1 void clockevents_register_device(struct clock_event_device *dev){ unsigned long flags; raw_spin_l
2013-11-26 19:40:28 1602
原创 时间子系统11_tsc时钟初始化
// tsc时钟源初始化// 调用路径:time_init->tsc_init// 函数任务:// 1.矫正tsc,获取tsc频率,设置cpu频率等于tsc频率// 2.初始化基于tsc的延迟函数// 3.检查tsc的特性// 3.1 tsc之间是否同步// 3.1.1 如果tsc之间不同步,标记tsc不稳定,设置rating=0// 3.2 tsc是否稳定/
2013-11-26 00:38:01 3805
原创 时间子系统10_hpet时钟初始化
// 时钟mult :mult/2^shift = ns/cyc // 参考:http://www.bluezd.info/archives/reg_clock_event_device_1// x86平台初始化// 注:arch/x86/kernel/x86_init.c1.1 struct x86_init_ops x86_init __initdata = { ... /
2013-11-26 00:34:58 2847
原创 时间子系统9_timekeeper初始化
//Timekeeping// Timekeeping子系统负责更新xtime, 调整误差, 及提供get/settimeofday接口.//Times in Kernel//kernel的time基本类型:// 1) system time// A monotonically increasing value that represents the amount of time th
2013-11-25 20:09:32 1504
原创 时间子系统8_动态时钟(NO_HZ)
// 高分辨率模式下的周期事件仿真// 通过hrtimer仿真周期时钟,由hrtimer_interrupt作为时钟事件处理函数// 函数任务:// 1.更新jiffies// 2.在irq上下文// 2.1 如果当前处于idle状态// 2.1.1 喂狗softlockup_watchdog,防止误发生softlockup// 2.1.2 更新idle状态经历
2013-11-25 12:23:57 2352
原创 时间子系统7_高分辨率定时器处理
// 高分辨率下的定时器软中断// 当增加一个hrtimer到rbtree中后,会raise高分辨率定时器软中断// 函数任务:// 1.关中断下,运行所有hrtimer// 注:// 在hrtimers_init中,open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq); 1.1 static void run_hrtimer_s
2013-11-25 10:43:04 1722
原创 时间子系统6_高分辨率定时器框架初始化
// 高分辨率定时器框架初始化// 调用路径:start_kernel->hrtimers_init// 函数任务:// 1.创建cpu时钟基础// 2.注册监听cpu状态变化// 3.注册高分辨率模式下的定时器软中断// 注:// 1.高分辨率定时器框架的通用部分总是编译进内核// 2.高分辨率定时器框架初始为未激活状态,由低分辨率定时器软中断中切换到高分辨率1.1
2013-11-23 10:13:56 1613
原创 时间子系统5_低分辨率切换高分辨率
// 切换低分辨率动态时钟模式、或高分辨率模式// 调用路径:run_timer_softirq->hrtimer_run_pending// 函数任务:// 1.如果高分辨率定时器框架已经激活,则直接返回// 2.切换到高分辨率模式的条件:// 2.1 没有开启低分辨率动态时钟// 2.2 有高分辨率的clocksource// 2.3 clockevent设备支持
2013-11-22 20:16:07 1840
原创 时间子系统4_低分辨率定时器处理
// 触发低分辨率定时器软中断// 调用路径:update_process_times->run_local_timers// 注:// 1.update_process_times以HZ频率被调用,因此低分辨率定时器的分辨率为HZ// 2.当未激活高分辨率定时器框架时,高分辨率定时器在时钟中断被运行,因此高分辨率定时器的分辨率也HZ1.1 void run_local_timers
2013-11-22 10:28:02 1534
原创 时间子系统3_低分辨率定时框架初始化
// 低分辨率定时器框架初始化// 调用路径:start_kernel->init_timers// 函数任务:// 1.创建当前cpu的定时器框架数据结构// 2.监听cpu状态信息// 3.注册低分辨率软中断1.1 void __init init_timers(void){ //创建当前cpu的定时器框架数据结构 int err = timer_cpu_notify(
2013-11-21 21:19:31 1727
原创 时间子系统2_tick device管理机制
// 1.每个cpu都具有一个tick_device,维护周期时钟。// 2.tick_device依赖一个clockevent设备,提供周期事件。// 3.cpu电源状态的改变会影响tick_device,通过tick_notifier监听电源状态。// 4.全局广播设备接管进入省电模式cpu的周期时间维护。// 4.broadcast_mask保存开启广播模式的cpu, broadca
2013-11-21 19:52:35 2646
原创 时间子系统1_lapic时钟初始化
// 参考:http://www.bluezd.info/archives/reg_clock_event_device_1// x86平台初始化// 注:arch/x86/kernel/x86_init.c1.1 struct x86_init_ops x86_init __initdata = { ... //apic控制器初始化 .irqs = { .pre_vector
2013-11-21 15:49:20 2917
原创 中断子系统8_软中断入口处理
// irq统计信息1.1 typedef struct { unsigned int __softirq_pending;//softirq标志位,32种softirq unsigned long idle_timestamp; unsigned int __nmi_count; //nmi中断发生次数 unsigned int apic_timer_irqs; /* arch dep
2013-11-17 21:00:28 1717
原创 中断子系统7_中断出口处理
// 中断公共入口1.1 common_interrupt: //所有可屏蔽中断函数的公共入口 SAVE_ALL //寄存器入栈 movl %esp,%eax // eax保存栈顶指针 call do_IRQ //中断处理函数 jmp ret_from_intr //从中断返回// 从中断返回// 函数主要任务:// 1.
2013-11-17 17:45:58 1965
原创 中断子系统6_中断嵌套处理
// current_thread_info()->preempt_count bit划分// /*// * - bits 0-7 are the preemption count (max preemption depth: 256)// * - bits 8-15 are the softirq count (max # of softirqs: 256)// */
2013-11-14 14:51:14 1476
原创 中断子系统5_电流层处理
// 电流类型:// 1.电平型:handle_level_irq/* * Level type interrupts are active as long as the hardware line has * the active level. This may require to mask the interrupt and unmask * it aft
2013-11-13 22:34:04 1263
原创 Linux驱动1_DebugFS
// DebugFS: // 默认情况下,debugfs会被挂载在目录/sys/kernel/debug// 手动挂载,mount -t debugfs none /your/debugfs/dir// 创建目录/文件:struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);struct
2013-11-13 18:30:31 1345
原创 中断子系统4_i8259a中断控制器
// 8259A 中的寄存器:// ICW: Initialization Command Word,初始化命令寄存器,用于初始化 8259A// OCW: Operation Command Word,操作命令字,用于控制 8259A// IRR: Interrupt Request Register,中断请求寄存器,共 8bit,对应 IR0~IR7 八个中断管脚。当某个管脚的中断
2013-11-09 20:19:42 1655
原创 中断子系统3_中断入口处理
// 中断入口// 注:gnu 每个符号分属global(被输出)和local(不被输出)两类中的一种。1.1 #define ENTRY(name) \ .globl name; \ ALIGN; \//之后的代码对齐到32字节,使用NOP(0x90)补齐 name:// 代码对齐// .align(n) power-of-2对齐// 4 对齐到16字节, 5 对齐到3
2013-11-08 20:49:27 1870
原创 网络子系统74_邻居子系统结构图
// 1.系统所有邻居协议控制块通过neigh_tables链接在一起。// 2.neigh_table->hash_mask 默认初始化为1,表示每个邻居协议有两个bucket。// 3.net_device->ip_ptr->arp_params调整其上运行的arp协议行为。
2013-11-08 10:19:48 1684
翻译 计算机体系结构7_缓存控制机制
一,缓存控制机制 AMD64提供一系列机制用于设置内存的缓存特性: Cache disable CR0的bit 30为cache-disable bit,CR0.CD. CR0.CD=0,开启缓存功能;CR0.CD=1,关闭缓存功能。
2013-11-07 22:30:54 1401
翻译 计算机体系结构6_缓存结构
一,缓存结构 下图为一个n-way set-associative cache 结构图: 缓存组织为cache line数组的形式,每一个cache line由三部分组成,内存数据,tag,其他信息。 多个cac
2013-11-07 21:16:35 5697
翻译 计算机体系结构5_缓存一致性协议
一,AMD64缓存一致性协议 通过缓存一致性协议保证各个缓存之间,缓存与主存之间,多处理器之间的数据一致性。AMD64的缓存一致性协议为MOESI(modified, owned, exclusive,shared,invalid)协议。 当cache line没有保存有效的数据时,被称作invalid,有
2013-11-07 20:35:06 1762
翻译 计算机体系结构4_分级缓存
一,处理器和内存系统结构 主存在内存体系结构距离CPU最远端,缓存在内存体系结构距离CPU最近端。 EU直接读取L1指令缓存,通过LSU读/写L1数据缓存,在LSU与L1数据缓存之间是write buffer,用于回写。
2013-11-07 18:58:56 2632
翻译 计算机体系结构3_单处理器内存访问顺序
一,单处理器访问顺序 1.指令execute和指令retire Instruction execution creates results and status and determines whether or not the instruction causes an exception. Instruction retirement com
2013-11-07 11:00:59 1610
原创 计算机体系结构2_系统编程手册
AMD64 Architecture Programmer’s Manual Vol1-5(全) IA32&64 Architecture Programmer’s Manual Vol1-3(全)
2013-11-07 10:27:48 995
翻译 计算机体系结构1_内存类型
一,IA32、INTEL64和AMD64内存类型 1.Uncacheable(UC) 读,写都不会被缓存。 2.Cache Disable(CD) 读写命中L1数据缓存,L2缓存,在访问主存之前使cache line失效,如果cache line为脏状态,先将cache line写入主存然后再使cache line失效,之后从主存读数据。 3.Write-Combin
2013-11-06 22:26:49 1450
IA32&64 Architecture Programmer’s Manual Vol1-3
2013-11-07
An Extended Set of Haar-like Features for Rapid Object Detection
2013-10-28
Rapid Object Detection using a Boosted Cascade of Simple Features
2013-10-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人