Dynamic optimization of computer programs using code-rewriting kernal module
First Claim
Patent Images
1. A method for dynamically optimizing computer programs using a code-rewriting kernel module, comprising the steps of:
- loading a computer program to be optimized into shared user-memory space;
executing the computer program;
analyzing the computer program as it executes, including the substep of collecting profile data about the computer program;
providing selected portions of the collected profile data to a kernel module located in kernel memory space;
generating at least one optimized translation of at least one portion of the computer program using the kernel module, the step of generating including using the kernel module to perform the substeps of;
examining the profile data to select at least one portion of the computer program for optimization; and
copying the at least one portion of the computer program into kernel memory space; and
patching the computer program into shared user memory space using the at least one optimized translation as the computer program continues to execute.
3 Assignments
0 Petitions
Accused Products
Abstract
The present invention is a system and method of using a kernel module to perform dynamic optimizations both of user programs and of the computer operating system kernel, itself. The kernel module permits optimized translations to be shared across a computer system without emulation because the kernel module has the privileges necessary to write into the computer program text in shared user memory space. In addition, the kernel module can be used to optimize the kernel itself because it, too, is located in the kernel memory space.
105 Citations
17 Claims
-
1. A method for dynamically optimizing computer programs using a code-rewriting kernel module, comprising the steps of:
-
loading a computer program to be optimized into shared user-memory space;
executing the computer program;
analyzing the computer program as it executes, including the substep of collecting profile data about the computer program;
providing selected portions of the collected profile data to a kernel module located in kernel memory space;
generating at least one optimized translation of at least one portion of the computer program using the kernel module, the step of generating including using the kernel module to perform the substeps of;
examining the profile data to select at least one portion of the computer program for optimization; and
copying the at least one portion of the computer program into kernel memory space; and
patching the computer program into shared user memory space using the at least one optimized translation as the computer program continues to execute. - View Dependent Claims (2, 3, 4, 5, 6, 7)
writing the at least one optimized translation into a code cache; and
inserting at least one jump instruction into the computer program to direct flow of control to the at least one optimized translation.
-
-
3. The method of claim 2, wherein the at least one optimized translation in the code cache is accessible by any computer process having access to the shared user memory space.
-
4. The method of claim 1, wherein the step of generating includes using the kernel module to perform the following substeps:
-
decoding the at least one portion of the computer program from an object code to an intermediate code;
optimizing the at least one portion of the computer program based on the profile data; and
encoding the optimized at least one portion of the computer program from intermediate code to object code.
-
-
5. The method of claim 1, wherein the step of analyzing includes the further substep of reducing the profile data to one or more traces and the step of providing comprises providing the one or more traces to the kernel module located in the kernel memory space.
-
6. The method of claim 1, wherein the step of analyzing is performed by a dynamic optimization helper located in the shared user memory space.
-
7. The method of claim 1, wherein the computer program is a shared library.
-
8. A method for dynamically optimizing a computer operating system kernel using a kernel module located in memory space, comprising the steps of:
-
executing a computer operating system program kernel located in kernel memory space of a computer;
analyzing the computer operating system kernel as it executes, including the substep of collecting profile data about the computer operating system program kernel;
providing profile data to a kernel module located in the kernel memory space;
generating at least one optimized translation of at least one portion of the computer operating system program kernel using the kernel module;
patching the computer operating system program using the at least one optimized translation as the computer operating system program kernel continues to execute; and
loading a dynamic optimization helper into kernel memory space, wherein the steps of analyzing and providing are performed by the dynamic optimization helper. - View Dependent Claims (9)
writing the at least one optimized translation into a code cache located in the kernel memory space;
inserting at least one jump instruction into the computer operating system program kernel to direct flow of control to the at least one optimized translation.
-
-
10. A computer system for dynamically optimizing computer programs using a code-rewriting module, comprising:
-
at least one processor, adapted to execute computer programs, including computer programs that are part of a computer operating system kernel;
a memory, operatively connected to the processor, adapted to store in kernel memory space a computer operating system program kernel and a code-rewriting kernel module, wherein the code-rewriting kernel module is adapted to receive profile data regarding a computer program stored in shared user memory space while the computer program is executing, and to optimize at least a portion of that executing computer program;
a dynamic optimization helper, wherein the dynamic optimization helper is located in shared user memory space and is adapted to analyze the computer program as it executes, collect profile data about the computer program, and provide selected portions of the collected profile data to the kernel module located in kernel memory space; and
wherein the kernel module is adapted to generate at least one optimized translation of at least one portion of the executing computer program. - View Dependent Claims (11, 12, 13, 14, 15)
a code cache memory, operatively connected to the kernel module and located in shared user space, wherein the kernel module is adapted to write at least one optimized translation into the code cache memory and to insert at least one jump instruction into the executing computer program to direct flow of control to the at least one optimized translation.
-
-
13. The computer system of claim 12, wherein the at least one optimized translation in the code cache is accessible by any computer process having access to the shared user memory space.
-
14. The computer system of claim 10, wherein the kernel module is adapted to:
-
examine the profile data to select at least a portion of the executing computer program for optimization;
copy the at least one portion of the computer program into kernel memory space;
decode the at least one portion of the computer program from an object code to an intermediate code;
optimize the at least one portion of the computer program based on the profile data; and
encode the optimized at least one portion of the computer program from intermediate code to object code.
-
-
15. The computer system of claim 10, wherein the dynamic organization helper is further adapted to reduce the profile data to one or more traces and provide the one or more traces to the kernel module.
-
16. A computer system for dynamically optimizing computer programs using a code-rewriting module, comprising:
-
at least one processor, adapted to execute computer programs, including computer programs that are part of a computer operating system kernel;
a memory, operatively connected to the processor, adapted to store in kernel memory space a computer operating system program kernel and a code-rewriting kernel module, wherein the code-rewriting kernel module is adapted to receive profile data regarding a computer program stored in shared user memory space while the computer program is executing, and to optimize at least a portion of that executing computer program; and
a dynamic optimization helper located in kernel memory space, wherein the dynamic optimization helper is adapted to analyze the computer operating system program kernel as it executes, collect profile data about the computer operating system program kernel, and provide the profile data into the kernel module. - View Dependent Claims (17)
-
Specification