5.1.2. Removing Dedicated Processors

An active RMC connection to the HMCs is also required to remove dedicated processors during operation. Processors can only be removed if the remaining number of dedicated processors is greater than or equal to the minimum number of dedicated processors.

Processors are removed in the same way as they are added with the corresponding command “lpar rmprocs” (remove processors). However, removing processors need not work in all cases. To demonstrate this, we have specially prepared some processes on the AIX-LPAR aix02 from the last example. The attempt to take away a dedicated processor fails with a long error message (1298 lines!):

$ lpar rmprocs aix02 1
hmc01: chhwres -m ms06 -r proc  -o r -p aix02 --procs 1
ERROR: remote HMC command returned an error (1)
StdErr: HSCL294F The dynamic removal of processing resources failed: The operation to remove processing has failed on partition aix02. The requested amount of processing to be removed is 1 and the completed amount is 0.
StdErr: The OS standard output is:

StdErr: Invoking update_odm_smt
StdErr: Updated ODM smt_enabled for proc16 with state=true rc: 0
StdErr: smt_failures= 0
StdErr: remove_a_cpu failed! rc=1
StdErr:
StdErr: DR_TOTAL_RESOURCES=0
StdErr: ..cleanup_and_exit. rc=1
StdErr:
StdErr: The OS standard error is:
StdErr:
StdErr: 0930-033 Resource 0x10 is busy and cannot be released.
StdErr:
StdErr:
StdErr:
StdErr:
StdErr: The OS return code is 1.Please issue the lshwres command to list the processing resources of the partition and to determine whether or not its pending and runtime processing values match. If they do not match, problems with future processing-related operations on the managed system may occur, and it is recommended that the rsthwres command to restore processing resources be issued on the partition to synchronize its pending processing value with its runtime processing value.
$

(The error message is only shown here in excerpts.)

The error message shows that the attempt to take away the processor proc16 failed because the processor is busy: “0930-033 Resource 0x10 is busy and cannot be released.”. The problem at this point is, that there are processes that are tied to a fixed processor:

aix02 # ps -eo THREAD |grep -vw -- -1
    USER      PID     PPID    TID S  CP PRI SC    WCHAN        F     TT BND COMMAND
root 15597746 17104922      - A   0  60  1 f1000a01508a3bb0   200001  pts/0  16 sleep 3600
root 20709576 17104922      - A   0  60  1 f1000a0150a523b0   200001  pts/0   8 sleep 3600
root 22741088 17104922      - A   0  60  1 f1000a01508a9fb0   200001  pts/0   0 sleep 3600
aix02 #

The output of the ps command shows that process 15597746 is bound to processor 16 (column BND for bind processor in the output). This means that the process may only run on this processor, which prevents the processor from being removed!

However, the binding can be very easily removed again with the AIX bindprocessor command:

aix02 # bindprocessor -u 15597746
aix02 #
aix02 # ps -eo THREAD |grep -vw -- -1
    USER      PID     PPID    TID S  CP PRI SC    WCHAN        F     TT BND COMMAND
root 20709576 17104922      - A   0  60  1 f1000a0150a523b0   200001  pts/0   8 sleep 3600
root 22741088 17104922      - A   0  60  1 f1000a01508a9fb0   200001  pts/0   0 sleep 3600
aix02 #

Note: The binding was set up with the bindprocessor command as follows:

aix02 # bindprocessor 15597746 16
aix02 #

The first argument is the PID of the process to be bound and the second argument is the number of the processor. The processor number here is the number of the so-called logical processor (see Simultaneous Multi-Threading SMT later).

The processor can now be removed without any further problems:

$ lpar rmprocs aix02 1
$

This means that only 2 dedicated processors are then available again in the LPAR:

aix02 # lsdev -l proc*
proc0 Available 00-00 Processor
proc8 Available 00-08 Processor
aix02 #