contributed by < devarajabc
>
The bottom half of the processor
-> a common noun referring to all the different ways of organizing deferred processing of an interrupt.An interrupt handler can do large amount of work that is impermissible as it executes in the context where interrupts are disabled.
為什麼 interrupts are disabled ? 如何做到的?
spawn_ksoftirqd
->
softirq_vec
-> An array of softirq_action
which contains an action pointer to the softirq function
The
local_irq_save
saves the state of the IF flag of the eflags register and disables interrupts on the local processor.
Thelocal_irq_restore
macro does the opposite thing: restores the interrupt flag and enables interrupts.
We disable interrupts here because a softirq interrupt runs in the interrupt context and that one softirq (and no others) will be run.
The
raise_softirq_irqoff
function marks the softirq as deffered by setting the bit corresponding to the given index nr in the softirq bit mask (__softirq_pending) of the local processor.
softirq bit mask 是什麼呢?如何運作?
Registration of a softirq with the open_softirq function.
Activation of a softirq by marking it as deferred with the raise_softirq function.
After this, all marked softirqs will be triggered in the next time the Linux kernel schedules a round of executions of deferrable functions.
And execution of the deferred functions that have the same type.
have the same type
是什麼意思? type 是指 softirq_vec 的 index 嗎。
possible cpus
是啥
tasklet_trylock
是啥?單一處理器為何需要 lock ? -> pdates state of the given tasklet
WORK_STRUCT_PENDING_BIT
是什麼?
The __queue_work function gets the work pool. Yes, the work pool not workqueue. Actually, all works are not placed in the workqueue, but to the work pool that is represented by the worker_pool structure in the Linux kernel. As you can see above, the workqueue_struct structure has the pwqs field which is list of worker_pools
workqueue_struct structure
是啥worker_pools
跟 workqueue_struct structure
的關係是? 跟 pool_workqueue
以及 workqueue
的關係是?更新以上