AIX Manual MP
AIX Manual MP
AIX Manual MP
Multi-Processing
Generally, all operating system commands and library subroutines use logical
numbers to identify processors. The cpu_state command is an exception and
uses physical processor numbers. It can be used to list system processors, or
control which processors are enabled or disabled. In addition to these software
controlled states, the unavailable state indicates a hardware failure detected by
the system.
Master Processor
The notion of a master processor came out of the design for funneling. In order
to run some UP drivers unchanged, their execution had to be ″funnelled″ (see
below) through one specific processor, which is called the MP master.
Funneling:
Funnelled code runs only on the master processor; therefore, the current
uni-processor serialization is sufficient. Interrupts for a funnelled device driver
will be routed to the MP master CPU. Funnelling is intended to support third
party device drivers and low-throughput device drivers. The base kernel will
provide binary compatibility for these device drivers.
Funneling also works for device driver iodone routines, interrupt handlers, EPOW
handlers, off-level interrupt handlers, watchdog timers, and timeout routines.
MP Safe
The device driver runs on any processor. The code for the device driver has
been modified to add a code lock to serialize the device drivers execution. This
type of device driver is intended for medium-throughput device drivers.
MP Efficient
The device driver runs on any processor. The code for the device driver has
been modified to add data locks to serialize the device driver′s accesses to
devices and data. This type of device driver is intended for high-throughput
device drivers.
12.3 MP Scheduler/Dispatcher
Scheduler: AIX scheduling uses a time-sharing, priority-based scheduling
algorithm. This algorithm favors processes that do not consume large amounts
of the processor, as the amount of processor time used by the process is
included in the priority recalculation equation. Fixed priority processes are
allowed. The priority of these processes do not change regardless of the
amount of processor time used.
There is one global priority-based, multi-level run queue (runq). All threads that
are runnable are linked into one of the runq entries. There are currently 128
priorities. The scheduler periodically scans the list of all active processes and
recalculates process priority based on the amount of processor time used.
The AIX Version 4.1 scheduler is based on the AIX Version 3.2 scheduler, with
the following changes:
• Move from a process-based scheme to a thread-based model. The
schedulable entity is the thread for AIX Version 4.1. This requires the runq
(run queue) to be thread based. Suspension due to memory thrashing shall
remain on a process basis, rather than on a thread basis.
• Ability to bind a process/thread to a processor (Hard Cache Affinity).
Threads can be bound to a processor ID. Only the logical CPU numbers are
used by the scheduler subsystem; the physical CPU number is never used by
the scheduler subsystem.
• Attempt to run process/thread on the same processor (Soft Cache Affinity).
• Support funneling threads.
See also 13.5.1, “Threads Scheduling” on page 226 for information on threads
scheduling.
The AIX Version 4.1 dispatcher has also been changed. AIX Version 4.1 does not
guarantee that the thread with the best priority is the one to select. If the thread
User Interfaces: User interfaces are routines that modify process priority for one
reason or another. These include system calls like nice(), setpriority(),
getpriority(), setpri(), getpri() and yield() and kernel services like lockl(), which
does priority promotion.
The yield() subroutine forces the current running process or thread to relinquish
use of the processor. If the run queue is empty when the yield() subroutine is
called, the calling process or kernel thread is immediately rescheduled. If the
calling process has multiple threads, only the calling thread is affected. The
process or thread resumes execution after all processes or threads of equal or
greater priority are scheduled to run.
The following new user interfaces have been added to libc in AIX Version 4.1:
• bindprocessor() − Binds a process or thread to a processor.
• sched_setparam() − Sets the scheduling parameters for a process.
• sched_getparam() − Gets the scheduling parameters for a process.
• sched_setscheduler() − Sets the scheduling policy and parameters for a
process.
• sched_getscheduler()- Gets the scheduling policy and parameters for a
process.
• sched_yield() − Forces the calling process to relinquish the CPU until it
becomes the head of its process list again.
• sched_get_priority_max() − Returns the appropriate maximum priority for
the specified scheduling policy.
• sched_get_priority_min() − Returns the appropriate minimum priority for the
specified scheduling policy.
• sched_rr_get_interval() − Returns the current execution time quantum for
the process specified.
MP Commands: The following new commands have been added for MP support:
• cpu_state − Controls and lists which processors will be active when the
system is next started
• bindprocessor − Binds a process to a processor.
The bos install routine calls a bootinfo command that checks the IPL control
block to determine if the system is MP capable. If it is MP capable, then the MP
kernel is installed. Note that an MP-capable machine could only have one
processor.
If one of the processors on an MP system fails, the customer will probably need
to call service. It depends on the failure. If the failure is a hard failure that ROS
or the BUMP detects on the next boot, it will tell the operating system that the
processor is unavailable by setting status in the NVRAM. However, if ROS does
not detect that it is bad, AIX will start using it again. If the failure is intermittent,
the customer or Customer Engineer (CE) can use the cpudisable command to tell
AIX to stop using the processor (effective on the next boot).