CN116610594A - Space management method, device, operating system, equipment and storage medium - Google Patents

Space management method, device, operating system, equipment and storage medium Download PDF

Info

Publication number
CN116610594A
CN116610594A CN202310341848.XA CN202310341848A CN116610594A CN 116610594 A CN116610594 A CN 116610594A CN 202310341848 A CN202310341848 A CN 202310341848A CN 116610594 A CN116610594 A CN 116610594A
Authority
CN
China
Prior art keywords
partition
memory
user state
address space
user
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.)
Pending
Application number
CN202310341848.XA
Other languages
Chinese (zh)
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.)
Coretek Systems Inc
Original Assignee
Coretek Systems Inc
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 Coretek Systems Inc filed Critical Coretek Systems Inc
Priority to CN202310341848.XA priority Critical patent/CN116610594A/en
Publication of CN116610594A publication Critical patent/CN116610594A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/0284Multiple user address space allocation, e.g. using different base addresses
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention provides a space management method, a device, an operating system, equipment and a storage medium, wherein the method is used for managing private spaces of user state partitions and comprises the following steps: acquiring information of a memory block required by a first user mode partition, wherein the first user mode partition is any user mode partition, and the information at least comprises the size of the required memory block; and distributing memory blocks for the first user state partition from a shared memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the shared memory physical address space domain comprises memory blocks which can be distributed by all the user state partitions and are represented by physical addresses, and the memory logic address space domain of the first user state partition comprises memory blocks which can be distributed by the first user state partition and are represented by logic addresses thereof. According to the technical scheme provided by the embodiment of the invention, the shared space and the private space are managed separately, so that the space management of the user state partition is simplified, and the simplicity and maintainability of the operating system are improved.

Description

Space management method, device, operating system, equipment and storage medium
Technical Field
The present invention relates to the field of embedded operating systems, and in particular, to a method, an apparatus, an operating system, a device, and a storage medium for space management.
Background
In an embedded operating system supporting multiple processes, the space management of the processes is required to manage not only private spaces used by the processes, but also shared spaces of the processes; in space management of existing processes, a linked list is used to manage unallocated and allocated space blocks, and all processes share a logical address space domain.
The existing process space management is used for simultaneously managing the private space and the shared space, so that the complexity of an operating system is increased, and the performance and maintainability of the operating system are reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an operating system, a device, and a storage medium for space management, where the method is used for managing a private space of a user mode partition, and includes: acquiring information of a memory block required by a first user mode partition, wherein the first user mode partition is any user mode partition, and the information at least comprises the size of the required memory block; and distributing memory blocks for the first user state partition from a shared memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the shared memory physical address space domain comprises memory blocks which can be distributed by all the user state partitions and are represented by physical addresses, and the memory logic address space domain of the first user state partition comprises memory blocks which can be distributed by the first user state partition and are represented by logic addresses thereof. According to the technical scheme provided by the embodiment of the invention, the shared space and the private space are managed separately, so that the space management of the user state partition is simplified, and the simplicity and maintainability of the operating system are improved.
In a first aspect, an embodiment of the present invention provides a method for managing a space, where the method is used for managing a private space of a user mode partition, and the method includes: acquiring information of a memory block required by a first user mode partition, wherein the first user mode partition is any user mode partition, and the information at least comprises the size of the required memory block and the non-shared memory block of the required memory block; and distributing memory blocks for the first user state partition from a shared memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the shared memory physical address space domain comprises memory blocks which can be distributed by all the user state partitions and are represented by physical addresses, and the memory logic address space domain of the first user state partition comprises memory blocks which can be distributed by the first user state partition and are represented by logic addresses thereof.
By the method, the shared space and the private space are managed separately, and the memory blocks are distributed for the first user state partition from the shared memory physical address space domain and the memory logic address space domain of the first user state partition according to the information of the required memory blocks, so that the space management of the user state partition is simplified, and the simplicity and maintainability of an operating system are improved.
In a possible implementation manner of the first aspect, when allocating a memory block for the first user state partition from the common memory physical address space domain and the memory logical address space domain of the first user state partition according to the information, the method further includes: and storing the allocated memory blocks in the physical address space linked list and the logical address space linked list of the first user state partition by using the physical address and the logical address respectively.
By the above, the allocated space blocks of the user state partition are managed through the physical address space linked list and the logical address space linked list of the user state partition, so that the simplicity, the performance and the certainty of the operating system are further improved.
In a possible implementation manner of the first aspect, the method further includes: and when the first user state partition is deleted, deleting the memory block allocated for the first user state partition from the physical address space linked list and the logical address space linked list of the first user state partition, and releasing the memory block to the shared memory physical address space domain and the memory logical address space domain of the first user state partition.
And when the user mode partition is deleted, the space block allocated by the deleted partition is released back to the logic address space domain of the deleted partition. When the newly created user mode partition is the same as the ID of the deleted partition, the memory logic address space domain of the previously deleted partition is directly used, so that the performance and the certainty of the operating system are further improved.
In a possible implementation manner of the first aspect, when the information includes a physical start address of a required memory block, the physical start address of the memory block allocated for the first user state partition is the physical start address of the required memory block in the information; and/or when the information comprises the logic starting address of the required memory block, the logic starting address of the memory block allocated for the first user state partition is the logic starting address of the required memory block in the information.
By the method, the allocation of the required memory blocks of various information is supported, so that various memory block allocation scenes are adapted.
In a possible implementation manner of the first aspect, the method further includes: and initializing the shared memory physical address space domain and the memory logic address space domain of each user state partition according to the maximum user state partition number when the partition operating system is initialized.
By the method, the shared memory physical address space domain of all user-state partitions and the memory logic address space domain of each user-state partition are initialized according to the maximum partition number supported by the partition operating system, so that the performance and the certainty of the operating system are improved.
In a possible implementation manner of the first aspect, the method further includes: storing a physical starting address, a logical starting address and a size of a memory block allocated for the first user state partition in a partition control block of the first user state partition; the MMU at the first user state partition maps memory blocks stored in the partition control block of the first user state partition.
By storing the physical starting address, the logical starting address and the size of the allocated memory block in the partition control block of the user mode partition, the mapping of the physical and logical of the memory block is realized through the MMU.
In a second aspect, an embodiment of the present invention provides a space management apparatus for a user mode partition, configured to manage a private space of the user mode partition, including: the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring information of a memory block required by a first user state partition, the first user state partition is any user state partition, and the information at least comprises the size of the required memory block and the non-shared memory block of the required memory block; and the allocation module is used for allocating memory blocks for the first user state partition from a common memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the common memory physical address space domain comprises memory blocks of private spaces represented by physical addresses of all user state partitions, and the memory logic address space domain of the first user state partition comprises memory blocks of the private spaces represented by logic addresses of the first user state partition.
By the method, the shared space and the private space are managed separately, and the memory blocks are distributed for the first user state partition from the shared memory physical address space domain and the memory logic address space domain of the first user state partition according to the information of the required memory blocks, so that the space management of the user state partition is simplified, and the simplicity and maintainability of an operating system are improved.
In a possible implementation manner of the second aspect, the allocation module is further configured to store the allocated memory blocks in a physical address and a logical address in a physical address space linked list and a logical address space linked list of the first user state partition, respectively.
By the above, the allocated space blocks of the user state partition are managed through the physical address space linked list and the logical address space linked list of the user state partition, so that the simplicity, the performance and the certainty of the operating system are further improved.
In a possible implementation manner of the second aspect, the method further includes: and the deleting module is used for deleting the memory blocks distributed for the first user state partition in the physical address space linked list and the logical address space linked list of the first user state partition when the first user state partition is deleted, and releasing the memory blocks to the shared memory physical address space domain and the memory logical address space domain of the first user state partition.
And when the user mode partition is deleted, the space block allocated by the deleted partition is released back to the logic address space domain of the deleted partition. When the newly created user mode partition is the same as the ID of the deleted partition, the memory logic address space domain of the previously deleted partition is directly used, so that the performance and the certainty of the operating system are further improved.
In one possible implementation manner of the second aspect, when the information includes a physical start address of a required memory block, the physical start address of the memory block allocated for the first user state partition is the physical start address of the required memory block in the information; and/or when the information comprises the logic starting address of the required memory block, the logic starting address of the memory block allocated for the first user state partition is the logic starting address of the required memory block in the information.
By the method, the allocation of the required memory blocks of various information is supported, so that various memory block allocation scenes are adapted.
In a possible implementation manner of the second aspect, the method further includes: and the initialization module is used for initializing the shared memory physical address space domain and the memory logic address space domain of each user state partition according to the maximum user state partition number when the partition operating system is initialized.
By the method, the shared memory physical address space domain of all user-state partitions and the memory logic address space domain of each user-state partition are initialized according to the maximum partition number supported by the partition operating system, so that the performance and the certainty of the operating system are improved.
In a possible implementation manner of the second aspect, the allocation module is further configured to store, in the partition control block of the first user state partition, a physical starting address, a logical starting address, and a size of the memory block allocated for the first user state partition; and the MMU for mapping the memory blocks stored in the partition control blocks of the first user state partition.
By storing the physical starting address, the logical starting address and the size of the allocated memory block in the partition control block of the user mode partition, the mapping of the physical and logical of the memory block is realized through the MMU.
In a third aspect, an embodiment of the present invention provides an operating system, including a plurality of user-mode partitions, where the private space of the user-mode partition is managed by any one of the embodiments of the first aspect of the present invention.
In a fourth aspect, there is provided a computing device comprising: a bus; a communication interface connected to the bus; at least one processor coupled to the bus; and at least one memory coupled to the bus and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform any of the implementations of the first aspect of the invention.
In a fifth aspect, there is provided a computer readable storage medium having stored thereon program instructions which when executed by a computer cause the computer to perform any of the embodiments of the first aspect of the present invention.
Drawings
FIG. 1 is a schematic diagram of a user-state partition private space in various embodiments of a method for space management according to the present invention;
FIG. 2 is a flow chart of a method for space management according to an embodiment of the present invention;
FIG. 3 is a flow chart of a second embodiment of a method for space management according to the present invention;
FIG. 4 is a schematic structural diagram of a space management apparatus according to a first embodiment of the present invention;
FIG. 5 is a schematic diagram of a space management apparatus according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of a computing device according to various embodiments of the invention.
Detailed Description
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, references to the terms "first/second/third, etc." or module a, module B, module C, etc. are used merely to distinguish between similar objects or between different embodiments, and do not represent a particular ordering of the objects, it being understood that particular orders or precedence may be interchanged as permitted so that embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
In the following description, reference numerals indicating steps such as S110, S120, … …, etc. do not necessarily indicate that the steps are performed in this order, and the order of the steps may be interchanged or performed simultaneously as allowed.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
The embodiment of the invention provides a space management method, a device, an operating system, equipment and a storage medium, wherein the method is used for managing private spaces of user state partitions and comprises the following steps: acquiring information of a memory block required by a first user mode partition, wherein the first user mode partition is any user mode partition, and the information at least comprises the size of the required memory block; and distributing memory blocks for the first user state partition from a shared memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the shared memory physical address space domain comprises memory blocks which can be distributed by all the user state partitions and are represented by physical addresses, and the memory logic address space domain of the first user state partition comprises memory blocks which can be distributed by the first user state partition and are represented by logic addresses thereof. According to the technical scheme provided by the embodiment of the invention, the shared space and the private space are managed separately, so that the space management of the user state partition is simplified, and the simplicity and maintainability of the operating system are improved.
Partitioning is the abstraction of a relatively independent space, time, device resource, forming an entity that is as close as possible to the true independent computer resource. The partition is abstracted into a running unit with running space, running time, status, priority, scheduling policy, running context, binding running physical CPU attributes.
Each user mode partition operates in a user mode and its logical address space is independent of each other. For the shared space of the user mode partition, the physical address space of the shared space is the same; for private spaces of user-state partitions, the physical address space of the private spaces is not the same.
In order to simplify the space management of the user mode partition, the technical scheme of the invention only manages the private space of the user mode partition, but does not manage the shared space, and the shared space is managed by using a shared space object.
Embodiments of a method of spatial management according to the present invention are described below with reference to fig. 1-3.
FIG. 1 illustrates the structure of a user-state partitioned private space in various embodiments of a method of space management in accordance with the present invention.
The common memory physical address space domain of all user state partitions comprises the allocatable memory blocks of all user state partitions expressed by physical addresses, the allocatable memory blocks expressed by the physical addresses can be stored together in a linked list or other data structures, and the memory blocks distributed to each user state partition from the common memory physical address space domain form the private space of each user state partition.
The memory logical address space domain of each user mode partition comprises allocatable memory blocks which are expressed by the logical address space and seen by the user mode partition, and each allocatable memory block which is expressed by the logical address of each user mode partition can be stored together in a linked list or other data structures.
In a first embodiment of a method for space management, information of a memory block required by a first user mode partition is obtained, the first user mode partition is any user mode partition, and the information of the required memory block at least comprises the size of the required memory block; and distributing the memory blocks for the first user state partition from the shared memory physical address space domain and the memory logical address space domain of the first user state partition according to the information of the required memory blocks. The technical scheme of the embodiment simplifies the space management of the user state partition and improves the simplicity and maintainability of the operating system.
Fig. 2 shows a flow of a method embodiment one of space management, comprising steps S110 to S120.
For convenience of description, the embodiment is described by taking the first user state partition as an example, where the first user state partition is any user state partition.
S110: and acquiring the information of the memory block required by the first user state partition.
The information of the required memory block at least comprises the size of the required memory block, and the required memory block is not a shared memory block and is a memory block applied for the private space of the first user state partition.
In some embodiments, the information of the desired memory block further includes a physical starting address and/or a logical starting address of the desired memory block.
When the first user state partition is started, the step obtains information of a plurality of memory blocks required by the first user state partition, and the information is stored in a partition control block of the first user state partition.
When the memory block is applied according to the operation requirement in the operation process of the first user state partition, the information of the memory block applied by the first user state partition is acquired, and the information is transmitted through an interface function.
S120: and distributing the memory blocks for the first user state partition from the shared memory physical address space domain and the memory logical address space domain of the first user state partition according to the information of the required memory blocks.
The shared memory physical address space domain comprises the allocatable memory blocks of each user state partition expressed by physical addresses, and the memory logic address space domain of the first user state partition comprises the allocatable memory blocks of the first user state partition expressed by the logic addresses.
When the memory block is allocated to the first user mode partition, the physical address of the allocated memory block needs to be obtained from the common memory physical address space domain of all the user mode partitions, and the logical address of the allocated memory block is also obtained from the memory logical address space domain of the first user mode partition.
In some embodiments, when the information of the desired memory block includes a physical starting address of the desired memory block, the physical starting address of the memory block allocated for the first user state partition is the physical starting address of the desired memory block in the information of the desired memory block.
In some embodiments, when the information of the required memory block includes that the physical starting address of the required memory block is 0 or does not include the physical starting address of the required memory block, the memory block of the size of the matched required memory block is searched from the common memory physical address space domain of all user-state partitions.
In some embodiments, when the information of the required memory block includes a logical start address of the required memory block, the logical start address of the memory block allocated for the first user state partition is the logical start address of the required memory block in the information of the required memory block.
In some embodiments, when the information of the desired memory block includes that the logical starting address of the desired memory block is 0 or does not include that of the desired memory block, then the memory block of the size of the matched desired memory block is searched from the memory logical address space domain of the first user state partition.
In some embodiments, the common memory physical address space domain and the memory logical address space domain of each user state partition are initialized at partition operating system initialization.
In summary, in a first embodiment of a method for space management, memory blocks are allocated for a first user state partition from a common memory physical address space domain and a memory logical address space domain of the first user state partition according to information of the required memory blocks. The technical scheme of the embodiment simplifies the space management of the user state partition and improves the simplicity and maintainability of the operating system.
A second embodiment of the space management method inherits all the methods of the first embodiment of the space management method, has all the advantages of the first embodiment of the space management method, increases the physical address space linked list of each user mode partition and the logical address space linked list of the user mode partition to manage the allocated memory blocks from the physical address and the logical address respectively, and releases the allocated memory blocks from the physical address space linked list and the logical address space linked list of the user mode partition when the user mode partition is deleted. The technical scheme of the embodiment further improves the simplicity, performance and certainty of the operating system.
In the present embodiment, for convenience of description, the following data structures are defined:
1) maxPartitionNum represents the maximum partition number, partID represents the ID of the user state partition, and partID is 0, 1, 2 … maxPartitionNum-1;
2) The allPartPasDomain represents a common memory physical address space domain of the user mode partition, and manages memory blocks which can be used by all the user mode partitions from the physical address perspective;
3) The partPasBlockHead [ partID ] represents a physical address space linked list of the user-mode partition corresponding to the partID, and the used memory block of the user-mode partition corresponding to the partID is recorded from the physical address;
4) The partVasDomain [ partID ] represents a memory logical address space domain private to the user-mode partition corresponding to the partID, and manages memory blocks which can be used by the user-mode partition corresponding to the partID from a logical address perspective;
5) The partVasBlockHead [ partID ] represents a logical address space linked list of the user-state partition corresponding to the partID, and the memory block used by the user-state partition corresponding to the partID is recorded from the logical address angle.
Fig. 3 shows a flow of a method embodiment two of space management, comprising steps S210 to S240.
For convenience of description, the embodiment is described by taking the first user state partition as an example, where the first user state partition is any user state partition, and the partID is m.
S210: and initializing a shared memory physical address space domain of all user-state partitions and a memory logical address space domain of each user-state partition when the partition operating system is initialized.
Wherein the initializing comprises the following operations:
1) And sequentially adding the memory blocks which can be used by each user state partition to all PartPasDomain from the angle of physical addresses.
2) And sequentially adding the memory blocks which can be used by each user-state partition into private partVasDomain [ n ] of each user-state partition at the angle of a logical address, wherein n is 0, 1 and 2 … maxPortitionNum-1 in sequence.
In some embodiments, the partitioned operating system is a microkernel operating system.
In some embodiments, the private space size required for each user-state partition is the same, and the initialization of this step may be performed according to the number maxPartitionNum of user-state partitions.
S220: when the partition operating system creates the first user mode partition, information of memory blocks required by the first user mode partition is obtained.
The partition operating system sequentially stores information of each required memory block into a parameter partspace Arg [ x ] of each required memory block of the first user state partition according to partition space configuration parameters of the first user state partition, x is the number of the required memory block, 0, 1 and 2 … n are the number of the required memory blocks in sequence, and at least the size of the required memory block is the parameter, and the memory blocks belong to private spaces of users.
S230: and distributing the memory blocks for the first user state partition from the shared memory physical address space domain and the memory logical address space domain of the first user state partition in sequence according to the information of each required memory block of the first user state partition, and storing the distributed memory blocks in a physical address and a logical address in a physical address space linked list and a logical address space linked list of the first user state partition in sequence.
In this step, each required memory block of the first user mode partition is allocated in sequence, and the flow is the same, and for convenience of description, this step is described by taking the x-th required memory block as an example.
In this step, the required memory blocks are allocated according to the following centralized scenario or the combination scenario thereof.
1) When the physical starting address specified by the partSpaceArg [ x ], a memory block with the starting address of the physical starting address specified by the partSpaceArg [ x ] and the size of the space specified by the partSpaceArg [ x ] is distributed in the allPartPasDomain;
2) When the logic starting address specified by the partSpaceArg [ x ], a memory block with the starting address specified by the partSpaceArg [ x ] and the space size specified by the partSpaceArg [ x ] is distributed in the partVasDomain [ m ] (m points to the first user mode partition);
3) When the partSpaceArg [ x ] designates a physical starting address or a logical starting address as 0, memory blocks meeting the space size designated by partSpaceArg [ x ] are respectively allocated in allPartPasDomain and partVasDomain [ m ].
After the memory blocks are allocated to the first user mode partition in the above scenario or the combined scenario thereof, the following procedures are required to be completed:
1) The allocated memory blocks are recorded with physical addresses in the partPasBlockHead [ m ], and the allocated memory blocks are recorded with logical addresses in the partVasBlockHead [ m ].
2) The partition space block partSpace [ x ] in the partition control block records the physical starting address, logical address and size of the allocated memory block.
3) The spatial blocks recorded in the partSpace [ x ] are mapped in the MMU (memory management unit) of the first user state partition.
By the above, the allocated space blocks of the user state partition are managed through the physical address space linked list and the logical address space linked list of the user state partition, so that the simplicity, the performance and the certainty of the operating system are further improved.
It should be emphasized that the method for allocating the x-th required memory block in the first user state partition in this step is also suitable for applying for a new memory block in the running process of the first user state partition.
S240: when deleting the first user state partition, deleting the allocated memory blocks expressed by the physical addresses and the logical addresses from the physical address space linked list and the logical address space linked list of the first user state partition respectively, and releasing the memory blocks to the shared memory physical address space domain and the memory logical address space domain of the first user state partition.
The method comprises the following steps:
1) All memory blocks recorded in the partPasBlockHead [ m ] are released back to allpartpassdomain.
2) All memory blocks recorded in partVasBlockHead [ m ] are released back to partVasDomain [ m ].
3) The mapping of the partition space block partSpace [ x ] in the partition control block is sequentially deleted in the MMU of the first user state partition, and x is sequentially 0, 1 and 2 … n.
When the user mode partition is deleted, the space block allocated by the deleted partition is released back to the logical address space domain of the deleted partition. When the newly created user mode partition is the same as the ID of the deleted partition, the memory logic address space domain of the previously deleted partition is directly used, so that the performance and the certainty of the operating system are further improved.
It should be emphasized that when the operation process of the first user mode partition needs to release a memory block, the memory block is directly deleted from the physical address space linked list and the logical address space linked list of the first user mode partition, and released to the shared physical address space domain of the memory and the logical address space domain of the memory of the first user mode partition respectively, the memory block is also deleted from the partition space block in the partition control block of the first user mode partition, and the mapping of the memory block is also sequentially deleted from the MMU of the first user mode partition.
A second embodiment of the space management method is to add a physical address space linked list and a logical address space linked list shared by user state partitions to manage the allocated memory blocks, and delete the memory blocks as allocated memory blocks in the physical address space linked list and the logical address space linked list of the user state partition when the user state partition is deleted. The technical scheme of the embodiment further improves the simplicity, performance and certainty of the operating system.
Embodiments of a space management apparatus according to the present invention are described below in conjunction with fig. 4 and 5.
The technical scheme of the first embodiment of the space management device for operating the first embodiment of the space management method has all the advantages of the first embodiment of the space management method.
Fig. 4 shows a structure of an embodiment one of a device for space management, including: an acquisition module 410 and an allocation module 420. For convenience of description, the present embodiment is described by taking the first user state partition as an example.
The obtaining module 410 is configured to obtain information of a memory block required for the first user state partition, and the working principle and advantages thereof refer to step S110 of a method embodiment of space management.
The allocation module 420 is configured to allocate memory blocks for the first user state partition from the common memory physical address space domain and the memory logical address space domain of the first user state partition according to the information of the required memory blocks, and the working principle and advantages thereof refer to step S120 of a method embodiment of space management.
The second embodiment of the space management device runs the technical scheme of the second embodiment of the space management method, and has all the advantages of the second embodiment of the space management method.
Fig. 5 shows a structure of a second embodiment of a space management apparatus, including: an initialization module 510, an acquisition module 520, an allocation module 530, and a deletion module 540. For convenience of description, the present embodiment is described by taking the first user state partition as an example.
When the initialization module 510 is used for initializing the partition operating system, the common memory physical address space domain of all user-mode partitions and the memory logical address space domain of each user-mode partition are initialized, and the working principle and advantages thereof are shown in step S210 of a second embodiment of a space management method.
The obtaining module 520 is configured to obtain information of a memory block required by the first user state partition when the partition operating system creates the first user state partition, and reference is made to step S220 of a second embodiment of a space management method for its working principle and advantages.
The allocation module 530 is configured to allocate memory blocks for the first user state partition sequentially from the common memory physical address space domain and the memory logical address space domain of the first user state partition according to the information of each required memory block of the first user state partition, and store the allocated memory blocks in the physical address and logical address manner in the physical address space linked list and the logical address space linked list of the first user state partition sequentially, respectively, where the working principle and advantages of the allocation module refer to step S230 of a method embodiment two of space management.
The deletion module 540 is configured to delete the allocated memory blocks represented by the physical addresses and the logical addresses from the physical address space linked list and the logical address space linked list of the first user state partition when deleting the first user state partition, and release the memory blocks to the shared memory physical address space domain and the memory logical address space domain of the first user state partition, and the working principle and advantages thereof are shown in step S240 of the second embodiment of the method for space management.
The embodiment of the invention also provides an operating system which comprises a plurality of user state partitions, and the private space of the user state partitions is managed by the embodiments of the space management method, so that the method has the advantages of the embodiments of the space management method.
The embodiment of the invention also provides a computing device, which is described in detail below based on fig. 6.
The computing device 600 includes a processor 610, a memory 620, a communication interface 630, a bus 640.
It should be appreciated that the communication interface 630 in the computing device 600 shown in this figure may be used to communicate with other devices.
Wherein the processor 610 may be coupled to a memory 620. The memory 620 may be used to store the program codes and data. Accordingly, the memory 620 may be a storage unit internal to the processor 610, an external storage unit independent of the processor 610, or a component including a storage unit internal to the processor 610 and an external storage unit independent of the processor 610.
Optionally, computing device 600 may also include a bus 640. Memory 620 and communication interface 630 may be connected to processor 610 by bus 640. Bus 640 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (EFStended Industry Standard Architecture, EISA) bus, among others. The bus 640 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one line is shown in the figure, but not only one bus or one type of bus.
It should be appreciated that in embodiments of the present invention, the processor 610 may employ a central processing unit (central processing unit, CPU). The processor may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), field programmable gate arrays (field programmable gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 610 may employ one or more integrated circuits for executing associated routines to perform techniques provided by embodiments of the invention.
The memory 620 may include read only memory and random access memory, and provides instructions and data to the processor 610. A portion of the processor 610 may also include non-volatile random access memory. For example, the processor 610 may also store information of the device type.
When the computing device 600 is running, the processor 610 executes computer-executable instructions in the memory 620 to perform the methods described in the method embodiments.
It should be understood that the computing device 600 according to the embodiments of the present invention may correspond to a respective subject performing the methods according to the embodiments of the present invention, and that the above and other operations and/or functions of the respective modules in the computing device 600 are respectively for implementing the respective flows of the methods according to the embodiments, and are not described herein for brevity.
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 solution. 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 will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in 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 this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk.
The embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program for performing the method of the embodiments of the method when the program is executed by a processor.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the invention, which fall within the scope of the invention.

Claims (10)

1. A method for space management, wherein the method is used for managing private space of user-mode partition, and comprises the following steps:
acquiring information of a memory block required by a first user mode partition, wherein the first user mode partition is any user mode partition, and the information at least comprises the size of the required memory block and the non-shared memory block of the required memory block;
and distributing memory blocks for the first user state partition from a shared memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the shared memory physical address space domain comprises memory blocks which can be distributed by all the user state partitions and are represented by physical addresses, and the memory logic address space domain of the first user state partition comprises memory blocks which can be distributed by the first user state partition and are represented by logic addresses thereof.
2. The method of claim 1, wherein allocating memory blocks for the first user state partition from the shared memory physical address space domain and the memory logical address space domain of the first user state partition based on the information further comprises:
and storing the allocated memory blocks in a physical address mode and a logical address mode in a physical address space linked list and a logical address space linked list of the first user state partition respectively.
3. The method as recited in claim 2, further comprising: and when the first user state partition is deleted, deleting the memory block allocated for the first user state partition from the physical address space linked list and the logical address space linked list of the first user state partition, and releasing the memory block to the shared memory physical address space domain and the memory logical address space domain of the first user state partition.
4. The method of claim 1, wherein when the information includes a physical starting address of the desired memory block, the physical starting address of the memory block allocated for the first user state partition is the physical starting address of the desired memory block in the information; and/or
When the information includes the logical start address of the required memory block, the logical start address of the memory block allocated for the first user state partition is the logical start address of the required memory block in the information.
5. The method as recited in claim 1, further comprising: and initializing the shared memory physical address space domain and the memory logic address space domain of each user state partition according to the maximum user state partition number when the partition operating system is initialized.
6. The method as recited in claim 1, further comprising: storing a physical starting address, a logical starting address and a size of a memory block allocated for the first user state partition in a partition control block of the first user state partition;
the MMU at the first user state partition maps memory blocks stored in the partition control block of the first user state partition.
7. A space management device for user-mode partition, wherein the space management device is used for managing private space of user-mode partition, and comprises:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring information of a memory block required by a first user state partition, the first user state partition is any user state partition, and the information at least comprises the size of the required memory block and the non-shared memory block of the required memory block;
and the allocation module is used for allocating memory blocks for the first user state partition from a common memory physical address space domain and a memory logic address space domain of the first user state partition according to the information, wherein the common memory physical address space domain comprises memory blocks of private spaces represented by physical addresses of all user state partitions, and the memory logic address space domain of the first user state partition comprises memory blocks of the private spaces represented by logic addresses of the first user state partition.
8. A container operating system comprising a plurality of user-state partitions whose private spaces are managed by the method of any one of claims 1 to 6.
9. A computing device, comprising,
a bus;
a communication interface connected to the bus;
at least one processor coupled to the bus; and
at least one memory coupled to the bus and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of any of claims 1 to 6.
10. A computer readable storage medium having stored thereon program instructions, which when executed by a computer cause the computer to perform the method of any of claims 1 to 6.
CN202310341848.XA 2023-03-31 2023-03-31 Space management method, device, operating system, equipment and storage medium Pending CN116610594A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310341848.XA CN116610594A (en) 2023-03-31 2023-03-31 Space management method, device, operating system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310341848.XA CN116610594A (en) 2023-03-31 2023-03-31 Space management method, device, operating system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116610594A true CN116610594A (en) 2023-08-18

Family

ID=87680726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310341848.XA Pending CN116610594A (en) 2023-03-31 2023-03-31 Space management method, device, operating system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116610594A (en)

Similar Documents

Publication Publication Date Title
US9639459B2 (en) I/O latency and IOPs performance in thin provisioned volumes
US9448901B1 (en) Remote direct memory access for high availability nodes using a coherent accelerator processor interface
US20190155762A1 (en) Deallocation of memory buffer in multiprocessor systems
WO2017107414A1 (en) File operation method and device
CN114424172B (en) Virtual memory metadata management
US11003658B2 (en) Selectively retrieving data from remote share nothing computer clusters
CN113037529B (en) Reserved bandwidth allocation method, device, equipment and storage medium
US10956062B2 (en) Aggregating separate data within a single data log wherein single data log is divided in a plurality of blocks assigned to plurality of different streams
CN109960569B (en) Virtualization processing method and device
US20020103904A1 (en) Method and apparatus for controlling access to files associated with a virtual server
CN110928803B (en) Memory management method and device
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
US9021492B2 (en) Dual mode reader writer lock
KR20050076702A (en) Method for transferring data in a multiprocessor system, multiprocessor system and processor carrying out this method
US20150032987A1 (en) Computer program installation across multiple memories
CN112231282A (en) Managing quality of service in a network file sharing environment
CN116610594A (en) Space management method, device, operating system, equipment and storage medium
CN111090520A (en) User allocation method and device for exclusive resources, electronic equipment and storage medium
US9442835B1 (en) Dynamic memory allocation using suballocation of cell blocks
KR20060096569A (en) A apparatus and method for pool resource management by using multi-step allocation
CN117170863A (en) Memory allocation method, device, equipment and storage medium
US9946570B2 (en) Technology for dynamic resource pool master
US10037147B2 (en) Sharing files in a multisystem environment
CN117539398A (en) Method, device, equipment and medium for managing volume mapping
CN113918530A (en) Method and device for realizing distributed lock, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination