摘要:
Embodiments of the present invention provide a method and an apparatus for allocating a hardware acceleration instruction to a memory controller. The method includes the following steps. dividing multiple hardware acceleration instructions into different instruction sets according to dependency relationships among the multiple hardware acceleration instructions; obtaining a first mapping relationship between the instruction sets and memory controllers in a computer system according to a rule that different instruction sets whose hardware acceleration instructions do not have a dependency relationship are allocated to different memory controllers; adjusting the first mapping relationship according to load information of memory controllers in a first memory controller set, so as to obtain a second mapping relationship between the instruction sets and the memory controllers in the computer system; and allocating hardware acceleration instructions in the instruction sets to memory controllers in a second memory controller set according to the second mapping relationship. Load balancing of memory controllers is implemented when multiple memory controllers in the computer system execute hardware acceleration instructions.