# US 2009/0276765 A1 · Compiler driven mechanism for registration and deregistration of memory pages

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2009/0276765 A1
- Document ID: US20090276765A1
- Status: Published application
- Kind: A1
- Application number: 12/111,991
- Filed: 2008-04-30
- Published: 2009-11-05
- Earliest claimed: 2008-04-30
- Assignees: International Business Machines Corporation
- Inventors: Dibyendu Das; Manish Gupta
- Web page: https://patentgrep.com/patent/US20090276765A1

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/456: {Parallelism detection}
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, system and article of manufacture are disclosed for registering and deregistering memory pages in a computer system. The method comprises the steps of hoisting register and deregister calls in a given routine where temporal locality is present to overlap computation and communication; using software pipelined registration and deregistration where spatial locality is observed; and using intra-procedural and inter-procedural analysis by a compiler of the computer system to deregister dynamically allocated buffers. The preferred embodiment of the invention is based on an optimizing compiler. The compiler is used to extract information such as addresses of buffers which are being reused repeatedly (temporal locality), preferably in a loop. The compiler may also find information about spatial locality, such as arrays whose indexes are used in a well-defined manner in a series of messages, for example, array pages being accessed in a pre-defined pattern in a loop.

## Claims

### Claim 1

A method of registering and deregistering memory pages in a computer system, comprising the steps of:
hoisting register and deregister calls in a given routine where temporal locality is present to overlap computation and communication;
using software pipelined registration and deregistration where spatial locality is observed; and
using intra-procedural and inter-procedural analysis by a compiler of the computer system to deregister dynamically allocated buffers.

### Claim 2 (depends on 1)

A method according to claim 1, wherein the locating step includes the steps of:
identifying buffer addresses being used plural times in a loop in said given routine; and
registering the buffer addresses outside said loop.

### Claim 3 (depends on 2)

A method according to claim 2, wherein the registering step includes the step of registering each buffer addresses only once.

### Claim 4 (depends on 3)

A method according to claim 3, wherein the locating step includes the further step of deregistering the buffer addresses once the loop exits.

### Claim 5 (depends on 1)

A method according to claim 1, wherein the step of using intra-procedural and inter-procedural analysis includes the steps of:
collecting calls in loops that need message transfer; and
for each of the collected calls, extracting a name of a buffer to be used by the call, a starting address of the buffer, and a length of data to be transferred into the buffer.

### Claim 6 (depends on 5)

A method according to claim 5, wherein the step of using intra-procedural and inter-procedural analysis includes the further steps of:
forming a triple comprised of said buffer name, starting address and length, and wherein said triple is found in one of the loops; and
determining whether said triple is invariant over said one of said loops.

### Claim 7 (depends on 6)

A method according to claim 6, wherein the step of using intra-procedural and inter-procedural analysis includes the further steps of:
extracting from one of the calls a Registration triple and a Deregistration triple;
hoisting the registration triple to before invocation of the loop, and
dropping the Deregistration triple to after the invocation of the loop.

### Claim 8 (depends on 1)

A method according to claim 1, wherein the step of using software pipelined registration and deregistration includes the step of registering ahead a page of the buffer to be used in a future iteration.

### Claim 9 (depends on 8)

A method according to claim 8, wherein the step of using software pipelined registration and deregistration includes the step of finding loops with message passing calls where the buffers used demonstrate spatial locality for a future iteration.

### Claim 10 (depends on 9)

A method according to claim 9, wherein the step of using software pipelined registration and deregistration includes the steps of:
for each of the buffers, finding the sizes of the buffer accessed in every iteration; and
for each iteration, calculating the number of pages that need to be registered and deregistered at either compile time or run time.

### Claim 11

A memory management system for registering and deregistering memory pages in a computer system, the memory management system comprising at least one processing unit configured for:
hoisting register and deregister calls in a given routine where temporal locality is present to overlap computation and communication;
using software pipelined registration and deregistration where spatial locality is observed; and
using intra-procedural and inter-procedural analysis by a compiler of the computer system to deregister dynamically allocated buffers.

### Claim 12 (depends on 11)

A memory management system according to claim 11, wherein the at least one processor unit is configured for performing the locating by:
identifying buffer addresses being used plural times in a loop in said given routine; and
registering the buffer addresses outside said loop.

### Claim 13 (depends on 12)

A memory management system according to claim 12, wherein the at least one processor unit is configured for performing the registering by registering each buffer addresses only once.

### Claim 14 (depends on 11)

A memory management system according to claim 11, wherein the at least one processor unit is configured for using intra-procedural and inter-procedural analysis by:
collecting calls in loops that need message transfer; and
for each of the collected calls, extracting a name of a buffer to be used by the call, a starting address of the buffer, and a length of data to be transferred into the buffer.

### Claim 15 (depends on 11)

A memory management system according to claim 11, wherein the at least one processor unit is configured for using software pipelined registration and deregistration by finding loops with message passing calls where the buffers used demonstrate spatial locality for a future iteration.

### Claim 16

An article of manufacture comprising
at least one computer usable medium having computer readable program code logic to execute a machine instruction in a processing unit for registering and deregistering memory pages in a computer system, said computer readable program code logic, when executing, performing the following steps:
hoisting register and sinking deregister calls in a given routine where temporal locality is present to overlap computation and communication;
using software pipelined registration and deregistration where spatial locality is observed; and
using intra-procedural and inter-procedural analysis by a compiler of the computer system to deregister dynamically allocated buffers.

### Claim 17 (depends on 16)

An article of manufacture according to claim 16, wherein the locating step includes the steps of:
identifying buffer addresses being used plural times in a loop in said given routine; and
registering the buffer addresses outside said loop.

### Claim 18 (depends on 17)

An article of manufacture according to claim 17, wherein the locating step includes the further step of deregistering the buffer addresses once the loop exits.

### Claim 19 (depends on 16)

An article of manufacture according to claim 16, wherein the step of using intra-procedural and inter-procedural analysis includes the steps of:
collecting calls in loops that need message transfer; and
for each of the collected calls, extracting a name of a buffer to be used by the call, a starting address of the buffer, and a length of data to be transferred into the buffer.

### Claim 20 (depends on 16)

An article of manufacture according to claim 16, wherein the step of using intra-procedural and inter-procedural analysis includes the steps of:
collecting calls in loops that need message transfer;
for each of the collected calls, extracting a name of a buffer to be used by the call, a starting address of the buffer, and a length of data to be transferred into the buffer;
forming a triple comprised of said buffer name, starting address and length, and wherein said triple is found in one of the loops;
determining whether said triple is invariant over said one of said loops;
extracting from one of the calls a Registration triple and a Deregistration triple;
hoisting the Registration triple to before invocation of the loop; and
dropping the Deregistration triple to after the invocation of the loop.
