CN103197957B - Page clone method when a kind of user program performs - Google Patents

Page clone method when a kind of user program performs Download PDF

Info

Publication number
CN103197957B
CN103197957B CN201310091265.2A CN201310091265A CN103197957B CN 103197957 B CN103197957 B CN 103197957B CN 201310091265 A CN201310091265 A CN 201310091265A CN 103197957 B CN103197957 B CN 103197957B
Authority
CN
China
Prior art keywords
page
fault
buffer
memory node
file
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
CN201310091265.2A
Other languages
Chinese (zh)
Other versions
CN103197957A (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.)
Wuxi Jiangnan Computing Technology Institute
Original Assignee
Wuxi Jiangnan Computing Technology Institute
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 Wuxi Jiangnan Computing Technology Institute filed Critical Wuxi Jiangnan Computing Technology Institute
Priority to CN201310091265.2A priority Critical patent/CN103197957B/en
Publication of CN103197957A publication Critical patent/CN103197957A/en
Application granted granted Critical
Publication of CN103197957B publication Critical patent/CN103197957B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Page clone method when a kind of user program performs, including: first step, utilize kernel to intercept and capture the page fault that there is page fault, it is determined that failure cause and page properties; Second step, it may be judged whether had page table page, if this page fault does not have page table page, then arrives third step; Third step, it is judged that whether page properties is the file page, if the file page, then to the 4th step; 4th step, it is judged that whether the failure cause of this document page is carried out fault, if performing fault, then to the 5th step. 5th step, it is determined that whether this document page is in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether page buffer is at process this locality memory node, if at process this locality memory node, then after filling page table, returns user; If not at process this locality memory node, then perform page replication actions, and discharge this page buffer.

Description

Page clone method when a kind of user program performs
Technical field
The present invention relates to field of computer technology, it is more particularly related to page clone method when a kind of user program performs.
Background technology
NUMA is the abbreviation of Non-UniformMemoryAccess, refers to have multiple memory node on multinuclear or multiprocessor machine, and the access time to different memory nodes sent from processor differs.
NUMA operating system is single reflection on the whole. But only internal memory and schedulable CPU are tied to the performance that on same NUMA node, competence exertion processor is the highest during actual motion, if this is because CPU is at a certain node, and there is another one node in using in it, will cause that memory access performance reduces due to the NUMA characteristic of hardware, so that the speed of service reduces.
NUMA operating system generally provides internal memory binding and CPU binding strategy, so that process uses local internal memory thus improving performance; But which is only for the datarams of process, the relevant binding measure of executable instruction internal memory to process, thus causing the process instruction page it may happen that across the situation of memory node memory access.
When server has NUMA characteristic and runs NUMA operating system, due to PageCache(page buffer, first the content of file can be left in page buffer when file system loads files into internal memory) share, cause that the routine text section on different node may drop on the page buffer of non-node, thus reducing performance.
Summary of the invention
The technical problem to be solved is for there is drawbacks described above in prior art, it is provided that page clone method when a kind of text segment page that can solve the problem that in NUMA operating system, process execution is required uses the problem of local memory node to perform with the user program improving program feature.
According to the present invention, it is provided that page clone method when a kind of user program performs, comprising:
First step: utilize kernel to intercept and capture the page fault that there is page fault, it is determined that failure cause and page properties;
Second step: judge whether this page fault has had page table page, if this page fault does not have page table page, then arrives third step;
Third step: whether the page properties judging this page fault is the file page, if the page properties of this page fault is the file page, then to the 4th step;
4th step: judge whether the failure cause of this document page is carried out fault, if performing fault, then to the 5th step;
5th step: determine that whether this document page is in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then after filling page table, returns user; If not at process this locality memory node, then perform page replication actions, and discharge this page buffer, after filling corresponding page table, return user.
Preferably, when described user program performs, page clone method also includes:
If the 4th step judges the failure cause of this document page and is not carried out fault, but Read fault or write fault, then to the 6th step;
6th step: determine that whether this document page is in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then fills corresponding page table, returns user; If not at process this locality memory node, and this page has attribute-executable simultaneously, then the page table attribute arranging this page is " during execution fault ", returns user after filling page table.
Preferably, when described user program performs, page clone method also includes:
Described 5th step and described 6th step enter the 7th step after having performed; And, if described second step judging, this page fault has had page table page, then to the 7th step;
7th step: determine the failure cause of this page, if fault during owing to performing, then enters the 8th step;
8th step: this page is performed duplication, discharges original page buffer page, rewrites new page table, removes " during execution fault " labelling in page table, returns user.
Preferably, failure cause includes Read fault, writes fault, performs fault.
Preferably, page properties includes the file page and the non-file page.
When user program according to the present invention performs, page clone method specifically performs the action that the page replicates two places, and one is the 5th step, and a place is the 8th step. 5th step is the page fault occurred when going to a brand-new page first, directly carries out the corresponding page according to NUMA internal memory binding strategy for this situation and replicates; 8th step is owing to some page has readable and can perform authority simultaneously, this kind of page is not due to when reading in internal memory first that performing skips leaf to be caused, for this kind of page, we can adopt the mode of " post processing ", first the page table page of the page is arranged " during execution fault " labelling (the 6th step), then page can be reported when processor goes to such page to perform fault, now according to above-mentioned flow processing, finally enter after the 8th step replicates the page and return user.
When the user program that the present invention proposes performs, page clone method is for the instruction memory region in NUMA operating system, when kernel judges all to be limited on certain memory node to this proceeding internal memory and CPU, but the text segment internal memory that acquiescence loading is come in is not on this node, page copy function during execution can be enabled, copy the corresponding text segment page to this node upon execution, to improve the text segment value performance of program.
And, it is also an advantage of the present invention that Page Localization problem when performing for user program, in conjunction with the mode adopting " pretreatment " and " post processing ", pretreatment is for first owing to performing the brand-new page page fault caused, replication actions is performed previously according to rule, " post processing ", for first owing to reading and writing the page loading caused, is only possible to triggering page replication actions when only really going to this page. " pretreatment " and " post processing " combines and carries out, and performance cost is little, and comprehensive income is big. It addition, this technology realizes in operating system nucleus, user program is fully transparent.
Accompanying drawing explanation
In conjunction with accompanying drawing, and by with reference to detailed description below, it will more easily the present invention is had more complete understanding and its adjoint advantage and feature is more easily understood, wherein:
Fig. 1 schematically shows the flow chart of page clone method during user program execution according to the preferred embodiment of the invention.
It should be noted that accompanying drawing is used for illustrating the present invention, and the unrestricted present invention. Note, represent that the accompanying drawing of structure is likely to be not necessarily drawn to scale. Further, in accompanying drawing, same or like element indicates same or like label.
Detailed description of the invention
In order to make present disclosure clearly with understandable, below in conjunction with specific embodiments and the drawings, present disclosure is described in detail.
As it has been described above, NUMA operating system generally provides internal memory binding and CPU binding strategy so that process uses local internal memory thus improving performance, but the method has certain limitation.
Concrete analysis, the internal memory that process uses logically has seen two aspects, and one is the datarams of process, and two is the instruction memory of process. The distribution influence process of datarams accesses the speed of data, the value speed of the distribution influence process of instruction memory. Datarams generally can carry out binding with the internal memory binding strategy that operating system provides and optimize, but current NUMA operating system is not all carry out corresponding strategy for instruction memory set and optimize. User program is usually one group of executable file and some that perform dynamic base composition, when user program performs, these executable files and dynamic base can be loaded in the page buffer of operating system, and page buffer can be fallen on certain memory node. These pages can be present in the middle of page buffer in the long duration, the dynamic base especially shared. So, when again performing application program or reuse same shared dynamic base, all can point to the page in same page buffer, and this page is likely to and the page of non-local memory node, thus causing that the situation across memory node memory access occurs in process value. If process is long playing, the expense brought due to the cross-node memory access of instruction fetch will increase.
For above-mentioned situation, the present invention is in NUMA operating system, and when process is bound at internal memory and CPU, the text segment page that process goes to also is tied to corresponding memory node, so that it is guaranteed that instruction Page Localization, improve the performance of fetching when process instruction performs. And, the method is realized by operating system nucleus, and consumer process is fully transparent.
Fig. 1 schematically shows the flow chart of page clone method during user program execution according to the preferred embodiment of the invention.
Specifically, as it is shown in figure 1, according to the preferred embodiment of the invention user program perform time page clone method include:
First step S1: utilize kernel to intercept and capture the page fault that there is page fault, it is determined that failure cause and page properties.Specifically, failure cause includes Read fault, writes fault, performs fault, and page properties includes the file page and the non-file page.
Second step S2: judge whether this page fault has had page table page, if this page fault does not have page table page, then arrives third step S3, if this page fault has had page table page, then to the 7th step S7.
Third step S3: whether the page properties judging this page fault is the file page, if the page properties of this page fault is the file page, then to the 4th step S4, if the page properties of this page fault is not the file page, then this flow process terminates, follow-up according to the original handling process process of operating system.
4th step S4: judge whether the failure cause of this document page is carried out fault, if performing fault, then to the 5th step S5, if not performing fault, but Read fault or write fault, then to the 6th step S6.
5th step S5: determine that whether this document page is in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then after filling page table, returns user; If not at process this locality memory node, then perform page replication actions, and discharge this page buffer, after filling corresponding page table, return user.
6th step S6: determine that whether this document page is in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then fills corresponding page table, returns user; If not at process this locality memory node, and this page has attribute-executable simultaneously, then the page table attribute arranging this page is " during execution fault ", returns user after filling page table.
7th step S7: determine the failure cause of this page, if fault during owing to performing, then enters the 8th step S8, if it is not, then this flow process terminates, follow-up according to the original flow processing of operating system.
8th step S8: this page is performed duplication, discharges original page buffer page, rewrites new page table, removes " during execution fault " labelling in page table, returns user.
According to flow process described above it will be seen that according to the preferred embodiment of the invention user program perform time page clone method specifically perform the page replicate action have two places, one is the 5th step S5, and a place is the 8th step S8. 5th step S5 is the page fault occurred when going to a brand-new page first, directly carries out the corresponding page according to NUMA internal memory binding strategy for this situation and replicates; 8th step S8 is owing to some page has readable and can perform authority simultaneously, this kind of page is not due to when reading in internal memory first that performing skips leaf to be caused, for this kind of page, we can adopt the mode of " post processing ", first the page table page of the page is arranged " during execution fault " labelling (the 6th step S6), then page can be reported when processor goes to such page to perform fault, now according to above-mentioned flow processing, finally enter after the 8th step S8 replicates the page and return user.
Certainly, other embodiments of the invention can only realize the action that the page of the 5th step replicates. But, the action performing page duplication has two places to be preferred.
When the user program that the preferred embodiment of the present invention proposes performs, page clone method is for the instruction memory region in NUMA operating system, when kernel judges all to be limited on certain memory node to this proceeding internal memory and CPU, but the text segment internal memory that acquiescence loading is come in is not on this node, page copy function during execution can be enabled, copy the corresponding text segment page to this node upon execution, to improve the text segment value performance of program.
And, the Page Localization problem being also advantageous in that when performing for user program of the preferred embodiment of the present invention, in conjunction with the mode adopting " pretreatment " and " post processing ", pretreatment is for first owing to performing the brand-new page page fault caused, replication actions is performed previously according to rule, " post processing ", for first owing to reading and writing the page loading caused, is only possible to triggering page replication actions when only really going to this page. " pretreatment " and " post processing " combines and carries out, and performance cost is little, and comprehensive income is big. It addition, this technology realizes in operating system nucleus, user program is fully transparent.
In addition, it should be noted that, unless otherwise indicated, otherwise the description such as the term in description " first ", " second ", " the 3rd " is used only for each assembly in differentiation description, element, step etc., rather than is used for logical relation or the ordering relation etc. that represent between each assembly, element, step.
Although it is understood that the present invention discloses as above with preferred embodiment, but above-described embodiment is not limited to the present invention. For any those of ordinary skill in the art, without departing under technical solution of the present invention ambit, all may utilize the technology contents of the disclosure above and technical solution of the present invention is made many possible variations and modification, or be revised as the Equivalent embodiments of equivalent variations. Therefore, every content without departing from technical solution of the present invention, the technical spirit of the foundation present invention, to any simple modification made for any of the above embodiments, equivalent variations and modification, all still falls within the scope of technical solution of the present invention protection.

Claims (3)

1. a page clone method when user program performs, it is characterised in that including:
First step: utilize kernel to intercept and capture the page fault that there is page fault, it is determined that failure cause and page properties;
Second step: judge whether this page fault has had page table page, if this page fault does not have page table page, then arrives third step;
Third step: whether the page properties judging this page fault is the file page, if the page properties of this page fault is the file page, then to the 4th step;
4th step: judge whether the failure cause of this document page is carried out fault, if performing fault, then to the 5th step;
5th step: determine that this document page is whether in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then after filling page table, returns user; If not at process this locality memory node, then perform page replication actions, and discharge this page buffer, after filling corresponding page table, return user;
Wherein, if the 4th step judges the failure cause of this document page and is not carried out fault, but Read fault or write fault, then perform the 6th step;
6th step: determine that this document page is whether in page buffer, if not in page buffer, is then loaded into page buffer; And, it is judged that whether the page buffer of this page fault is at process this locality memory node, if at process this locality memory node, then fills corresponding page table, returns user; If not at process this locality memory node, and this page has attribute-executable simultaneously, then the page table attribute arranging this page is " during execution fault ", returns user after filling page table;
And, if described second step judging, this page fault has had page table page, then perform the 7th step;
7th step: determine fault when whether the page properties of the page is the file page and page fault reason whether is perform, if it is determined that certainly, then enter the 8th step;
8th step: this page is performed duplication, discharges original page buffer page, rewrites new page table, removes " during execution fault " labelling in page table, returns user.
2. page clone method when user program according to claim 1 performs, it is characterised in that failure cause includes Read fault, writes fault, performs fault.
3. page clone method when user program according to claim 1 and 2 performs, it is characterised in that page properties includes the file page and the non-file page.
CN201310091265.2A 2013-03-20 2013-03-20 Page clone method when a kind of user program performs Active CN103197957B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310091265.2A CN103197957B (en) 2013-03-20 2013-03-20 Page clone method when a kind of user program performs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310091265.2A CN103197957B (en) 2013-03-20 2013-03-20 Page clone method when a kind of user program performs

Publications (2)

Publication Number Publication Date
CN103197957A CN103197957A (en) 2013-07-10
CN103197957B true CN103197957B (en) 2016-06-08

Family

ID=48720547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310091265.2A Active CN103197957B (en) 2013-03-20 2013-03-20 Page clone method when a kind of user program performs

Country Status (1)

Country Link
CN (1) CN103197957B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617113A (en) * 2003-11-13 2005-05-18 国际商业机器公司 Method of assigning virtual memory to physical memory, storage controller and computer system
CN101477496A (en) * 2008-12-29 2009-07-08 北京航空航天大学 NUMA structure implementing method based on distributed internal memory virtualization
CN101604263A (en) * 2009-07-13 2009-12-16 浪潮电子信息产业股份有限公司 A kind of method that realizes multi-duplicate running of core code segment of operation system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7222343B2 (en) * 2003-01-16 2007-05-22 International Business Machines Corporation Dynamic allocation of computer resources based on thread type
US20070083715A1 (en) * 2005-09-13 2007-04-12 International Business Machines Corporation Early return indication for return data prior to receiving all responses in shared memory architecture
US20120137079A1 (en) * 2010-11-26 2012-05-31 International Business Machines Corporation Cache coherency control method, system, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617113A (en) * 2003-11-13 2005-05-18 国际商业机器公司 Method of assigning virtual memory to physical memory, storage controller and computer system
CN101477496A (en) * 2008-12-29 2009-07-08 北京航空航天大学 NUMA structure implementing method based on distributed internal memory virtualization
CN101604263A (en) * 2009-07-13 2009-12-16 浪潮电子信息产业股份有限公司 A kind of method that realizes multi-duplicate running of core code segment of operation system

Also Published As

Publication number Publication date
CN103197957A (en) 2013-07-10

Similar Documents

Publication Publication Date Title
CN101542441B (en) Memory consistency protection in a multiprocessor computing system
US9218302B2 (en) Page table management
EP2979189B1 (en) Storing data from cache lines to main memory based on memory addresses
KR101768181B1 (en) Optimized browser rendering process
US20110153957A1 (en) Sharing virtual memory-based multi-version data between the heterogenous processors of a computer platform
CN106484383A (en) page rendering method, device and equipment
CN105659208A (en) Data processing apparatus and method for processing a plurality of threads
EP2842041B1 (en) Data processing system and method for operating a data processing system
US10769013B1 (en) Caching error checking data for memory having inline storage configurations
CN104199684B (en) The implementation method and device of browser cold start-up
JP2015530662A5 (en)
CN103870767A (en) Stack frame content protection method based on ebp (extended base pointer) structure
CN103226499A (en) Method and device for restoring abnormal data in internal memory
CN102750484A (en) Method and device for preventing virus sample self-checking
CN102981903B (en) A kind of method that in multi-core browser, process is multiplexing and multi-core browser thereof
CN117573419B (en) Page exception handling method and device
CN107977577A (en) access instruction access detection method and device
EP2645249A1 (en) Information processing apparatus, and method of controlling information processing apparatus
CN102037448A (en) Device emulation support within a host data processing apparatus
US9442826B2 (en) Kernel functionality checker
CN103197957B (en) Page clone method when a kind of user program performs
CN108459906A (en) A kind of dispatching method and device of VCPU threads
CN101650688B (en) Method for accessing VM_IO address space and user mode debugger
US8793663B2 (en) Smart cache for a server test environment in an application development tool
US8732442B2 (en) Method and system for hardware-based security of object references

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