# US 8,543,769 B2 · Fine grained cache allocation

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

- Number: US 8,543,769 B2
- Document ID: US8543769B2
- Status: Granted
- Kind: B2
- Application number: 12/509,752
- Filed: 2009-07-27
- Published: 2011-01-27
- Granted: 2013-09-24
- Earliest claimed: 2009-07-27
- Assignees: International Business Machines Corporation
- Applicants: Ramakrishnan Rajamony; William E. Speight; Lixin Zhang
- Inventors: Ramakrishnan Rajamony; William E. Speight; Lixin Zhang
- Web page: https://patentgrep.com/patent/US8543769B2

## CPC

- G06F 12/084: with a shared cache
- G06F 12/0864: using pseudo-associative means, e.g. set-associative or hashing
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A mechanism is provided in a virtual machine monitor for fine grained cache allocation in a shared cache. The mechanism partitions a cache tag into a most significant bit (MSB) portion and a least significant bit (LSB) portion. The MSB portion of the tags is shared among the cache lines in a set. The LSB portion of the tags is private, one per cache line. The mechanism allows software to set the MSB portion of tags in a cache to allocate sets of cache lines. The cache controller determines whether a cache line is locked based on the MSB portion of the tag.

## Claims

### Claim 1

A method, in a data processing system, for fine grained cache allocation of a shared cache, the method comprising:
receiving, by a cache controller, a tag portion from an application, within a plurality of applications, to allocate a group of cache lines in a shared cache to the application, wherein each cache line within the shared cache has a tag having a most significant bit portion and a least significant hit portion, wherein the shared cache is shared between the plurality of applications, wherein the most significant bit portion of the tag comprises a group tag for each group of cache lines, wherein the least significant bit portion of the tag comprises a private tag for each respective cache line, wherein only cache lines with the most significant bit portion of the tag can be cached in the group of cache lines;
allocating the group of cache lines to the application by setting the most significant hit tag portion to the tag portion horn the application for the group of cache lines in a tag array of the shared cache;
responsive to an attempt to overwrite a given cache line within the group of cache lines, determining whether the given cache line is locked to the application based on the most significant bit tag portion of the given cache line; and
overwriting, by the cache controller, the given cache line if the cache line is not locked, wherein overwriting the given cache line comprises overwriting a most significant bit portion of a tag of the given cache line.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining whether the given cache line is locked comprises:
determining whether a lock bit associated with the most significant bit tag portion associated with the given cache line is set.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
receiving, by the cache controller, a mask from the application; and
storing the mask in association with the most significant bit tag portion or the group of cache lines.

### Claim 4 (depends on 3)

The method of claim 3, wherein determining whether the given cache line is locked comprises:
applying the mask to a real address associated with the given cache line to generate a masked real address; and
determining whether the masked real address is equal to the most significant bit tag portion associated with the given cache line.

### Claim 5 (depends on 1)

The method of claim 1, wherein a virtual machine monitor allocates a set of real addresses to a given virtual machine.

### Claim 6 (depends on 5)

The method of claim 5, wherein the application executes within the given virtual machine and writes the tag portion to the tag array of the shared cache.

### Claim 7

An apparatus, in a data processing system, for fine grained cache allocation of a shared cache, the apparatus comprising:
a cache array; and
a cache controller coupled the cache array, wherein the cache controller is configured to:
receive a tag portion from an application, within a plurality of applications, to allocate a group of cache lines in a shared cache to the application, wherein each cache line within the shared cache has a tag having a most significant bit portion and a least significant bit portion, wherein the shared cache is shared between the plurality of applications, wherein the most significant bit portion of the tag comprises a group tag for each group of cache lines, wherein the least significant bit portion of the tag comprises a private tag for each respective cache line, and wherein only cache lines with the most significant bit portion of the tag can be cached in the group of cache lines;
allocating the group of cache lines to the application by setting the most significant bit tag portion to the tag portion from the application for the group of cache lines of the cache array in a tag array;
responsive to an attempt to overwrite a given cache line within the group of cache lines, determine whether the given cache line is locked to the application based on the most significant bit tag portion of the given cache line; and
overwrite the given cache line if the cache line is not locked, wherein overwriting the given cache line comprises overwriting a most significant bit portion of a tag of the given cache line.

### Claim 8 (depends on 7)

The apparatus of claim 7, wherein determining whether the given cache line is locked comprises:
determining whether a lock bit associated with the most significant bit tag portion associated with the given cache line is set.

### Claim 9 (depends on 7)

The apparatus of claim 7, wherein the cache controller is further configured to:
receive a mask from the application; and
store the mask in association with the most significant bit tag portion for the group of cache lines.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein determining whether the given cache line is locked comprises:
applying the mask to a real address associated with the given cache line to generate a masked real address; and
determining whether the masked real address is equal to the most significant bit tag portion associated with the given cache line.

### Claim 11 (depends on 7)

The apparatus of claim 7, wherein a virtual machine monitor allocates a set of real addresses to a given virtual machine.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the application executes within the given virtual machine and write the tag portion to the tag array of the shared cache.

### Claim 13

A computer program product comprising a non-transitory computer readable medium having a computer readable program, wherein the computer readable program, when executed on a computing device, causes the computing device to:
receive a tag portion from an application, within a plurality of applications, to allocate a group of cache lines in a shared cache to the application, wherein each cache line within the shared cache has a tag having a most significant hit portion and a least significant hit portion, wherein the shared cache is shared between the plurality of applications, wherein the most significant hit portion of the tag comprises a group tag for each group of cache lines, wherein the least significant bit portion of the tag comprises a private tag for each respective cache line, and wherein only cache lines with the most significant bit portion of the tag can be cached in the group of cache lines;
allocating the group of cache lines to the application by setting the most significant bit tag portion to the tag portion from the application for the group of cache lines of the cache array in a tag array;
responsive to an attempt to overwrite a given cache line within the group of cache lines, determine whether the given cache line is locked to the application based on the most significant bit tag portion of the given cache line; and
overwrite the given cache line if the cache line is not locked, wherein overwriting the given cache line comprises overwriting a most significant bit portion of a tag of the given cache line.

### Claim 14 (depends on 13)

The computer program product of claim 13, wherein determining whether the given cache line is locked comprises:
determining whether a lock bit associated with the most significant bit tag portion associated with the given cache line is set.

### Claim 15 (depends on 13)

The computer program product of claim 13, wherein the computer readable program further causes the computing device to:
receive a mask from the application; and
store the mask in association with the most significant bit tag portion for the group of cache lines.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein determining whether the given cache line is locked comprises:
applying the mask to a real address associated with the given cache line to generate a masked real address; and
determining whether the masked real address is equal to the most significant hit tag portion associated with the given cache line.

### Claim 17 (depends on 13)

The computer program product of claim 13, wherein the computer readable program is stored in a computer readable storage medium in a data processing system and wherein the computer readable program was downloaded over a network from a remote data processing system.

### Claim 18 (depends on 13)

The computer program product of claim 13, wherein the computer readable program is stored in a computer readable storage medium in a server data processing system and wherein the computer readable program is downloaded over a network to a remote data processing system for use in a computer readable storage medium with the remote system.

### Claim 19 (depends on 13)

The computer program product of claim 13, wherein a virtual machine monitor allocates a set of real addresses to a given virtual machine.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein the application executes within the given virtual machine and writes the tag portion to the tag array of the shared cache.
