Dynamic load balancing

The dynamic load balancing support optimizes resources for tape devices that have physical connections to multiple host bus adapters (HBA) in the same machine. When an application opens a device that has multiple configured HBA paths, the device driver determines which path has the HBA with the lowest usage. Then, it assigns that path to the application. When another application opens a different device with multiple HBA paths, the device driver again determines the path with the lowest HBA usage. Then, that path is assigned to the second application. The device driver updates the usage on the HBA assigned to the application when the device is closed. Dynamic load balancing uses all host bus adapters whenever possible and balance the load between them to optimize the resources in the machine.

For example, consider a machine with two host bus adapters, HBA1 and HBA2, with multiple tape drives attached. Each tape drive is connected to both HBA1 and HBA2. Initially, there are no tape drives currently in use. When the first application opens a tape drive for use, the device driver assigns the application to use HBA1. When a second application opens a tape drive for use, the device driver assigns the second application to use HBA2. A third application is assigned to HBA1 and a fourth application is assigned to HBA2. Two applications are assigned to HBA1 and two applications are assigned to HBA2.

If the first application finishes and closes the device, there is now one application with HBA1 and two applications with HBA2. When the next application opens a tape drive, it is assigned to HBA1, so again there are two applications with HBA1 and two applications with HBA2. Likewise, if the second application finishes and closes the device, HBA2 has one application that is assigned to it. The next application that opens a tape drive is assigned to HBA2.

The dynamic load balancing support is independent from the automatic failover support. Regardless of the path that is assigned initially for load balancing, if that path fails, the automatic failover support attempts recovery on the next available path.