softirq.c (dde4b2b5f4ed275250488dabdaf282d9c6e7e2b8) | softirq.c (79bf2bb335b85db25d27421c798595a2fa2a0e82) |
---|---|
1/* 2 * linux/kernel/softirq.c 3 * 4 * Copyright (C) 1992 Linus Torvalds 5 * 6 * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) 7 */ 8 9#include <linux/module.h> 10#include <linux/kernel_stat.h> 11#include <linux/interrupt.h> 12#include <linux/init.h> 13#include <linux/mm.h> 14#include <linux/notifier.h> 15#include <linux/percpu.h> 16#include <linux/cpu.h> 17#include <linux/kthread.h> 18#include <linux/rcupdate.h> 19#include <linux/smp.h> | 1/* 2 * linux/kernel/softirq.c 3 * 4 * Copyright (C) 1992 Linus Torvalds 5 * 6 * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) 7 */ 8 9#include <linux/module.h> 10#include <linux/kernel_stat.h> 11#include <linux/interrupt.h> 12#include <linux/init.h> 13#include <linux/mm.h> 14#include <linux/notifier.h> 15#include <linux/percpu.h> 16#include <linux/cpu.h> 17#include <linux/kthread.h> 18#include <linux/rcupdate.h> 19#include <linux/smp.h> |
20#include <linux/tick.h> |
|
20 21#include <asm/irq.h> 22/* 23 - No shared variables, all the data are CPU local. 24 - If a softirq needs serialization, let it serialize itself 25 by its own spinlocks. 26 - Even if softirq is serialized, only local cpu is marked for 27 execution. Hence, we get something sort of weak cpu binding. --- 245 unchanged lines hidden (view full) --- 273 274#endif 275 276/* 277 * Enter an interrupt context. 278 */ 279void irq_enter(void) 280{ | 21 22#include <asm/irq.h> 23/* 24 - No shared variables, all the data are CPU local. 25 - If a softirq needs serialization, let it serialize itself 26 by its own spinlocks. 27 - Even if softirq is serialized, only local cpu is marked for 28 execution. Hence, we get something sort of weak cpu binding. --- 245 unchanged lines hidden (view full) --- 274 275#endif 276 277/* 278 * Enter an interrupt context. 279 */ 280void irq_enter(void) 281{ |
281 account_system_vtime(current); 282 add_preempt_count(HARDIRQ_OFFSET); 283 trace_hardirq_enter(); | 282 __irq_enter(); 283#ifdef CONFIG_NO_HZ 284 if (idle_cpu(smp_processor_id())) 285 tick_nohz_update_jiffies(); 286#endif |
284} 285 286#ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED 287# define invoke_softirq() __do_softirq() 288#else 289# define invoke_softirq() do_softirq() 290#endif 291 292/* 293 * Exit an interrupt context. Process softirqs if needed and possible: 294 */ 295void irq_exit(void) 296{ 297 account_system_vtime(current); 298 trace_hardirq_exit(); 299 sub_preempt_count(IRQ_EXIT_OFFSET); 300 if (!in_interrupt() && local_softirq_pending()) 301 invoke_softirq(); | 287} 288 289#ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED 290# define invoke_softirq() __do_softirq() 291#else 292# define invoke_softirq() do_softirq() 293#endif 294 295/* 296 * Exit an interrupt context. Process softirqs if needed and possible: 297 */ 298void irq_exit(void) 299{ 300 account_system_vtime(current); 301 trace_hardirq_exit(); 302 sub_preempt_count(IRQ_EXIT_OFFSET); 303 if (!in_interrupt() && local_softirq_pending()) 304 invoke_softirq(); |
305 306#ifdef CONFIG_NO_HZ 307 /* Make sure that timer wheel updates are propagated */ 308 if (!in_interrupt() && idle_cpu(smp_processor_id()) && !need_resched()) 309 tick_nohz_stop_sched_tick(); 310#endif |
|
302 preempt_enable_no_resched(); 303} 304 305/* 306 * This function must run with irqs disabled! 307 */ 308inline fastcall void raise_softirq_irqoff(unsigned int nr) 309{ --- 339 unchanged lines hidden --- | 311 preempt_enable_no_resched(); 312} 313 314/* 315 * This function must run with irqs disabled! 316 */ 317inline fastcall void raise_softirq_irqoff(unsigned int nr) 318{ --- 339 unchanged lines hidden --- |