# prefetch_tuning **Repository Path**: liuke20/prefetch_tuning ## Basic Information - **Project Name**: prefetch_tuning - **Description**: This module is based on Kunpeng chip and provides some performance-sensitive chip parameters for adjustment. - **Primary Language**: C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 10 - **Created**: 2020-09-10 - **Last Updated**: 2024-04-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This module is based on Kunpeng chip and provides some performance-sensitive chip parameters for adjustment. Build and install: make clean && make insmod prefetch_tuning.ko There will be some files under /sys/class/misc/prefetch/ policy: Prefetch policy, can be set to 0~15. read_unique: Whether to allow cross-numa access to cache. 0--allow 1--forbid. iocapacity_limit: Whether to limit the io capacity of cache. 0--unlimiet 1--limit. tag_rep_alg: Choose cache line algorithm. 0--random 1--drrip 2--plru 3--random. ramswap: Full or partial when doing ramswap. 1--partial 0--full. sqmerge: whether consecutive address access can occupy only one entry in the squeue to accelerate the merge process. 0--limit 1--merge. prefetch_drop_hha: Whether to merge a non-prefetch operation with the previous prefetch operation. 0--allow 1--limit. prime_drop_mask: Enable prefetch to retry randomly. 0--disable 1--enable. sequence_opt: Whether change the L3T processing to serial mode when blocking. 0--limit 1--enable. prefetch_utl_ddr: The utilization of ddr that leads to the halving the threshold of prefetch. 0--less thean 1/2 1--1/2 2--3/4 3--almost full. prefetch_utl_ddr_en: Whether to allow the automatic threshold reduction according to the utilization of ddr. 0--forbid 1--allow. prefetch_utl_l3t: The utilization of l3t that leads to the halving the threshold of prefetch. 0--less thean 1/2 1--1/2 2--3/4 3--almost full. prefetch_utl_l3t_en: Whether to allow the automatic threshold reduction according to the utilization of l3t. 0--forbid 1--allow. prefetch_start_level: The number of missing addresses that leads to prefetch. 0--32 1--2 n-1--n, can be 0~31. rdmerge_upgrade_en: Whether to allow the RS to merge with the preceding ReadE. 0--disabl 1--allow. ddr_compress_opt_en: Optimization switch of support HHA compression access. 0--disable 1--enable. snpsleep_en: Whether to enable snp sleep. 0--disable 1--enable. prefetchtgt_en: Whether to enable the prefetchtgt. 0--disable 1--enable. cpu_pf_lqos_en: Whether to enable the prefetch operation delivered by the CPU to be forcibly processed as the lqos operation. 0--disable 1--enable. refillsize_com_ada_en: Whether to enable the auto-sensing of the size of the request sent to the HHA. If the size of the continuously received requests is 128 bytes or 64 bytes, the size of the prefetched request is automatically adjusted. 0--disable 1--enable adaptive size adjustment. refillsize_pre_ada_en: Whether to enable the adaptation of the size of the request sent to the HHA. If the size of the continuously received request is 128 bytes or 64 bytes, the size of the normal request is automatically adjusted. 0--disable 1--enable adaptive size adjustment. prefetch_overide_level: Initial coverage priority for an operation to enter the prefetch buffer. If the value is incorrect, the threshold is decreased by 1. If the value is correct, the threshold is increased by 1. If the value is 0, the prefetch rule needs to be replaced. range 0~15. prefetch_vague_en: Indicates whether to enable fuzzy match for prefetch. After the function is enabled, the prefetch summarizes the same 16 KB address rule. The four 4 KB address rules are the same and can be used together. 0--disable 1--enable. prefetch_core_en: Core prefetch enable; Bit 1 indicates that the core request needs to be prefetched. range 0~15. prefetch_match_en: Whether to enable the prefetch operation after the prefetch hit. 0--disable 1--enable. reg_ctrl_prefetch_drop: Prefetch operation discard enable. 0--disable 1--enable. reg_ctrl_dmcassign: DDR access address alignment enable. 0--The DDR read operation uses the wrap mode, and the address is 32-byte-aligned. The DDR write operation is always in INCR mode, and the address is aligned with the access boundary. 1--The DDR read operation is always in INCR mode, and the address is aligned with the access boundary. The DDR write operation is always in INCR mode, and the address is aligned with the access boundary. reg_ctrl_rdatabyp: DDR read data bypass memory enable in the HHA. 0--disable 1--The internal data of the HHA is bypassed, and the DDR read data can be transmitted quickly. reg_dir_replace_alg: Directory replacement algorithm configuration. 0--EDIR random+SDIR random 1--EDIR random+SDIR polling 2--EDIR PLRU+SDIR random 3--EDIR PLRU+SDIR polling prefetch_comb: Read operation and prefetchtgt merge enable. 0--The read operation can be merged with the fetchtgt operation. 1--The read operation and the fetchtgt merge operation are not allowed. reg_funcdis_comb: Whether to merge write operations whose size is less than 128 bytes. 0--enable 1--disables the merge function of the write operation. reg_nosnp_atomic_bypass_en: Whether to bypass the CPU's atomic operation. 1--enable 0--disable. reg_ro_alloc_shut_en: Indicates whether to enable the function of allocating readOnce operations to L3. 0--disable 1--enable. reg_wrfull_hit_shut_en: Indicates whether to disable the function. When 64wu_full hits pipe M, do not send createE to the HA. 0--Disable 1--Enable. req_conflict_en: Whether to enable backpressure on the CPU in one beat if requests from the CPU and non-CPU are received at the same beat. 0--Disable 1--Enable. lower_power_en: Whether to enable the CQ low-power mode. 1--enable 0--disable. dataclean_shut_en: Whether to mask the CE bit carried by the writenosnoopfull of the TaiShan kernel. 0--not masked 1--Shield. arb_flush_shut_en_n: When the CQ is idle, the enable status of the ARBIT adjustment scheduling pointer is reset. 0--enable 1--disable. pgnt_arb_exat_shut_en_n: Whether to enable the scheduling of the pgrant in the try mode. 0--enable 1--disable. fast_exter_shut_en: Whether to disable the external request data of miss from passing through the fast path. 1--disable 0--enable. fast_data_shut_en: Whether to disable the miss data from passing through the fast path. 1--disable 0--enable. pend_data_shut_en: Whether to disable the miss data from passing through the pend channel. 1--disable 0--enable. ramfwd_shut_en: Whether to enable the ramfwd function. 1--disable 0--enable. ramthr_merge_en: Indicates whether to allow the data of merge operations to be returned to the CPU from the thr channel. 1--enable 0--disable. ext_en: Indicates whether the L3T extendway is enabled. 0--disable 1--enable. reads_upgrade_en: Readshared operation status upgrade enable. 0--disable 1--enable. rdmerge_pipe_en: Whether to allow Sqmerge requests to be hit in Cpipe5. 1--enable 0--disable. spill_en: Whether the L3T spin function is enabled. 0--disable 1--enable. spill_shared_en: Whether L3T enables the Spill function in the shared state. 0--disable 1--enable. spill_instr_en: Whether the L3T enables the instruction spear function. 0--disable 1--enable. sqrdmerge_en: Enable RDMERGE acceleration after SQ merge operation. 0--disable 1--enable. prefetch_drop_en: Whether to discard prefetch packets in L3T mode. 0--disable 1--enable. datapull_en: Whether the L3T enables the data pull function. 0--disable 1--enable. mkinvld_en: Whether L3T is enabled to convert makelinvalid to cleaninvalid. 0--enable 1--disable. ramthr_en: Whether to allow L3D to directly return data to the CPU through the thr channel. 1--enable 0--disable. rsperr_en: Indicates whether to report rsperr. 1--enable 0--disable. force_cq_clk_en: Whether to enable the cache queue clock forcibly for L3T. 0--disable 1--enable. wrfull_create_en: Whether to enable the 128-byte writeunique function to obtain the permission but not data from the HHA. 0--disable 1--enable. cleanunique_data_en: Whether cleanunqunie returns data. 0--disable 1--enable. lock_share_req_en: Whether to enable the register lock in share mode and not to deliver operations to the HHA. 0--prohibited 1--allowed. atomic_monitor_en: Specifies whether to enable the atomic_monitor function. 0--disable 1--enable. Configuration example: echo 1 > /sys/class/misc/prefetch/read_unique