# US 9,436,696 B2 · Data fragmentation tuning and candidacy persistence

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

- Number: US 9,436,696 B2
- Document ID: US9436696B2
- Status: Granted
- Kind: B2
- Application number: 14/043,868
- Filed: 2013-10-02
- Published: 2015-04-02
- Granted: 2016-09-06
- Earliest claimed: 2013-10-02
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Robert O. Dryfoos; James V. Farmer; Bradd A. Kadlecik
- Web page: https://patentgrep.com/patent/US9436696B2

## CPC

- G06F 16/1727: {Details of free space management performed by the file system (saving storage space on storage systems G06F3/0608; management of blocks in storage devices G06F3/064)}
- G06F 16/1724: {Details of de-fragmentation performed by the file system (saving storage space on storage systems G06F3/0608; management of blocks in storage devices G06F3/064)}
- G06F 16/215: Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for implementing defragmentation of a data area is provided. The method may include receiving a data change event for the data area and determining, whether the data area has exceeded a defragment threshold based on a defragment threshold value. The method may further include adding the data area to a candidacy list when the data area is determined to have exceeded the defragment threshold based on the defragment threshold value. The method may also include defragmenting the data area when the data area is determined to have exceeded the defragment threshold based on the defragment threshold value and removing the data area from the candidacy list following the determination.

## Claims

### Claim 1

A processor-implemented method for implementing a first manager and a second manager for defragmenting a data area comprising:
receiving, by the first manager, a data change event for the data area;
determining, by the first manager, based on the occurrence of the data change event, whether the data area has exceeded a defragment threshold based on a defragment threshold value, wherein the defragment threshold value is a pre-determined number that has been added to a set of pre-existing properties that define the data area and can dynamically change based on a defragmentation tuning that modifies the defragment threshold value based on a frequency of a plurality of changes associated with the data area, and wherein determining the data area has exceeded the defragment threshold comprises calculating a logical size of the data area, calculating a number of physical blocks in use, calculating the defragment threshold value, and calculating the defragment threshold, wherein the defragment threshold is calculated at a time associated with the occurrence of the data change event and is calculated by subtracting the calculated defragment threshold value from 1 to compute a first answer and then multiplying the computed first answer by a physical block size to compute a second answer and then dividing the calculated logical size of the data area by the computed second answer to obtain the calculated defragment threshold, wherein obtaining the calculated defragment threshold further comprises:
determining if the calculated defragment threshold is equal to a whole number; and
in response to determining the calculated defragment threshold is not equal to a whole number, converting a fraction associated with the calculated defragment threshold to a smallest integer not less than the calculated defragment threshold;
adding the data area to a candidacy list, by the first manager, when the data area is determined to have exceeded the defragment threshold based on the defragment threshold value, wherein determining the data area has exceeded the defragment threshold comprises comparing the obtained calculated defragment threshold to the calculated number of physical blocks in use;
determining, by the second manager, whether the data area has exceeded the obtained calculated defragment threshold based on the defragment threshold value;
defragmenting the data area, by the second manager, when the data area is determined to have exceeded the obtained calculated defragment threshold based on the defragment threshold value; and
removing the data area, by the second manager, from the candidacy list following the determination.

### Claim 2 (depends on 1)

The method of claim 1, wherein the data change event comprises at least one of a write to, addition to, or delete from, the data area.

### Claim 3 (depends on 1)

The method of claim 1, wherein the defragmentation tuning comprises modification of the defragmentation threshold value on a data area basis.

### Claim 4 (depends on 3)

The method of claim 3, wherein the defragmentation tuning comprises a collection of information including, but not limited to, how often a data area is read, how often a data area is written to, how often a data area is added to, how often a data area is deleted from, how often a data area is defragmented, and an average size of data fragments associated with a data area.

### Claim 5

A computer system for implementing a first manager and a second manager for defragmenting a data area comprising:
one or more processors, one or more computer-readable memories, one or more computer-readable tangible storage devices, and program instructions stored on at least one of the one or more storage devices for execution by at least one of the one or more processors via at least one of the one or more memories, wherein the computer system is capable of performing a method comprising:
receiving, by the first manager, a data change event for the data area;
determining, by the first manager, based on the occurrence of the data change event, whether the data area has exceeded a defragment threshold based on a defragment threshold value, wherein the defragment threshold value is a pre-determined number that has been added to a set of pre-existing properties that define the data area and can dynamically change based on a defragmentation tuning that modifies the defragment threshold value based on a frequency of a plurality of changes associated with the data area, and wherein determining the data area has exceeded the defragment threshold comprises calculating a logical size of the data area, calculating a number of physical blocks in use, calculating the defragment threshold value, and calculating the defragment threshold, wherein the defragment threshold is calculated at a time associated with the occurrence of the data change event and is calculated by subtracting the calculated defragment threshold value from 1 to compute a first answer and then multiplying the computed first answer by a physical block size to compute a second answer and then dividing the calculated logical size of the data area by the computed second answer to obtain the calculated defragment threshold, wherein obtaining the calculated defragment threshold further comprises:
determining if the calculated defragment threshold is equal to a whole number; and
in response to determining the calculated defragment threshold is not equal to a whole number, converting a fraction associated with the calculated defragment threshold to a smallest integer not less than the calculated defragment threshold;
adding the data area to a candidacy list, by the first manager, when the data area is determined to have exceeded the defragment threshold based on the defragment threshold value, wherein determining the data area has exceeded the defragment threshold comprises comparing the obtained calculated defragment threshold to the calculated number of physical blocks in use;
determining, by the second manager, whether the data area has exceeded the obtained calculated defragment threshold based on the defragment threshold value;
defragmenting the data area, by the second manager, when the data area is determined to have exceeded the obtained calculated defragment threshold based on the defragment threshold value; and
removing the data area, by the second manager, from the candidacy list following the determination.

### Claim 6 (depends on 5)

The computer system of claim 5, wherein the data change event comprises at least one of a write to, addition to, or delete from, the data area.

### Claim 7 (depends on 5)

The computer system of claim 5, wherein the defragmentation tuning comprises modification of the defragmentation threshold value on a data area basis.

### Claim 8 (depends on 7)

The computer system of claim 7, wherein the defragmentation tuning comprises a collection of information including, but not limited to, how often a data area is read, how often a data area is written to, how often a data area is added to, how often a data area is deleted from, how often a data area is defragmented, and an average size of data fragments associated with a data area.

### Claim 9

A computer program product for implementing a first manager and a second manager for defragmenting a data area comprising:
one or more non-transitory computer-readable storage devices and program instructions stored on at least one of the one or more non-transitory tangible storage devices, the program instructions executable by a processor, the program instructions comprising:
program instructions to receive, by the first manager, a data change event for the data area;
program instructions to determine, by the first manager, based on the occurrence of the data change event, whether the data area has exceeded a defragment threshold based on a defragment threshold value, wherein the defragment threshold value is a pre-determined number that has been added to a set of pre-existing properties that define the data area and can dynamically change based on a defragmentation tuning that modifies the defragment threshold value based on a frequency of a plurality of changes associated with the data area, and wherein determining the data area has exceeded the defragment threshold comprises calculating a logical size of the data area, calculating a number of physical blocks in use, calculating the defragment threshold value, and calculating the defragment threshold, wherein the defragment threshold is calculated at a time associated with the occurrence of the data change event and is calculated by subtracting the calculated defragment threshold value from 1 to compute a first answer and then multiplying the computed first answer by a physical block size to compute a second answer and then dividing the calculated logical size of the data area by the computed second answer to obtain the calculated defragment threshold, wherein obtaining the calculated defragment threshold further comprises:
program instructions to determine if the calculated defragment threshold is equal to a whole number; and
in response to determining the calculated defragment threshold is not equal to a whole number, program instructions to convert a fraction associated with the calculated defragment threshold to a smallest integer not less than the calculated defragment threshold;
program instructions to add the data area to a candidacy list, by the first manager, when the data area is determined to have exceeded the defragment threshold based on the defragment threshold value, wherein determining the data area has exceeded the defragment threshold comprises comparing the obtained calculated defragment threshold to the calculated number of physical blocks in use;
program instructions to determine, by the second manager, whether the data area has exceeded the defragment threshold based on the obtained calculated defragment threshold value;
program instructions to defragment the data area, by the second manager, when the data area is determined to have exceeded the obtained calculated defragment threshold based on the defragment threshold value; and
program instructions to remove the data area, by the second manager, from the candidacy list following the determination.

### Claim 10 (depends on 9)

The computer program product of claim 9, wherein the data change event comprises at least one of a write to, addition to, or delete from, the data area.

### Claim 11 (depends on 9)

The computer program product of claim 9, wherein the defragmentation tuning comprises modification of the defragmentation threshold value on a data area basis.
