我要评分
获取效率
正确性
完整性
易理解

Setting the L2 I-Cache/D-Cache Configuration of CPU Cores

Use the CMF command line tool to set the L2 I-cache/D-cache configuration of the corresponding CPU cores.

If --reset is not specified but --i-mask and --d-mask are specified in a command, the command is a setting command. In this case, the core IDs must be specified.

The new Kunpeng 920 processor model has a 10-way set associative L2 cache. The value of both --i-mask and --d-mask ranges from 0x0 to 0x3FF. If the value of a bit is 0, scheduling is allowed on the way. Otherwise, scheduling is not allowed. When setting the L2 I-cache/D-cache, ensure that at least two bits of --i-mask and --d-mask are 0.

For example, you can run the following command to configure the L2 I-cache and L2 D-cache of CPU cores 80 and 81 to be 8-way set associative (with six ways shared between them and two ways exclusively allocated to each core). The binary representation of 0x300 is 001100000000, indicating that data can be scheduled on the last eight ways. The binary representation of 0x3 is 000000000011, indicating that instructions can be scheduled on the first eight ways.
./devcman -m l2-restrict --start_cpu 80 --end_cpu 81 --d-mask 0x300 --i-mask 0x3

--start_cpu and --end_cpu indicate the start and end CPU core IDs, respectively. If the value of --start_cpu is the same as that of --end_cpu, the configuration is valid only for the CPU core whose ID is --start_cpu.