CN106155910B - Method, device and system for realizing memory access - Google Patents

Method, device and system for realizing memory access Download PDF

Info

Publication number
CN106155910B
CN106155910B CN201510140421.9A CN201510140421A CN106155910B CN 106155910 B CN106155910 B CN 106155910B CN 201510140421 A CN201510140421 A CN 201510140421A CN 106155910 B CN106155910 B CN 106155910B
Authority
CN
China
Prior art keywords
memory
computer
access
memory space
space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510140421.9A
Other languages
Chinese (zh)
Other versions
CN106155910A (en
Inventor
范多亮
王浩
郭凯
沈利
刘和洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510140421.9A priority Critical patent/CN106155910B/en
Publication of CN106155910A publication Critical patent/CN106155910A/en
Application granted granted Critical
Publication of CN106155910B publication Critical patent/CN106155910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method, a device and a system for realizing memory access, wherein the method comprises the following steps: an operating system of a computer sends a memory access request comprising an access address and an access length to a UEFI BIOS by calling an interface of the UEFI BIOS, the UEFI BIOS determines that a memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in a memory pool according to the access address, and sends the memory access request to a memory management device through a system bus so that a physical address of a request access starting position is the memory space with the access address and the access length. According to the embodiment of the invention, the computer can use the memory space in the memory pool outside the computer, thereby solving the problem of insufficient memory space in the prior art.

Description

Method, device and system for realizing memory access
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, and a system for implementing memory access.
Background
The Data Center (Data Center) is a Center for calculating and storing Data. After the cloud data center era is entered, computers and storage devices of the data center are managed in a centralized mode by using a virtualization technology to form a uniform shared resource pool, so that the resource utilization rate is improved, and the hardware cost and the subsequent operation cost are effectively reduced.
However, in the prior art, the processor of each computer and the Memory of the computer are directly connected through a Dual-Inline-Memory-Modules (DIMM) bus, and the processor directly accesses the Memory on the computer through the DIMM bus. Because the distance between the processor and the memory is limited by the DIMM bus wiring requirement, each computer can only access the memory on the computer, and the number of memory slots which can be provided in the computer is limited, so that the problem of insufficient memory space often exists in practical application.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, and a system for implementing memory access, which are used to solve the problem of insufficient memory space in the prior art.
In a first aspect, a method for implementing memory access is provided, where the method is applied to a system including a computer, a memory management device and a memory pool, where the computer is connected to the memory management device through a system bus, the memory management device is connected to the memory pool, and the memory pool includes a plurality of memories; the method comprises the following steps:
the operating system of the computer sends a memory access request to a unified extensible firmware interface basic input output system (UEFI BIOS) by calling an interface of the UEFI BIOS, wherein the memory access request comprises an access address and an access length;
and the UEFI BIOS determines that the memory space requested to be accessed by the memory access request belongs to the memory space allocated to the computer in the memory pool according to the access address, and sends the memory access request to the memory management equipment through the system bus, wherein the physical address of the initial position requested to be accessed is the access address, and the length of the memory access request is the memory space of the access length.
In a first possible implementation manner of the first aspect, the determining, according to the access address, that the memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in the memory pool specifically includes: and determining the physical address range of the memory space allocated to the computer by the access address in the memory pool according to a physical address space table, wherein the physical address space table comprises the physical address range of the memory space allocated to the computer in the memory pool.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the method further includes: and the UEFI BIOS determines the length of the memory space which needs to be allocated to the computer by the memory management device when the computer is started, and sends a memory allocation request comprising the length to the memory management device to request the memory management device to allocate the memory space with the length to the computer in the memory pool.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the determining a length of a memory space that needs to be allocated to the computer by the memory management device specifically includes: checking the length of a local memory in the first computer, and determining a difference value between the preset length of a total memory space required to be used by the first computer and the length of the local memory as the length of a memory space required to be allocated to the first computer by the memory management device.
In a second aspect, a method for implementing memory access is provided, where the method is performed by a memory management device; the method comprises the following steps:
receiving a memory access request sent by a first computer connected with the memory management device, wherein the memory access request is used for requesting to access a memory space to be accessed and comprises an access address and an access length, the access address is a physical address of an initial position of the memory space to be accessed requested to be accessed by the memory access request, and the access length is the length of the memory space to be accessed;
determining address information of a memory space allocated to the first computer in a memory pool, wherein the memory pool comprises a plurality of memories, determining an address of the starting position in the memory pool according to the address information of the memory space and the access address, and accessing the memory space to be accessed according to the address of the starting position in the memory pool and the access length.
In a first possible implementation manner of the second aspect, before the determining the memory space in the memory pool that has been allocated to the first computer, the method further includes:
allocating the memory space for the first computer in the memory pool, wherein the memory space comprises at least one continuous sub memory space, and records a computer identifier for identifying the first computer and address information of the memory space, and the address information of the memory space comprises a mapping relation between a physical address of a starting position of each sub memory space and an address of the starting position in the memory pool;
the determining address information of the memory space allocated to the first computer in the memory pool, and determining the address of the starting position in the memory pool according to the address information of the memory space and the access address specifically include:
and determining the recorded address information of the memory space allocated to the first computer according to the identifier of the first computer, and determining the address of the initial position of the memory space to be accessed in the memory pool according to the access address and the recorded mapping relationship between the physical address of the initial position of each sub-memory space and the address of the initial position in the memory pool.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, after allocating the memory space for the first computer in the memory pool, the method further includes:
releasing a memory space allocated to the first computer when a memory release request sent by the first computer is received, and marking the released memory space as an idle state;
and when a memory allocation request sent by a second computer connected with the memory management device is received, allocating a memory space for the second computer from the memory space marked as a free state in the memory pool.
With reference to the second aspect or the first or second possible implementation manner of the second aspect, in a third possible implementation manner, the memory management apparatus is deployed in a memory management device of a system that implements memory access, and the system further includes the first computer and the memory pool, where the first computer is connected to the memory management device through the system bus, and the memory management device is connected to the memory pool.
With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner, the memory management device includes a memory switch and a memory control device, the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool;
the memory management device is deployed in the memory switch; the access unit is specifically configured to access the memory space to be accessed through the memory control device; alternatively, the first and second electrodes may be,
the memory management device is deployed in the memory control equipment; specifically, the receiving of the memory access request sent by the first computer is that the memory control device receives, through the memory switch, the memory access request sent by the first computer, where the memory access request includes a computer identifier of the first computer added by the memory switch; specifically, the determining of the memory space allocated to the first computer in the memory pool is that the memory control device determines the memory space allocated to the first computer according to the computer identifier.
In a third aspect, a method for implementing memory access is provided, where the method is applied to a system including a computer, a memory switch, a memory control device, and a memory pool, where the computer is connected to the memory switch through a system bus, the memory switch is connected to the memory control device, the memory control device is connected to the memory pool, and the memory pool includes a plurality of memories; the method comprises the following steps:
the memory switch receives a memory access request sent by the computer, wherein the memory access request is used for requesting to access a memory space to be accessed and comprises an access address and an access length, the access address is a physical address of an initial position of the memory space to be accessed requested to be accessed by the memory access request, and the access length is the length of the memory space to be accessed;
the memory switch determines that a computer sending the memory access request is the computer according to a port connected with the computer, adds a computer identifier for identifying the computer to the memory access request, and sends the memory access request carrying the computer identifier to the memory control device, so that the memory control device determines a memory space allocated to the computer according to the computer identifier and accesses the memory space to be accessed in the memory space.
In a first possible implementation manner of the third aspect, the system includes at least two memory control devices, and each memory control device is connected to one of the memory pools;
before the memory switch sends the memory access request carrying the computer identifier to the memory control device, the method further includes:
when the memory switch receives a memory allocation request sent by the computer, selecting a first memory control device of the at least two memory control devices to allocate the memory space for the computer, and recording a corresponding relation between a computer identifier of the computer and a device identifier of the first memory control device;
and the memory switch determines that the memory access request needs to be sent to the first memory control device according to the corresponding relation.
In a fourth aspect, a computer is provided, where the computer is connected to a memory management device through a system bus, the memory management device is connected to a memory pool, and the memory pool includes a plurality of memories; the computer comprises an operating system module and a BIOS module, wherein the operating system module is used for realizing the functions of an operating system of the computer, and the BIOS module is used for realizing the functions of UEFI BIOS of the computer;
the operating system module is used for sending a memory access request to the BIOS module by calling an interface of the BIOS module, wherein the memory access request comprises an access address and an access length;
the BIOS module is configured to determine, according to the access address, that a memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in the memory pool, and send, to the memory management device through the system bus, the memory access request such that a physical address of a start position of the request for access is the access address, and a length of the memory space is the access length.
In a first possible implementation manner of the fourth aspect, the determining, by the BIOS module, that the memory space requested to be accessed by the memory access request belongs to the memory space allocated to the computer in the memory pool according to the access address specifically includes: the BIOS module is configured to determine, according to a physical address space table, a physical address range of a memory space allocated to the computer by the access address in the memory pool, where the physical address space table includes the physical address range of the memory space allocated to the computer in the memory pool.
With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the BIOS module is further configured to determine, when the computer is started, a length of a memory space that needs to be allocated to the computer by the memory management device, and send a memory allocation request including the length to the memory management device, so as to request the memory management device to allocate the memory space of the length to the computer in the memory pool.
With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner, the determining, by the BIOS module, a length of a memory space that needs to be allocated to the computer by the memory management device specifically includes: the BIOS module is configured to check a length of a local memory in the computer, and determine a difference between a preset length of a total memory space that needs to be used by the first computer and the length of the local memory as a length of a memory space that needs to be allocated to the first computer by the memory management device.
In a fifth aspect, a memory management device is provided, where the memory management device includes: a receiving unit, a determining unit and an accessing unit;
the receiving unit is configured to receive a memory access request sent by a first computer connected to the memory management device, where the memory access request is used to request access to a memory space to be accessed and includes an access address and an access length, the access address is a physical address of an initial position of the memory space to be accessed, which is requested to be accessed by the memory access request, and the access length is a length of the memory space to be accessed;
the determining unit is configured to determine address information of a memory space allocated to the first computer in a memory pool, and determine an address of the starting position in the memory pool according to the address information of the memory space and the access address, where the memory pool includes a plurality of memories;
and the access unit is used for accessing the memory space to be accessed according to the address of the starting position in the memory pool and the access length.
In a first possible implementation manner of the fifth aspect, the memory management device further includes an allocation unit and a recording unit;
the allocation unit is configured to allocate the memory space to the first computer in the memory pool, where the memory space includes at least one continuous sub-memory space;
the recording unit is configured to record a computer identifier of the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting position of each sub-memory space and an address of the starting position in the memory pool;
the determining unit is specifically configured to determine, according to the identifier of the first computer, recorded address information of a memory space allocated to the first computer, and determine, according to the access address and a recorded mapping relationship between a physical address of a starting position of each sub-memory space and an address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool.
With reference to the fifth aspect or the first possible implementation manner of the fifth aspect, in a second possible implementation manner, the allocating unit is further configured to, when the receiving unit receives a memory release request sent by the first computer, release a memory space allocated to the first computer, mark the released memory space as an idle state, and when the receiving unit receives a memory allocation request sent by a second computer connected to the memory management device, allocate a memory space for the second computer from a memory space marked as an idle state in the memory pool.
With reference to the fifth aspect or the first or second possible implementation manner of the fifth aspect, in a third possible implementation manner, the memory management apparatus is deployed in a memory management device of a system that implements memory access, and the system further includes the first computer, where the first computer is connected to the memory management device through a system bus, and the memory management device is connected to the memory pool.
With reference to the third possible implementation manner of the fifth aspect, in a fourth possible implementation manner, the memory management device includes a memory switch and a memory control device, where the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool;
the memory management device is deployed in the memory switch; the access unit is specifically configured to access the memory space to be accessed through the memory control device; alternatively, the first and second electrodes may be,
the memory management device is deployed in the memory control equipment; the receiving unit is specifically configured to receive, through the memory switch, the memory access request sent by the first computer, where the memory access request includes a computer identifier of the first computer added by the memory switch; the determining unit is configured to determine that the memory space allocated to the first computer in the memory pool specifically includes determining, according to the computer identifier, the memory space allocated to the first computer.
A sixth aspect provides a memory switch, where the system for implementing memory access includes a computer, a memory control device, and a memory pool, where the computer is connected to the memory switch through a system bus, the memory switch is connected to the memory control device, the memory control device is connected to the memory pool, and the memory pool includes a plurality of memories; the memory switch includes: a receiving unit, an adding unit and a sending unit;
the receiving unit is configured to receive a memory access request sent by the computer, where the memory access request is used to request access to a to-be-accessed memory space and includes an access address and an access length, the access address is a physical address of an initial position of the to-be-accessed memory space requested to be accessed by the memory access request, and the access length is a length of the to-be-accessed memory space;
the adding unit is used for determining that a computer sending the memory access request is the computer according to a port connected with the computer, and adding a computer identifier for identifying the computer into the memory access request;
the sending unit is configured to send a memory access request carrying the computer identifier to the memory control device, so that the memory control device determines, according to the computer identifier, a memory space allocated to the computer and accesses the memory space to be accessed in the memory space.
In a first possible implementation manner of the sixth aspect, the system includes at least two memory control devices, and each memory control device is connected to one of the memory pools; the memory switch also comprises a memory control equipment management unit;
the memory control device management unit is configured to, when the receiving unit receives a memory allocation request sent by the computer, select a first memory control device of the at least two memory control devices to allocate the memory space for the computer, and record a correspondence between a computer identifier of the computer and a device identifier of the first memory control device; and the memory access request is further used for determining that the memory access request needs to be sent to the first memory control device according to the corresponding relation.
A seventh aspect provides a system for implementing memory access, where the system includes a memory management device and at least two computers, where each computer is connected to the memory management device through a system bus, the memory management device is connected to a memory pool, and the memory pool includes multiple memories;
the first computer of the at least two computers is configured to send a memory access request to the memory management device to request access to a memory space to be accessed, where the memory access request includes an access address and an access length, the access address is a physical address of an initial position of the memory space to be accessed, and the access length is a length of the memory space to be accessed;
and when receiving the memory access request, the memory management device determines address information of a memory space allocated to the first computer in the memory pool, determines an address of the starting position in the memory pool according to the address information of the memory space and the access address, and accesses the memory space to be accessed according to the address of the starting position in the memory pool and the access length.
In a first possible implementation manner of the seventh aspect, the memory management device is further configured to allocate the memory space to the first computer in the memory pool, where the memory space includes at least one continuous sub-memory space, and record a computer identifier used to identify the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting position of each sub-memory space and an address of the starting position in the memory pool;
the memory management device is configured to determine address information of a memory space allocated to the first computer in the memory pool, and determine an address of the start position in the memory pool according to the address information of the memory space and the access address, and specifically includes:
the memory management device is configured to determine, according to the identifier of the first computer, recorded address information of a memory space allocated to the first computer, and determine, according to the access address and the recorded mapping relationship between the physical address of the starting position of each sub-memory space and the address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool.
With reference to the seventh aspect or the first possible implementation manner of the seventh aspect, in a second possible implementation manner, the memory management device includes a memory switch and a memory control device, each computer is connected to the memory switch through a system bus, the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool;
the first computer is specifically configured to send the memory access request to the memory switch;
the memory switch is configured to determine, when receiving the memory access request, that a computer sending the memory access request is the first computer according to a port connected to the first computer, add a computer identifier of the first computer to the memory access request, and send the memory access request carrying the computer identifier to the memory control device;
the memory control device is configured to, when receiving the memory access request, determine address information of a memory space allocated to the first computer according to the computer identifier, determine an address of the start position in the memory pool according to the address information of the memory space and the access address, and access the memory space to be accessed according to the address of the start position in the memory pool and the access length.
With reference to the second possible implementation manner of the seventh aspect, in a third possible implementation manner, the memory management device includes at least two memory control devices, and each memory control device is connected to one memory pool;
the memory switch is further configured to, when receiving a memory allocation request sent by the first computer, select a first memory control device of the at least two memory control devices to allocate the memory space for the first computer, and record a correspondence between a computer identifier of the first computer and a device identifier of the first memory control device; and determining that the memory access request needs to be sent to the first memory control device according to the corresponding relation before sending the memory access request carrying the computer identifier to the first memory control device.
With reference to the third possible implementation manner of the seventh aspect, in a fourth possible implementation manner, the memory access request is specifically a read memory request;
the first memory control device is further configured to send the computer identifier and the data read from the memory space to be accessed to the memory switch;
the memory switch is further configured to send the data to the first computer through a port connected to the first computer identified by the computer identifier.
With reference to the seventh aspect and any one of the first to fourth possible implementation manners of the seventh aspect, in a fifth possible implementation manner, the system further includes the memory pool.
According to the embodiment of the invention, the operating System of the computer can access the memory through a Basic Input/Output System (BIOS) of a Unified Extensible Firmware Interface (UEFI) instead of directly accessing the memory, and the UEFI BIOS of the computer can access the memory space in the memory pool deployed outside the computer through a System bus, so that the computer can use the memory space in the memory pool outside the computer, and the problem of insufficient memory space in the prior art is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1A, 1B and fig. 2 are schematic diagrams illustrating a networking structure of a system 100 for implementing memory access according to an embodiment of the present invention;
fig. 3A and 3B are schematic diagrams of memory spaces provided in embodiment 1 of the present invention;
fig. 4 is a schematic structural diagram of a computer 200 provided in embodiment 2 of the present invention;
fig. 5A and 5B are schematic structural diagrams of a memory management device 300 according to embodiment 3 of the present invention;
fig. 6A and 6B are schematic structural diagrams of the memory switch 400 according to embodiment 4 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1A is a schematic diagram of a networking structure of a system 100 for implementing memory access according to an embodiment of the present invention, where the system 100 includes at least two computers 110 and a memory management device 120.
Each computer 110 is connected to the memory management device 120 through a system bus, which may be a Peripheral Component Interconnect Express (PCIe) bus. In particular, the processor of each computer 110 is connected to the memory management device 120 via a system bus.
The memory management device 120 is connected to a memory pool, which includes a plurality of memories. The memory management device 120 manages the memory spaces of the plurality of memories in the memory pool as a whole memory space. In a specific implementation, the number of the memory pools may be one or more than two.
In a specific implementation, as shown in fig. 1B, the Memory is typically Dual-Inline-Memory-Modules (DIMMs), the DIMMs in a Memory pool are connected to one or more Memory expansion chips through Double Data Rate (DDR) interfaces, and the Memory management device 120 is specifically connected to the Memory expansion chips. The memory management device 120 may be connected to the memory expansion chip via a system bus, a memory bus (e.g., DIMM bus), or an ethernet.
As shown in fig. 2, the memory management device 120 may include a memory switch 120-1 and at least 1 memory control device 120-2, each computer 110 is connected to the memory switch 120-1, the memory switch 120-1 is connected to each memory control device 120-2, and the memory control devices 120-2 are connected to their corresponding memory pools. The memory switch 120-1 and each memory control device 120-2 may be connected via a system bus, a storage bus, or an ethernet. In the system 100 shown in fig. 2, all the storages to which 1 memory control device 120-2 is connected constitute one memory pool.
In a specific implementation, if 1 memory switch 120-1 is connected to 1 memory control device 120-2, the memory switch 120-1 and the memory control device 120-2 may be located in the same physical entity or in different physical entities; if 1 memory switch 120-1 is connected to at least two memory control devices 120-2, the memory switch 120-1 and each memory control device 120-2 are located in an independent physical entity.
The system 100 shown in FIG. 2 has two implementations, implementation A and implementation B.
In implementation a, the memory switch 120-1 manages the memory space allocated to each computer in the memory pool, for example, records address information of the allocated memory space, locates the memory space to be accessed according to the access address, the access length, and the recorded address information in the received memory access request, and executes the access operation. Implementation a is primarily applicable to a system 100 that deploys one memory pool.
In implementation B, the memory control device 120-2 manages the memory space allocated to each computer in the memory pool to which it is connected. Implementation B is applicable to both a system 100 that deploys one memory pool and a system 100 that deploys more than two memory pools.
The devices deployed in the memory management device 120 of fig. 1A, the memory switch 120-1 or the memory control device 120-2 of fig. 2 for managing the memory space allocated to each computer in the memory pool may be collectively referred to as a memory management device.
In this embodiment of the present invention, a certain computer-accessible memory may include a memory inside the computer (hereinafter referred to as a local memory) and a memory allocated by the memory management device 120 for the computer in a memory pool (hereinafter referred to as an extended memory), and accordingly, the physical address space of the computer includes a physical address space of the local memory and a physical address space of the extended memory.
When the computer is started, the UEFI BIOS of the computer generates a physical address space table, wherein the physical address space table comprises a physical address range of a local memory of the computer and a physical address range of the extended memory. As shown in table 1, the physical address space of the computer includes a 16G local memory and a 64G extended memory, and accordingly, the physical address space table of the computer includes a physical address range of the 16G local memory and a physical address range of the 64G extended memory.
Figure BDA0000689765720000191
TABLE 1
The memory space allocated by the memory management device for one of the computers includes at least one continuous sub-memory space, as shown in fig. 3A and 3B. The memory space shown in fig. 3A includes 1 sub-memory space, the memory space shown in fig. 3B includes 3 sub-memory spaces, and the 3 sub-memory spaces are not consecutive to each other.
Each computer accesses a location in memory using an address in the physical address space (i.e., a physical address). As shown in fig. 3B, the location P with address a2 in the memory pool, the corresponding physical address in the physical address space of the computer is a1, the computer accesses location P with physical address a1, and the memory management device may map the physical address a1 to a2, so that the location can be accessed with a 2.
The operation of the system 100 is described below in conjunction with fig. 1A and 2.
Memory allocation:
when one of the computers (hereinafter referred to as a first computer) is started, the first computer sends a memory allocation request to the memory management device 120 through the system bus, where the memory allocation request includes a start address and a length, so as to request the memory management device 120 to allocate a memory space of the length to the first computer. And the initial address in the memory allocation request is a physical address of the initial position of the memory space to be allocated.
Specifically, the UEFI BIOS of the first computer determines, when the first computer is started, a length of a memory space that needs to be allocated to the first computer by the memory management device, and sends the memory allocation request to the memory management device through the system bus. The specific implementation mode is as follows: when the first computer is started, the UEFI BIOS of the first computer checks the length (for example, 16G) of the local memory in the first computer, determines the difference between the preset length (for example, 80G) of the total memory space that needs to be used by the first computer and the length of the local memory as the length (for example, 64G) of the memory space that needs to be allocated to the first computer by the memory management device 120, generates a physical address space table as shown in table 1, and sends the memory allocation request to the memory management device 120 through the system bus.
It should be noted that the UEFI BIOS of the first computer runs on the processor of the first computer, that is, the processor of the first computer executes a computer program to implement the functions of the UEFI BIOS. The computer program for implementing UEFI BIOS functions is stored in the memory (i.e., local memory) or BIOS chip of the first computer.
After receiving the memory allocation request, the memory management device 120 allocates the memory space of the length to the first computer in the first memory pool of the at least one memory pool. The memory space includes at least one continuous sub-memory space, and if the allocated memory space includes more than two sub-memory spaces (as shown in fig. 3B), the total length of the more than two sub-memory spaces is equal to the length in the memory allocation request. Additionally, the memory management device 120 marks the memory space allocated to the first computer as allocated. The memory space currently in the allocated state is not allocated to other computers.
After allocating the memory space, the memory management device 120 records a computer identifier for identifying the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting position of each sub-memory space and an address of the starting position in the first memory pool. The memory management device 120 may also record the length of each sub-memory space.
If the allocated memory space comprises a sub-memory space (as shown in FIG. 3A). Correspondingly, a record is added in the memory allocation table, as shown in table 2A, in the record, the physical address of the starting position of the memory space is the starting address in the memory allocation request, and the length is the length in the memory allocation request.
Figure BDA0000689765720000211
TABLE 2A
If the allocated memory space includes more than two sub-memory spaces (as shown in FIG. 3B). Correspondingly, more than two records are added to the memory allocation table, as shown in table 2B, in the more than two records, the physical address of the starting position of the first sub memory space of the more than two allocated sub memory spaces is the starting address in the memory allocation request, and the physical address of the starting position of the nth sub memory space is the sum of the physical address of the starting position of the nth-1 st sub memory space and the length of the nth-1 st sub memory space (N >: 1).
Figure BDA0000689765720000221
TABLE 2B
The computer identifier of a certain computer recorded in the memory allocation table is used to uniquely identify the computer, and may specifically be a port number of a port connected to the computer on the memory management device 120.
In addition, when the first computer is powered off, a memory release request is sent to the memory management device 120, and when the memory management device 120 receives the memory release request, the memory space allocated to the first computer is released and marked as an idle state. The memory space currently in the free state may be allocated to any computer, for example, when a memory allocation request sent by a second computer connected to the memory management device is received, the memory space is allocated to the second computer from the memory space marked as the free state in the memory pool.
If the system 100 is implemented by the architecture shown in fig. 2, specifically, the first computer sends the memory allocation request to the memory switch 120-1. Memory allocation can be subsequently achieved in two ways.
The distribution mode A: corresponding to the foregoing implementation manner a, after the memory switch 120-1 instructs the memory control device 120-2 connected thereto to allocate the memory of the length in the memory pool connected thereto and receive the information (such as address information, length of each sub-memory space, and the like) of the allocated memory space returned by the memory control device 120-2, the computer identifier of the first computer and the information of the memory space are recorded in the memory allocation table, and the recorded content is as described above and is not described again.
And a distribution mode B: corresponding to the foregoing implementation B, the memory switch 120-1 adds the computer identifier of the first computer to the memory allocation request, and sends the memory allocation request including the computer identifier of the first computer to the memory control device 120-2 connected thereto, so as to request the memory control device 120-2 to allocate a memory for the first computer. If the memory switch 120-1 is connected to more than one memory control device 120-2, one memory control device 120-2 is selected, and the memory allocation request is sent to the selected memory control device 120-2. There are various ways to select the memory control device that allocates the memory for the first computer, which may be to randomly select one memory control device 120-2, or to select the memory control device 120-2 corresponding to the memory pool with the largest available space. For convenience of description, the memory control device 120-2 that allocates memory for the first computer will be referred to as a first memory control device later. And after receiving the memory allocation request, the first memory control device allocates the memory space for the first computer in a memory pool connected with the first memory control device. After the memory space is allocated, the memory management device 120 records the computer identifier of the first computer and the information of the memory space in the memory allocation table, and the recorded content is as described above and is not described again. In addition, the memory switch 120-1 may further record a correspondence between the computer identifier of the first computer and the device identifier of the first memory control device.
Memory access:
when the operating system of the first computer needs to access the memory, a memory access request is sent to the UEFI BIOS by calling an interface of the UEFI BIOS of the first computer so as to request to access the memory space to be accessed, the memory access request comprises an access address and an access length, the access address is a physical address of the starting position of the memory space to be accessed, and the access length is the length of the memory space to be accessed. In a specific implementation, an interface for receiving a memory access request may be added to the UEFI BIOS, where parameters of the interface include an access address parameter and an access length parameter, and the operating system may send the memory access request to the UEFI BIOS by calling the interface.
The length of the memory space to be accessed is smaller than the length of the memory space allocated to the first computer, the order of magnitude of the length of the memory space to be accessed is usually K, and the order of magnitude of the length of the memory space allocated to the first computer is usually G. In practical applications, the length of the memory space to be accessed is generally 4K.
The memory access request also comprises an access type so as to request to execute the access operation corresponding to the access type on the memory space to be accessed. The access type may be specifically a read or a write, and correspondingly, the memory access request may be specifically a read request or a write request. And if the request is a write request, the memory access request also comprises data to be written into the memory space to be accessed.
It should be noted that the operating system of the first computer runs on the processor of the first computer, that is, the processor of the first computer executes the computer program to implement the functions of the operating system. Computer programs for implementing operating system functions are stored in the local memory of the first computer.
And the UEFI BIOS judges whether the memory space to be accessed belongs to a local memory or an extended memory according to the access address. Specifically, it may be determined according to the physical address space table of the first computer that the access address belongs to a physical address range of a local memory or a physical address range of an extended memory, where if the access address belongs to the physical address range of the local memory, the memory space to be accessed belongs to the local memory, and if the access address belongs to the physical address range of the extended memory, the memory space to be accessed belongs to the extended memory.
If the access address belongs to the local memory, the UEFI BIOS directly accesses the memory space to be accessed in the local memory according to the access address and the access length; if the memory space belongs to the memory pool, the UEFIBIOS sends the memory access request to the memory management device 120 through the system bus to request to access the memory space to be accessed in the memory pool.
The memory management device 120 determines address information of a memory space allocated to the first computer in the first memory pool, determines an address of the start position in the first memory pool according to the address information of the memory space and the access address, and accesses the memory space to be accessed according to the address of the start position in the first memory pool and the access length, for example, reads data in the memory space to be accessed, or writes data included in the memory access request into the memory space to be accessed. And if the memory access request is a read request, returning the read data to the first computer through the system bus, specifically to the UEFI BIOS, and sending the read data to the operating system by the UEFIBIOS.
The way of calculating the address of the start position in the first memory pool is described below with reference to an example.
And taking the sub memory space comprising the memory space to be accessed as a target sub memory space. If the memory space allocated to the first computer only comprises one sub-memory space, the sub-memory space is the target sub-memory space; and if the target sub memory space comprises more than two sub memory spaces, determining the sub memory space to which the memory space to be accessed belongs according to the access address and the recorded physical address of the starting position of each sub memory space, and taking the sub memory space as the target sub memory space.
And calculating a first difference value of the access address and the physical address of the starting position of the target sub-memory space, and taking the sum of the address of the starting position of the target sub-memory space in the first memory pool and the first difference value as the address of the starting position of the memory space to be accessed in the first memory pool.
If the memory space allocated to the first computer includes 1 sub-memory space, the length is 100, the physical address of the starting location is 100, the address of the starting location in the first memory pool is 200, when the access address is 110 and the access length is 10, the calculated first difference is 110-.
As another example, the memory space allocated to the first computer includes 3 sub-memory spaces, the lengths of the sub-memory spaces are 50, the physical addresses of the starting locations are 100, 150, and 200, respectively, and the addresses in the first memory pool including the starting locations are 200, 300, and 500, respectively. When the access address is 160 and the access length is 10, the memory space to be accessed belongs to a second sub-memory space, the calculated first difference value is 160-.
If the system 100 is implemented by the architecture shown in FIG. 2, in particular, the memory access command is sent to the memory switch 120-1. Memory access can subsequently be achieved in two ways.
And an access mode A: corresponding to the foregoing implementation a, the memory switch 120-1 determines address information of a memory space allocated to the first computer in the first memory pool, determines an address of the start position in the first memory pool according to the address information of the memory space and the access address, and instructs the memory control device 120-2 to access the memory space to be accessed according to the address of the start position in the first memory pool and the access length. Specifically, the address of the start position in the first memory pool may be determined in the manner described above.
And the access mode B: corresponding to the foregoing implementation B, the memory switch 120-1 determines, according to the port connected to the first computer, that the computer sending the memory access request is the first computer, adds the computer identifier of the first computer to the memory access request, and sending the memory access request carrying the computer identifier to the first memory control device, the first memory control device determines address information of the memory space allocated to the first computer in the memory pool connected with the first memory control device (namely the first memory pool) according to the computer identification, determining the address of the starting position in the first memory pool according to the address information of the memory space and the access address, and accessing the memory space to be accessed according to the address of the starting position in the first memory pool and the access length. Specifically, the address of the start position in the first memory pool may be determined in the manner described above. If the memory access request is a read request, the first memory control device further returns the read data and the identifier of the first computer to the memory switch 120-1, and the memory switch 120-1 determines the first computer according to the identifier of the first computer and returns the read data to the first computer through a port connected to the first computer. If the memory switch 120-1 is connected to more than two memory control devices 120-2, before sending the memory access request carrying the computer identifier to the first memory control device, determining that the memory access request needs to be sent to the first memory control device according to the recorded correspondence between the computer identifier of the first computer and the device identifier of the first memory control device.
According to embodiment 1 of the present invention, an operating system of a computer may access a memory through UEFI BIOS, instead of directly accessing the memory through a DIMM bus between a processor and the memory, and the UEFI BIOS of the computer may access a memory space disposed in a memory pool outside the computer through a system bus, so that according to the computer in the system 100 and the implementation method thereof provided in embodiment 1 of the present invention, the computer may use the memory space in the memory pool outside the computer, thereby solving a problem of insufficient memory space in the prior art. In addition, the memory space allocated to a certain computer in the memory pool can be allocated to other computers after being released, so that a plurality of computers can share the memory pool, and the memory utilization rate is improved.
Accordingly, when receiving a memory access request sent by any computer, a memory management device deployed in a memory management device (or specifically deployed in a memory exchange device or a memory control device) may locate a memory space to be accessed in a memory pool according to an access address and an access length in the memory access request and perform an access operation, so that, by using the memory management device, any computer may access the memory space allocated to the computer in an external memory pool, and therefore, according to the memory management device deployed in the memory management device in the system 100 provided in embodiment 1 of the present invention, any computer connected to the memory management device may use the memory space in the memory pool external to the computer, thereby solving the problem of insufficient memory space in the prior art. In addition, the memory space allocated to a certain computer in the memory pool can be allocated to other computers after being released, so that a plurality of computers can share the memory pool, and the memory utilization rate is improved.
Referring to fig. 4, embodiment 2 of the present invention provides a computer 200. The computer 200 is connected to a memory management device via a system bus, the memory management device being connected to a memory pool, the memory pool including a plurality of memories.
As shown in fig. 4, the computer 200 includes an operating system module 210 and a BIOS module 220, the operating system module 210 is used to implement the functions of the operating system of the computer 200, and the BIOS module 220 is used to implement the functions of the UEFI BIOS of the computer 200.
The operating system module 210 is configured to send a memory access request to the BIOS module 220 by calling an interface of the BIOS module 220, so as to request to access a memory space to be accessed, where the memory access request includes an access address and an access length, the access address is a physical address of an initial position of the memory space to be accessed, and the access length is a length of the memory space to be accessed;
the BIOS module 220 is configured to determine, according to the access address, that a memory space requested to be accessed by the memory access request (i.e., the memory space to be accessed) belongs to a memory space allocated to the computer 200 in the memory pool, for example, determine, according to a physical address space table, a physical address range of the memory space allocated to the computer 200 in the memory pool by the access address, where the physical address space table includes a physical address range of a local memory of the computer 200 and a physical address range of a memory space allocated to the computer 200 in the memory pool; and is further configured to send the memory access request to the memory management device through the system bus to request to access the to-be-accessed memory space in the memory space allocated to the computer 200 in the memory pool.
The BIOS module 220 is further configured to determine, when the computer 200 is started, a length of a memory space that needs to be allocated to the computer 200 by the memory management device, for example, check a length of a local memory in the computer 200, and determine a difference between a preset length of a total memory space that needs to be used by the computer 200 and the length of the local memory as the length of the memory space that needs to be allocated to the computer 200 by the memory management device; and the memory allocation request including the length is sent to the memory management device to request the memory management device to allocate the memory space of the length to the computer in the memory pool.
The computer 200 provided in embodiment 2 of the present invention may be the first computer in embodiment 1 of the present invention, and accordingly, the operating system module 210 is configured to implement a function of an operating system of the first computer, and the BIOS module 220 is configured to implement a function of UEFI BIOS of the first computer.
According to embodiment 2 of the present invention, the operating system module of the computer 200 may access the memory through the BIOS module, instead of directly accessing the memory through the DIMM bus between the processor and the memory, and the BIOS module of the computer 200 may access the memory space disposed in the memory pool outside the computer 200 through the system bus, so that according to the computer 200 provided in embodiment 2 of the present invention, the computer 200 may use the memory space in the memory pool outside the computer 200, thereby solving the problem of insufficient memory space in the prior art. In addition, the memory space allocated to a certain computer 200 in the memory pool can be allocated to other computers 200 after being released, so that a plurality of computers 200 can share the memory pool outside the computer 200, thereby improving the memory utilization rate.
Referring to fig. 5A and 5B, embodiment 3 of the present invention provides a memory management device 300.
As shown in fig. 5A, the memory management device 300 includes: a receiving unit 310, a determining unit 320 and an accessing unit 330.
A receiving unit 310, configured to receive a memory access request sent by a first computer, where the memory access request is used to request to access a to-be-accessed memory space and includes an access address and an access length, the access address is a physical address of an initial position of the to-be-accessed memory space requested to be accessed by the memory access request, and the access length is a length of the to-be-accessed memory space;
a determining unit 320, configured to determine address information of a memory space allocated to the first computer in a memory pool, and determine an address of the starting location in the memory pool according to the address information of the memory space and the access address, where the memory pool includes a plurality of memories;
the accessing unit 330 is configured to access the memory space to be accessed according to the address of the starting position in the memory pool and the access length.
As shown in fig. 5B, the memory management apparatus 300 may further include an allocation unit 340 and a recording unit 350; an allocating unit 340, configured to allocate the memory space for the first computer in the memory pool, where the memory space includes at least one continuous sub-memory space; a recording unit 350, configured to record a computer identifier for identifying the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting position of each sub memory space and an address of the starting position in the memory pool; the determining unit 320 is specifically configured to determine, according to the identifier of the first computer, recorded address information of the memory space allocated to the first computer, and determine, according to the access address and the recorded mapping relationship between the physical address of the starting position of each sub-memory space and the address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool.
The allocating unit 340 may be further configured to release the memory space allocated to the first computer when the receiving unit 310 receives the memory release request sent by the first computer, mark the released memory space as an idle state, and allocate the memory space to a second computer from the memory space marked as the idle state in the memory pool when the receiving unit 310 receives the memory allocation request sent by the second computer connected to the memory management device.
In a specific implementation, the memory management apparatus 300 may be deployed in a memory management device of a system that implements memory access, where the system further includes the first computer, where the first computer is connected to the memory management device through a system bus, and the memory management device is connected to the memory pool.
The memory management device may include a memory switch and a memory control device, where the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool.
In an implementation manner, the memory management apparatus 300 may be deployed in the memory switch, where the access unit 330 is specifically configured to access the memory space to be accessed through the memory control device.
In another implementation manner, the memory management apparatus 300 is deployed in the memory control device, where the receiving unit 310 is specifically configured to receive, through the memory switch, the memory access request sent by the first computer, where the memory access request includes a computer identifier of the first computer added by the memory switch; the determining unit 320 is configured to determine that the memory space allocated to the first computer in the memory pool specifically includes that the determining unit 320 is configured to determine the memory space allocated to the first computer according to the computer identifier.
The memory management apparatus 300 provided in embodiment 3 of the present invention may be deployed in the memory management device 120 of the system 100 shown in fig. 1A and 1B in embodiment 1 of the present invention, may be deployed in the memory switch 120-1 of the system 100 shown in fig. 2 in embodiment 1 of the present invention, and may also be deployed in the memory control device 120-2 of the system 100 shown in fig. 2 in embodiment 1 of the present invention.
According to embodiment 3 of the present invention, when receiving a memory access request sent by any computer, the memory management device 300 may locate a memory space to be accessed in a memory pool according to an access address and an access length in the memory access request and execute an access operation, and therefore, through the memory management device 300, any computer may access the memory space allocated to the computer in an external memory pool, and therefore, according to the memory management device 300 provided in embodiment 3 of the present invention, any computer connected to it may use the memory space in the memory pool external to the computer, thereby solving the problem of insufficient memory space in the prior art. In addition, the memory space allocated to a certain computer in the memory pool can be allocated to other computers after being released, so that a plurality of computers can share the memory pool, and the memory utilization rate is improved.
Referring to fig. 6A and 6B, embodiment 4 of the present invention provides a memory switch 400, where the system for implementing memory access of the memory switch 400 further includes at least two computers and a memory control device, where each computer is connected to the memory switch 400 through a system bus, the memory switch 400 is connected to the memory control device, the memory control device is connected to a memory pool, and the memory pool includes a plurality of memories.
As shown in fig. 6A, the memory switch 400 includes: a receiving unit 410, an adding unit 420 and a transmitting unit 430.
A receiving unit 410, configured to receive a memory access request sent by a first computer of the at least two computers, where the memory access request is used to request to access a to-be-accessed memory space and includes an access address and an access length, the access address is a physical address of a starting position of the to-be-accessed memory space requested to be accessed by the memory access request, and the access length is a length of the to-be-accessed memory space;
an adding unit 420, configured to determine, according to a port connected to the first computer, that a computer that sends the memory access request is the first computer, and add a computer identifier that is used to identify the first computer to the memory access request;
a sending unit 430, configured to send a memory access request carrying the computer identifier to the memory control device, so that the memory control device determines, according to the computer identifier, a memory space allocated to the first computer, and accesses the memory space to be accessed in the memory space.
In a specific implementation, the system may include more than two memory control devices, and each memory control device is connected to one of the memory pools. Accordingly, as shown in fig. 6B, the memory switch 400 may further include a memory control device management unit 440.
The memory control device management unit is configured to, when the receiving unit 410 receives a memory allocation request sent by the first computer, select a first memory control device of the at least two memory control devices to allocate the memory space for the first computer, and record a correspondence between a computer identifier of the first computer and a device identifier of the first memory control device; and the memory access request is further used for determining that the memory access request needs to be sent to the first memory control device according to the corresponding relation.
The memory switch 400 provided in embodiment 4 of the present invention may specifically be the memory switch 120-1 of the system 100 provided in embodiment 1 of the present invention.
According to embodiment 4 of the present invention, when receiving a memory access request sent by any computer, the memory switch 400 may identify the computer, and send a computer identifier of the computer, which is carried in the memory access request, to the memory control device that manages the memory pool, so that the memory control device determines, according to the computer identifier, the memory space allocated to the first computer and accesses the memory space to be accessed in the memory space, and therefore, according to the memory switch 400 provided in embodiment 4 of the present invention, any computer may access the memory space allocated to the computer in the external memory pool, thereby solving the problem of insufficient memory space in the prior art. In addition, the memory space allocated to a certain computer in the memory pool can be allocated to other computers after being released, so that a plurality of computers can share the memory pool, and the memory utilization rate is improved.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (18)

1. A method for realizing memory access is characterized in that the method is applied to a system comprising a computer, a memory management device and a memory pool, wherein the computer is connected with the memory management device through a system bus, the memory management device is connected with the memory pool, and the memory pool comprises a plurality of memories; the method comprises the following steps:
the operating system of the computer sends a memory access request to a unified extensible firmware interface basic input output system (UEFI BIOS) by calling an interface of the UEFI BIOS, wherein the memory access request comprises an access address and an access length;
the UEFI BIOS determines that the memory space requested to be accessed by the memory access request belongs to the memory space allocated to the computer in the memory pool according to the access address, and sends the memory access request to the memory management equipment through the system bus, wherein the physical address of the initial position requested to be accessed is the access address, and the length of the memory access request is the memory space of the access length;
the UEFI BIOS checks the length of a local memory in the computer when the computer is started, determines the difference value between the preset length of the total memory space needed by the computer and the length of the local memory as the length of the memory space needed to be allocated to the computer by the memory management device, and sends a memory allocation request comprising the length of the memory space to the memory management device to request the memory management device to allocate the memory space with the length of the memory space to the computer in the memory pool.
2. The method according to claim 1, wherein the determining, according to the access address, that the memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in the memory pool specifically includes: and determining the physical address range of the memory space allocated to the computer by the access address in the memory pool according to a physical address space table, wherein the physical address space table comprises the physical address range of the memory space allocated to the computer in the memory pool.
3. A method for realizing memory access is characterized in that the method is executed by a memory management device; the method comprises the following steps:
receiving a memory access request sent by a first computer connected with the memory management device, wherein the memory access request is used for requesting to access a memory space to be accessed, the memory access request comprises an access address and an access length, the access address is a physical address of a starting position of the memory space to be accessed requested to be accessed by the memory access request, and the access length is the length of the memory space to be accessed;
allocating a memory space for the first computer in a memory pool, wherein the memory space comprises at least one continuous sub-memory space, and recording a computer identifier for identifying the first computer and address information of the memory space, and the address information of the memory space comprises a mapping relation between a physical address of a starting position of the at least one continuous sub-memory space and an address of the starting position in the memory pool;
determining recorded address information of a memory space allocated to the first computer according to a computer identifier of the first computer, determining an address of a starting position of the memory space to be accessed in the memory pool according to the access address, and a recorded mapping relation between a physical address of the starting position of the at least one continuous sub-memory space and the address of the starting position in the memory pool, and accessing the memory space to be accessed according to the address of the starting position of the memory space to be accessed in the memory pool and the access length.
4. The method of claim 3, wherein after allocating memory space for the first computer in the memory pool, the method further comprises:
releasing a memory space allocated to the first computer when a memory release request sent by the first computer is received, and marking the released memory space as an idle state;
and when a memory allocation request sent by a second computer connected with the memory management device is received, allocating a memory space for the second computer from the memory space marked as a free state in the memory pool.
5. The method according to claim 3 or 4, wherein the memory management apparatus is deployed in a memory management device of a system that implements memory access, the system further comprising the first computer and the memory pool, wherein the first computer is connected to the memory management device through a system bus, and the memory management device is connected to the memory pool.
6. The method according to claim 5, wherein the memory management device comprises a memory switch and a memory control device, the memory switch is connected with the memory control device, and the memory control device is connected with the memory pool;
the memory management device is deployed in the memory switch; the access unit is specifically configured to access the memory space to be accessed through the memory control device; alternatively, the first and second electrodes may be,
the memory management device is deployed in the memory control equipment; the receiving of the memory access request sent by the first computer connected to the memory management device is specifically that the memory control device receives, through the memory switch, the memory access request sent by the first computer, where the memory access request includes a computer identifier of the first computer added by the memory switch; the determining the recorded memory space allocated to the first computer is specifically that the memory control device determines the memory space allocated to the first computer according to the computer identifier.
7. A computer is characterized in that the computer is connected with a memory management device through a system bus, the memory management device is connected with a memory pool, and the memory pool comprises a plurality of memories; the computer comprises an operating system module and a BIOS module, wherein the operating system module is used for realizing the functions of an operating system of the computer, and the BIOS module is used for realizing the functions of UEFI BIOS of the computer;
the operating system module is used for sending a memory access request to the BIOS module by calling an interface of the BIOS module, wherein the memory access request comprises an access address and an access length;
the BIOS module is configured to determine, according to the access address, that a memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in the memory pool, and send, to the memory management device through the system bus, the memory access request such that a physical address of a starting position of the request for access is the access address, and a length of the memory space is the access length;
the BIOS module is further configured to check a length of a local memory in the computer when the computer is started, determine a difference between a preset length of a total memory space that the computer needs to use and the length of the local memory as a length of a memory space that the memory management device needs to allocate to the computer, and send a memory allocation request including the length of the memory space to the memory management device to request the memory management device to allocate the memory space of the length of the memory space to the computer in the memory pool.
8. The computer of claim 7, wherein the BIOS module is configured to determine, according to the access address, that the memory space requested to be accessed by the memory access request belongs to a memory space allocated to the computer in the memory pool, and specifically includes: the BIOS module is configured to determine, according to a physical address space table, a physical address range of a memory space allocated to the computer by the access address in the memory pool, where the physical address space table includes the physical address range of the memory space allocated to the computer in the memory pool.
9. A memory management device, the memory management device comprising: the device comprises a receiving unit, a determining unit, an accessing unit, a distributing unit and a recording unit;
the receiving unit is configured to receive a memory access request sent by a first computer connected to the memory management device, where the memory access request is used to request access to a to-be-accessed memory space, the memory access request includes an access address and an access length, the access address is a physical address of an initial position of the to-be-accessed memory space requested to be accessed by the memory access request, and the access length is a length of the to-be-accessed memory space;
the allocation unit is configured to allocate a memory space to the first computer in a memory pool, where the memory space includes at least one continuous sub-memory space;
the recording unit is configured to record a computer identifier of the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting position of the at least one continuous sub-memory space and an address of the starting position in the memory pool;
the determining unit is configured to determine, according to the computer identifier of the first computer, recorded address information of a memory space allocated to the first computer, and determine, according to the access address and a recorded mapping relationship between a physical address of a starting position of the at least one continuous sub-memory space and an address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool;
and the access unit is used for accessing the memory space to be accessed according to the address of the initial position of the memory space to be accessed in the memory pool and the access length.
10. The memory management device according to claim 9, wherein the allocating unit is further configured to, when the receiving unit receives a memory release request sent by the first computer, release the memory space allocated to the first computer, mark the released memory space as an idle state, and when the receiving unit receives a memory allocation request sent by a second computer connected to the memory management device, allocate a memory space for the second computer from the memory space marked as an idle state in the memory pool.
11. The memory management apparatus according to claim 9 or 10, wherein the memory management apparatus is disposed in a memory management device of a system that implements memory access, the system further comprising the first computer, wherein the first computer is connected to the memory management device through a system bus, and the memory management device is connected to the memory pool.
12. The memory management apparatus according to claim 11, wherein the memory management device includes a memory switch and a memory control device, the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool;
the memory management device is deployed in the memory switch; the access unit is specifically configured to access the memory space to be accessed through the memory control device; alternatively, the first and second electrodes may be,
the memory management device is deployed in the memory control equipment; the receiving unit is specifically configured to receive, through the memory switch, the memory access request sent by the first computer, where the memory access request includes a computer identifier of the first computer added by the memory switch; the determining unit is configured to determine, according to the computer identifier of the first computer, that the recorded memory space allocated to the first computer specifically includes the memory space allocated to the first computer, and the determining unit is configured to determine, according to the computer identifier of the first computer, the memory space allocated to the first computer.
13. A system for realizing memory access is characterized by comprising a memory management device and at least two computers, wherein each of the at least two computers is respectively connected with the memory management device through a system bus, the memory management device is connected with a memory pool, and the memory pool comprises a plurality of memories;
an operating system of a first computer of the at least two computers sends a memory access request to a UEFI BIOS through calling an interface of the UEFI BIOS to request to access a memory space to be accessed, wherein the memory access request comprises an access address and an access length, the access address is a physical address of a starting position of the memory space to be accessed, and the access length is the length of the memory space to be accessed;
the UEFI BIOS determines that the memory space requested to be accessed by the memory access request belongs to the memory space allocated to the first computer in the memory pool according to the access address, and sends the memory access request to the memory management equipment through the system bus, wherein the physical address of the starting position of the memory access request is the access address, and the length of the memory access request is the memory space of the access length;
the UEFI BIOS is further configured to check the length of a local memory in the first computer when the first computer is started, determine a difference value between the length of a preset total memory space required to be used by the first computer and the length of the local memory as the length of a memory space required to be allocated to the first computer by the memory management device, and send a memory allocation request including the length of the memory space to the memory management device to request the memory management device to allocate the memory space of the length of the memory space to the first computer in the memory pool;
the memory management device allocates a memory space for the first computer in a memory pool, wherein the memory space comprises at least one continuous sub-memory space, and records a computer identifier for identifying the first computer and address information of the memory space, and the address information of the memory space comprises a mapping relation between a physical address of a starting position of the at least one continuous sub-memory space and an address of the starting position in the memory pool;
the memory management device further determines, according to the computer identifier of the first computer, recorded address information of a memory space allocated to the first computer, determines, according to the access address, and the recorded mapping relationship between the physical address of the starting position of the at least one continuous sub-memory space and the address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool, and accesses the memory space to be accessed according to the address of the starting position of the memory space to be accessed in the memory pool and the access length.
14. The system according to claim 13, wherein the memory management device is further configured to allocate the memory space for the first computer in the memory pool, where the memory space includes at least one continuous sub-memory space, and record a computer identifier for identifying the first computer and address information of the memory space, where the address information of the memory space includes a mapping relationship between a physical address of a starting location of each sub-memory space and an address of the starting location in the memory pool;
the memory management device is further configured to determine, according to the identifier of the first computer, recorded address information of a memory space allocated to the first computer, and determine, according to the access address, and the recorded mapping relationship between the physical address of the starting position of each sub-memory space and the address of the starting position in the memory pool, an address of the starting position of the memory space to be accessed in the memory pool.
15. The system according to claim 13, wherein the memory management device comprises a memory switch and a memory control device, each of the at least two computers is connected to the memory switch through a system bus, the memory switch is connected to the memory control device, and the memory control device is connected to the memory pool;
the first computer is specifically configured to send the memory access request to the memory switch;
the memory switch is configured to determine, when receiving the memory access request, that a computer sending the memory access request is the first computer according to a port connected to the first computer, add a computer identifier of the first computer to the memory access request, and send the memory access request carrying the computer identifier to the memory control device;
the memory control device is configured to, when receiving the memory access request, determine address information of a memory space allocated to the first computer according to the computer identifier, determine an address of the start position in the memory pool according to the address information of the memory space and the access address, and access the memory space to be accessed according to the address of the start position in the memory pool and the access length.
16. The system according to claim 15, wherein the memory management device comprises at least two memory control devices, each of the at least two memory control devices being connected to one of the memory pools;
the memory switch is further configured to, when receiving a memory allocation request sent by the first computer, select a first memory control device of the at least two memory control devices to allocate the memory space for the first computer, and record a correspondence between a computer identifier of the first computer and a device identifier of the first memory control device; and determining that the memory access request needs to be sent to the first memory control device according to the corresponding relation before sending the memory access request carrying the computer identifier to the first memory control device.
17. The system of claim 16, wherein the memory access request is specifically a read memory request;
the first memory control device is further configured to send the computer identifier and the data read from the memory space to be accessed to the memory switch;
the memory switch is further configured to send the data to the first computer through a port connected to the first computer identified by the computer identifier.
18. The system of any one of claims 13-17, further comprising the memory pool.
CN201510140421.9A 2015-03-27 2015-03-27 Method, device and system for realizing memory access Active CN106155910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510140421.9A CN106155910B (en) 2015-03-27 2015-03-27 Method, device and system for realizing memory access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510140421.9A CN106155910B (en) 2015-03-27 2015-03-27 Method, device and system for realizing memory access

Publications (2)

Publication Number Publication Date
CN106155910A CN106155910A (en) 2016-11-23
CN106155910B true CN106155910B (en) 2021-02-12

Family

ID=57340259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510140421.9A Active CN106155910B (en) 2015-03-27 2015-03-27 Method, device and system for realizing memory access

Country Status (1)

Country Link
CN (1) CN106155910B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649133B (en) * 2016-12-29 2019-12-06 杭州迪普科技股份有限公司 Method and equipment for optimizing PCI (peripheral component interconnect) memory space
CN107066405A (en) * 2017-03-31 2017-08-18 联想(北京)有限公司 A kind of sharing method of memory device, interconnection subsystem and internal memory
CN113806244B (en) * 2021-11-18 2022-02-08 深圳比特微电子科技有限公司 Memory management method for system on chip and device based on system on chip
CN113821369A (en) * 2021-11-23 2021-12-21 苏州浪潮智能科技有限公司 Method, device and medium for memory polling

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928839A (en) * 2005-09-09 2007-03-14 中国科学院计算技术研究所 Long-distance inner server and its implementing method
CN1972215A (en) * 2006-12-06 2007-05-30 中国科学院计算技术研究所 A remote internal memory sharing system and its implementation method
CN102184139A (en) * 2010-06-22 2011-09-14 上海盈方微电子有限公司 Method and system for managing hardware dynamic memory pool

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5491808A (en) * 1992-09-30 1996-02-13 Conner Peripherals, Inc. Method for tracking memory allocation in network file server
US6418478B1 (en) * 1997-10-30 2002-07-09 Commvault Systems, Inc. Pipelined high speed data transfer mechanism
US8413161B2 (en) * 2009-09-29 2013-04-02 International Business Machines Corporation Work queue selection on a local processor within a multiple processor architecture
CN103034684A (en) * 2012-11-27 2013-04-10 北京航空航天大学 Optimizing method for storing virtual machine mirror images based on CAS (content addressable storage)

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928839A (en) * 2005-09-09 2007-03-14 中国科学院计算技术研究所 Long-distance inner server and its implementing method
CN1972215A (en) * 2006-12-06 2007-05-30 中国科学院计算技术研究所 A remote internal memory sharing system and its implementation method
CN102184139A (en) * 2010-06-22 2011-09-14 上海盈方微电子有限公司 Method and system for managing hardware dynamic memory pool

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网格化内存服务体系结构研究;李磊;《中国博士学位论文全文数据库(信息科技辑)》;中国学术期刊(光盘版)电子杂志社;20080815;第27-35页、第39-40页、第43页、第81页、图3.6(b)、图3.7、图4.5 *

Also Published As

Publication number Publication date
CN106155910A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
TWI575377B (en) Storage system with load balancing mechanism and method of operation thereof
US9760497B2 (en) Hierarchy memory management
JP6329318B2 (en) Information processing device
US9952788B2 (en) Method and apparatus for providing a shared nonvolatile memory system using a distributed FTL scheme
CN107924289B (en) Computer system and access control method
CN108628541B (en) File storage method, device and storage system
CN103577345A (en) Methods and structure for improved flexibility in shared storage caching by multiple systems
CN108845877B (en) Method, device and system for managing memory
KR20170008141A (en) System comprising non-volatile memory supporting multiple access modes and accessing method therof
CN106155910B (en) Method, device and system for realizing memory access
CN109308269B (en) Memory management method and device
EP3353664B1 (en) Method and apparatus for pinning memory pages in a multi-level system memory
US20170075615A1 (en) Storage system and storage control method
JP5942037B2 (en) Storage system having data management mechanism and operation method thereof
US9146693B2 (en) Storage control device, storage system, and storage control method
US7793051B1 (en) Global shared memory subsystem
US9317306B2 (en) Computer device and memory management method thereof
US11429518B2 (en) Paging in thin-provisioned disaggregated memory
JP2008198221A5 (en)
US20140281300A1 (en) Opportunistic Tier in Hierarchical Storage
JP2018113075A (en) Information processing device
US11860783B2 (en) Direct swap caching with noisy neighbor mitigation and dynamic address range assignment
CN111190550B (en) Metadata acceleration method and device and storage equipment
CN108932205B (en) Method and equipment for defending RowHammer attack
CN115421904A (en) Method and device for managing memory, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant