Linux Kernel Core Chinese Manual (11) - Core Mechanism

xiaoxiao2021-03-06  47

KERNEL MECHANISMS This chapter describes some of the general tasks and mechanisms that Linux core needs to be provided, allowing the rest of the core to work effectively. 11.1 Bottom Half Handling usually has this time in the core: You don't want to work. A good example is in the process of interrupt processing. When an interrupt is triggered, the processor stops it is performing, and the operating system passes the interrupt to the appropriate device driver. The device driver should not take too much time to process the interrupt, because during this time, the other things in the system cannot run. Often some work can be performed later. Linux invented the BOFFM HALF handler so that the device drivers and other parts of the Linux core can queue the work that can be done later. Figure 11.1 shows the core data structure associated with the Bottom Half. With up to 32 different Bottom HALF handlers: BH_BASE is a pointer vector table, pointing to each Bottom HALF process routine, BH_ACTIVE and BH_MASK, setting them, and activate which handles set their bits. If BH_MASK bit N is set, the Nth element in BH_BASE will contain an address of the BOTTOM HALF routine. If the Nth bit setting of BH_ACTIVE, once the scheduler is considered reasonable, the nth bit of the Bottomhalf handler is called. These indexes are static definitions: Timer Bottom HALF processor priority (index 0), Console Bottom HALF priority (index 1), etc. Usually the Bottom Half process routine will have a list of tasks associated with it. For example, this ImmediateButTom Half Handler operates by an Immediate Task Series (TQ_ImMediate) that needs to be executed. See INCLUDE / Linux / Interrupt.h

转载请注明原文地址:https://www.9cbs.com/read-51897.html

New Post(0)