CN102053916A - Method for distributing large continuous memory of kernel - Google Patents
Method for distributing large continuous memory of kernel Download PDFInfo
- Publication number
- CN102053916A CN102053916A CN2010105980027A CN201010598002A CN102053916A CN 102053916 A CN102053916 A CN 102053916A CN 2010105980027 A CN2010105980027 A CN 2010105980027A CN 201010598002 A CN201010598002 A CN 201010598002A CN 102053916 A CN102053916 A CN 102053916A
- Authority
- CN
- China
- Prior art keywords
- memory
- kernel
- order
- turning
- application
- 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.)
- Granted
Links
Images
Landscapes
- Memory System (AREA)
Abstract
The invention provides a method for distributing a large continuous memory of a kernel. The method comprises the following steps of: acquiring a maximum memory page Order during distribution of the kernel; calculating a required memory page number N; turning to a step F if determining that the order is a negative number; applying the memory according to the order if determining that the order is not a negative number; reducing the order and turning to a step C if the application fails; combining combinable memory blocks to serve as the continuous memory if the application is successful; turning to a step E if determining that a newly combined continuous memory which meets requirement exists; turning to the step C if determining that the newly combined continuous memory which meets requirement does not exist; turning to the step F when determining that the application is successful due to the existence of the memory which meets requirement; jumping to the step C if the memory which meets requirement does not exist; and releasing unused memory. By the method, large continuous memory blocks can be quickly distributed from the kernel; and compared with the conventional distribution method, the distribution time is shortened. The method is mainly guaranteed in two aspects: on one hand, a maximum number of distributable memories is used for applying to the kernel each time; and on the other hand, continuous regions are immediately combined and whether the combined memory meets requirement is immediately determined after the memory is distributed each time, so extra application operation is not required.
Description
Technical field
The present invention relates to the memory management field, be specifically related to a kind of fast method that distributes the large stretch of contiguous memory of kernel.
Background technology
Because the kernel memory source is limited, the effective utilization of internal memory and the functional performance of system are closely related.Different operating system provides different EMS memory management process, and the memory size that once obtains when different EMS memory management process causes applying for internal memory does not wait.If when need obtaining large stretch of contiguous memory, the distribution of internal memory and organizational form also exist bigger difference.At present, the large stretch of contiguous memory distribution method of big portion is to distribute a large amount of internal memories earlier, from wherein choosing the memory block that meets the demands, please refer to patent CN101676883 again.Therefore, when Installed System Memory was bigger, the Memory Allocation time was longer, has influenced allocative efficiency.
Present most of linux kernel provides once the application of 16M at most, can only once apply for 4M usually, if will be from a sheet of continuous internal memory of kernel application the time, needs the adjacent internal memory in polylith address.Adopt used method usually, earlier the available internal memory piece is all applied for, then memory block is pressed address sort, merge the continuum piece, find a Memory Allocation that meets the demands therein, divide and expend the long period.This scheme mainly contains some shortcoming: 1. the bigger system of internal memory, and possible internal memory is bigger, and the application distribution time is longer; 2. apply for that the internal memory that is assigned to need merge by address sort, time complexity is about the ordering time complexity of memory block.。Shortcoming in view of such scheme, the present invention proposes a kind of method of quick distribution, each application maximum memory piece, apply for internal memory on one side, judge on one side, as long as the internal memory that meets the demands is applied, storage allocation immediately, do not do unnecessary application and release work again, shortened the distribution time greatly, improved allocative efficiency.
Summary of the invention
The object of the invention provides a kind of method of distributing the large stretch of contiguous memory of kernel.
A kind of method of distributing the large stretch of contiguous memory of kernel is characterized in that: may further comprise the steps:
A, obtain the page Order that kernel divides the timing maximum;
B, calculating required memory number of pages N;
C, judgement order are negative, then change F.Otherwise according to order application internal memory, if failure, then order reduces to change step C,, if success then merges annexable memory block as contiguous memory;
Whether D, the new contiguous memory that merges of judgement meet the demands, and having then changes step e, otherwise changes step C;
E, if the internal memory that meets the demands is then applied for success, change step F; If the internal memory that does not meet the demands then jumps to step C;
F, release do not have the internal memory of use.
A kind of optimal technical scheme of the present invention is: the memory block of at every turn applying for maximum possible.
Another optimal technical scheme of the present invention is: can carry out the memory block ordering after the described C step application internal memory success.
Also a kind of optimal technical scheme of the present invention is: after the internal memory of satisfying the demand has distributed, stop immediately distributing.
The present invention can be assigned to the continuous memory block of bulk fast from kernel, more common distribution method has shortened the distribution time.Mainly contain two aspects and guarantee, on the one hand, but file an application to kernel with maximum storage allocation number at every turn, on the other hand, distribute internal memory after, instant merging continuum also judges whether to meet the demands immediately, does not need to do any unnecessary application work.
Description of drawings
Fig. 1 is a process flow diagram of the present invention
Fig. 2 is an optimal technical scheme process flow diagram of the present invention
Embodiment
1. obtain the page order that kernel divides the timing maximum;
When obtaining the application internal memory, the maximum memory number that once can apply for is the order power of page size.Here the address that promptly guarantees each memory block has guaranteed again that continuously each application memory block all is that maximum can be applied for memory block.
2. calculate required memory number of pages N;
Round on the merchant of required memory size and memory pages size and be taken as required memory number of pages N.
3. judge order, when negative, change step 6, otherwise the application internal memory.
Order may reduce along with reducing of system's free memory, when not having free page for dividing timing, is-1.When order is positive number, continue storage allocation.
4. if the internal memory application is failed, then order reduces, and changes step 3; If apply for successfully, merge annexable memory block as contiguous memory;
After the Memory Allocation failure, illustrative system has not had the contiguous memory piece of idle order size, reduces order and forwards step 3 to; If apply for successfully, then the address according to internal memory merges with the memory block that has distributed.
5. judge whether the internal memory that meets the demands, storage allocation has been arranged, changeed step 5, otherwise changeed step 3.
If step 4 does not merge, judge then whether newly assigned memory block satisfies the application demand, otherwise whether the determining step 4 new memory blocks that merge satisfy the application demand.If satisfy the demands then storage allocation, change step 5, otherwise change step 3 continuation application.
6. discharge the internal memory that does not have use.
In application process, may apply for a large amount of internal memories, the internal memory that does not have to use should return to system, uses for other programs.
Claims (4)
1. method of distributing the large stretch of contiguous memory of kernel is characterized in that: may further comprise the steps:
A, obtain the page Order that kernel divides the timing maximum;
B, calculating required memory number of pages N;
C, judgement order are negative, then change F.Otherwise according to order application internal memory, if failure, then order reduces to change step C,, if success then merges annexable memory block as contiguous memory;
Whether D, the new contiguous memory that merges of judgement meet the demands, and having then changes step e, otherwise changes step C;
E, if the internal memory that meets the demands is then applied for success, change step F; If the internal memory that does not meet the demands then jumps to step C;
F, release do not have the internal memory of use.
2. a kind of according to claim 1 method of distributing the large stretch of contiguous memory of kernel is characterized in that: the memory block of at every turn applying for maximum possible.
3. a kind of according to claim 1 method of distributing the large stretch of contiguous memory of kernel is characterized in that: can carry out the memory block ordering after the described C step application internal memory success.
4. a kind of according to claim 1 method of distributing the large stretch of contiguous memory of kernel is characterized in that: after the internal memory of satisfying the demand has distributed, stop immediately distributing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010598002 CN102053916B (en) | 2010-12-17 | 2010-12-17 | Method for distributing large continuous memory of kernel |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010598002 CN102053916B (en) | 2010-12-17 | 2010-12-17 | Method for distributing large continuous memory of kernel |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102053916A true CN102053916A (en) | 2011-05-11 |
CN102053916B CN102053916B (en) | 2013-06-05 |
Family
ID=43958261
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010598002 Active CN102053916B (en) | 2010-12-17 | 2010-12-17 | Method for distributing large continuous memory of kernel |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102053916B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365897A (en) * | 2012-04-01 | 2013-10-23 | 华东师范大学 | Fragment caching method supporting Bigtable data model |
CN104281537A (en) * | 2013-07-05 | 2015-01-14 | 阿里巴巴集团控股有限公司 | Memory copying method and device |
CN106227593A (en) * | 2016-07-06 | 2016-12-14 | 杭州迪普科技有限公司 | A kind of method and device applying for super large block contiguous memory |
CN106649148A (en) * | 2016-10-11 | 2017-05-10 | 东软集团股份有限公司 | Method and device for large page allocation |
CN109062823A (en) * | 2018-07-16 | 2018-12-21 | 北京中科网威信息技术有限公司 | The method and device of the equipment performance based on Shen prestige framework is promoted using big page memory |
WO2019072094A1 (en) * | 2017-10-11 | 2019-04-18 | 晶晨半导体(上海)股份有限公司 | Memory allocation method and multi-core concurrent memory allocation method |
WO2019072093A1 (en) * | 2017-10-11 | 2019-04-18 | 晶晨半导体(上海)股份有限公司 | Memory release method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009259326A (en) * | 2008-04-16 | 2009-11-05 | Toshiba Corp | Semiconductor memory device |
JP2009289014A (en) * | 2008-05-29 | 2009-12-10 | Hitachi Ulsi Systems Co Ltd | Storage device |
CN101604291A (en) * | 2008-06-12 | 2009-12-16 | 联阳半导体股份有限公司 | Promote the method for the data access reliability of non-volatile memory of multistage cell |
CN101681311A (en) * | 2008-02-28 | 2010-03-24 | 株式会社东芝 | Memory system |
-
2010
- 2010-12-17 CN CN 201010598002 patent/CN102053916B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101681311A (en) * | 2008-02-28 | 2010-03-24 | 株式会社东芝 | Memory system |
JP2009259326A (en) * | 2008-04-16 | 2009-11-05 | Toshiba Corp | Semiconductor memory device |
JP2009289014A (en) * | 2008-05-29 | 2009-12-10 | Hitachi Ulsi Systems Co Ltd | Storage device |
CN101604291A (en) * | 2008-06-12 | 2009-12-16 | 联阳半导体股份有限公司 | Promote the method for the data access reliability of non-volatile memory of multistage cell |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365897A (en) * | 2012-04-01 | 2013-10-23 | 华东师范大学 | Fragment caching method supporting Bigtable data model |
CN104281537A (en) * | 2013-07-05 | 2015-01-14 | 阿里巴巴集团控股有限公司 | Memory copying method and device |
CN104281537B (en) * | 2013-07-05 | 2017-09-08 | 阿里巴巴集团控股有限公司 | A kind of internal memory clone method and device |
CN106227593A (en) * | 2016-07-06 | 2016-12-14 | 杭州迪普科技有限公司 | A kind of method and device applying for super large block contiguous memory |
CN106649148A (en) * | 2016-10-11 | 2017-05-10 | 东软集团股份有限公司 | Method and device for large page allocation |
CN106649148B (en) * | 2016-10-11 | 2020-04-17 | 东软集团股份有限公司 | Method and apparatus for large page allocation |
WO2019072094A1 (en) * | 2017-10-11 | 2019-04-18 | 晶晨半导体(上海)股份有限公司 | Memory allocation method and multi-core concurrent memory allocation method |
WO2019072093A1 (en) * | 2017-10-11 | 2019-04-18 | 晶晨半导体(上海)股份有限公司 | Memory release method |
US11294720B2 (en) | 2017-10-11 | 2022-04-05 | Amlogic (Shanghai) Co., Ltd. | CMA memory allocation method based on screening marks |
US11409646B2 (en) | 2017-10-11 | 2022-08-09 | Amlogic (Shanghai) Co., Ltd. | Method for releasing memory |
CN109062823A (en) * | 2018-07-16 | 2018-12-21 | 北京中科网威信息技术有限公司 | The method and device of the equipment performance based on Shen prestige framework is promoted using big page memory |
Also Published As
Publication number | Publication date |
---|---|
CN102053916B (en) | 2013-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102053916B (en) | Method for distributing large continuous memory of kernel | |
EP3073374B1 (en) | Thread creation method, service request processing method and related device | |
CN102156675B (en) | Method and device for allocating memory | |
CN108462656B (en) | Container-based resource scheduling method and device for service convergence deployment | |
CN101847127B (en) | Memory management method and device | |
CN104978232A (en) | Computation resource capacity expansion method for real-time stream-oriented computation, computation resource release method for real-time stream-oriented computation, computation resource capacity expansion device for real-time stream-oriented computation and computation resource release device for real-time stream-oriented computation | |
CN108038002A (en) | A kind of embedded software EMS memory management process | |
CN107209716B (en) | Memory management device and method | |
CN102843419A (en) | Service resource allocation method and service resource allocation system | |
CN110990154B (en) | Big data application optimization method, device and storage medium | |
CN102520887A (en) | Storage space configuration and management method applied to cloud computing | |
CN104615500A (en) | Method for dynamically distributing computing resources of server | |
CN103002044A (en) | Method for improving processing capability of multi-platform intelligent terminal | |
CN101329655A (en) | Memory management method and device | |
CN111104219A (en) | Binding method, device, equipment and storage medium of virtual core and physical core | |
CN103077120A (en) | Address conversion method and device of application shared memory | |
CN102455976A (en) | Middleware memory management scheme | |
CN103778149A (en) | Document system and document storage managing method thereof | |
CN104461404A (en) | Metadata storage method, device and system | |
US9760454B2 (en) | High availability method and system for improving the utility of physical servers in cloud computing resource pool | |
CN102439570A (en) | Memory management method and device aiming at multi-step length non conformance memory access numa framework | |
CN105630599A (en) | Video memory distribution method and device based on 32/64-bit hybrid operating system | |
CN104468710A (en) | Mixed big data processing system and method | |
CN102375780A (en) | Metadata cache management method in distributed file system | |
CN105630602B (en) | A kind of method of resource for computer system dynamic adjustment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20221209 Address after: 430040 NO.666, Wuhuan Avenue, linkonggang economic and Technological Development Zone, Wuhan City, Hubei Province (10) Patentee after: Dawning Network Technology Co.,Ltd. Address before: 300384 Xiqing District, Tianjin Huayuan Industrial Zone (outside the ring) 15 1-3, hahihuayu street. Patentee before: DAWNING INFORMATION INDUSTRY Co.,Ltd. |
|
TR01 | Transfer of patent right |