US 11,989,588 B2
Shared memory management method and device
Tangzhi Feng, Shandong (CN); Ruizhen Wu, Shandong (CN); Jian Cui, Shandong (CN); and Hongbin Yu, Shandong (CN)
Assigned to INSPUR SUZHOU INTELLIGENT TECHNOLOGY CO., LTD., Jiangsu (CN)
Appl. No. 18/025,635
Filed by INSPUR SUZHOU INTELLIGENT TECHNOLOGY CO., LTD., Jiangsu (CN)
PCT Filed Sep. 29, 2021, PCT No. PCT/CN2021/121876
§ 371(c)(1), (2) Date Mar. 9, 2023,
PCT Pub. No. WO2022/134723, PCT Pub. Date Jun. 30, 2022.
Claims priority of application No. 202011562692.0 (CN), filed on Dec. 25, 2020.
Prior Publication US 2023/0367637 A1, Nov. 16, 2023
Int. Cl. G06F 9/50 (2006.01); G06F 9/54 (2006.01); G06F 12/02 (2006.01); G06F 12/10 (2016.01)
CPC G06F 9/5016 (2013.01) [G06F 9/544 (2013.01); G06F 12/023 (2013.01); G06F 12/0292 (2013.01); G06F 2212/1016 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method for managing a shared memory, comprising:
setting one core of a system to be a master core, and setting remaining cores to be slave cores; applying, by the master core, to the system for a threshold quantity of idle hugepage blocks, mapping all of the idle hugepage blocks to a virtual address space of the master core, and sorting the hugepage blocks in an ascending order of physical address size of the hugepage blocks;
dividing, according to whether the physical addresses are continuous, the hugepage blocks sorted in the ascending order into segments, and determining whether segments satisfying a memory demand of a subsystem exist among all of the segments;
in response to determining that segments satisfying the memory demand of the subsystem exist among all of the segments, sorting the segments satisfying the memory demand of the subsystem in a descending order of lengths, and re-mapping the segments sorted to obtain several segments having both continuous intra-segment virtual addresses and continuous intra-segment physical addresses;
in response to determining that a segment satisfying a memory demand of the system exists among the several segments having both continuous intra-segment virtual addresses and continuous intra-segment physical addresses, releasing hugepage blocks other than the segment satisfying the memory demand of the system; and
applying for a control plane shared memory, storing a virtual address of a data plane shared memory into a relevant data pointer of the control plane shared memory, setting a master-slave synchronization mark for initialization process, and starting up initialization of the slave cores based on the synchronization mark.