US2020257620A1PendingUtilityA1

Memory Block Reclamation Method and Apparatus

Assignee: HUAWEI TECH CO LTDPriority: Nov 7, 2017Filed: Apr 30, 2020Published: Aug 13, 2020
Est. expiryNov 7, 2037(~11.3 yrs left)· nominal 20-yr term from priority
G06F 2212/7211G06F 2212/7205G06F 2212/7201G06F 2212/72G06F 2212/1044G06F 12/0246G06F 12/0238G06F 3/064G06F 3/0604G06F 2212/1036G06F 2212/1032G06F 3/0679
57
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

A memory block reclamation method and apparatus are provided. According to the method, after receiving an unmap command sent by a memory controller, a medium controller reclaims one or more memory blocks in a non-volatile memory connected to the medium controller based on memory logical address information in the unmap command. The one or more reclaimed memory blocks are available memory blocks.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A memory block reclamation method, wherein the method is applied to a computer system comprising a memory controller, a medium controller, and a non-volatile memory connected to the medium controller, and the method comprises:
 receiving, by the medium controller, an unmap command sent by the memory controller, wherein the memory controller communicates with the medium controller by using an NVDIMM-P protocol, and the unmap command comprises memory logical address information of one or more to-be-reclaimed memory blocks in the non-volatile memory; and   reclaiming, by the medium controller, the one or more memory blocks based on the memory logical address information, wherein the one or more reclaimed memory blocks are available memory blocks.   
     
     
         2 . The method according to  claim 1 , wherein the reclaiming, by the medium controller, the one or more memory blocks based on the memory logical address information comprises:
 deleting, by the medium controller, a mapping relationship between a memory logical address and a corresponding memory physical address of each of the one or more memory blocks based on the memory logical address information; and   adding, by the medium controller, the memory physical addresses of the one or more memory blocks to a memory idle list.   
     
     
         3 . The method according to  claim 1 , wherein the memory logical address information comprises a start address and length information of the one or more to-be-reclaimed memory blocks, the start address is used to indicate a first address of the one or more to-be-reclaimed memory block, and the length information is used to indicate a quantity of the one or more to-be-reclaimed memory blocks. 
     
     
         4 . The method according to  claim 1 , wherein the unmap command further comprises erasure mode indication information; and the method further comprises:
 writing, by the medium controller, pre-defined pattern into the one or more memory blocks when the erasure mode indication information instructs to erase data in the one or more memory blocks.   
     
     
         5 . The method according to  claim 1 , wherein the method further comprises:
 receiving, by the medium controller, a read command sent by the memory controller, wherein the read command comprises memory logical address information of to-be-read data;   determining, by the medium controller, that no corresponding memory physical address is found based on the memory logical address information of to-be-read data; and   sending, by the medium controller, error response information to the memory controller, wherein the error response information indicates that the read command fails to be executed.   
     
     
         6 . A memory, comprising:
 a non-volatile memory, and   a medium controller, connected to the non-volatile memory and configured to:
 receive an unmap command sent by a memory controller, wherein the medium controller communicates with the memory controller by using an NVDIMM-P protocol, and the unmap command comprises memory logical address information of one or more to-be-reclaimed memory blocks in the non-volatile memory; and 
 reclaim the one or more memory blocks based on the memory logical address information, wherein the one or more reclaimed memory blocks are available memory blocks. 
   
     
     
         7 . The memory according to  claim 6 , wherein the medium controller is further configured to:
 delete a mapping relationship between a memory logical address and a corresponding memory physical address of each of the one or more memory blocks based on the memory logical address information; and   add the memory physical addresses of the one or more memory blocks to a memory idle list.   
     
     
         8 . The memory according to  claim 6 , wherein the memory logical address information comprises a start address and length information of the one or more to-be-reclaimed memory blocks, the start address is used to indicate a first address of the one or more to-be-reclaimed memory blocks, and the length information is used to indicate a quantity of the one or more to-be-reclaimed memory blocks. 
     
     
         9 . The memory according to  claim 6 , wherein the unmap command further comprises erasure mode indication information, and the medium controller is further configured to:
 write pre-defined pattern into the one or more memory block when the erasure mode indication information instructs to erase data in the one or more memory blocks.   
     
     
         10 . The memory according to  claim 6 , wherein the medium controller is further configured to:
 receive a read command sent by the memory controller, wherein the read command comprises memory logical address information of to-be-read data;   determine that no corresponding memory physical address is found based on the memory logical address information of to-be-read data; and   send error response information to the memory controller, wherein the error response information indicates that the read command fails to be executed.   
     
     
         11 . A computer system, comprising:
 a processor, configured to send a trim instruction comprising memory logical address information of one or more to-be-reclaimed memory blocks; a memory controller, connected to the processor and configured to:
 receive the trim instruction; and 
 send, to a medium controller connected to the memory controller, an unmap command to instruct the medium controller to reclaim the one or more memory blocks in a non-volatile memory connected to the medium controller, wherein the medium controller communicates with the memory controller by using an NVDIMM-P protocol, and the unmap command comprises the memory logical address information of the one or more to-be-reclaimed memory blocks, ; and 
 the medium controller is configured to:
 receive the unmap command sent by the memory controller; and 
 reclaim the one or more memory blocks based on the memory logical address information, wherein the one or more reclaimed memory blocks are available memory blocks. 
 
   
     
     
         12 . The system according to  claim 11 , wherein the memory logical address information comprises a start address and length information of the one or more to-be-reclaimed memory blocks, the start address is used to indicate a first address of the one or more to-be-reclaimed memory blocks, and the length information is used to indicate a quantity of the one or more to-be-reclaimed memory blocks. 
     
     
         13 . The system according to  claim 11 , wherein the unmap command further comprises erasure mode indication information; and the medium controller is further configured to:
 write pre-defined pattern into the memory block when the erasure mode indication information instructs to erase data in the one or more memory blocks.   
     
     
         14 . The system according to a  claim 11 , wherein the memory controller is further configured to:
 receive a memory access request sent by the processor, wherein the memory access request comprises memory logical address information of to-be-read data;   send a read command to the medium controller based on the memory access request, wherein the read command carries the memory logical address information of the to-be-read data;   the medium controller is further configured to:
 determine that no corresponding memory physical address is found based on the memory logical address information of the to-be-read data; and 
 send error response information to the memory controller, wherein the error response information indicates that the read command fails to be executed. 
   
     
     
         15 . The system according to  claim 11 , wherein in the step of the reclaiming, the medium controller is configured to:
 delete a mapping relationship between a memory logical address and a corresponding memory physical address of each of the one or more memory blocks based on the memory logical address information; and   add the memory physical addresses of the one or more memory blocks to a memory idle list.

Join the waitlist — get patent alerts

Track US2020257620A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.