IP Library Granted Patent US 10,095,619
Granted Patent B2
US 10,095,619 · App. 15/645,794 · Granted Oct 9, 2018

Universal cache management system

Inventors: Prasad V. Bagal (San Jose, CA); Rich Long (Woodside, CA)
Assignee: Oracle International Corporation
G06F12/0811G06F12/084G06F12/0897G06F17/3048G06F2212/22
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,095,619
App. No.
15/645,794
Granted
Oct 9, 2018
Kind
B2
Abstract

Techniques for universal cache management are described. In an example embodiment, a plurality of caches are allocated, in volatile memory of a computing device, to a plurality of data-processing instances, where each one of the plurality of caches is exclusively allocated to a separate one of the plurality of data-processing instances. A common cache is allocated in the volatile memory of the computing device, where the common cache is shared by the plurality of data-processing instances. Each instance of the plurality of data-processing instances is configured to: identify a data block in the particular cache allocated to that instance, where the data block has not been changed since the data block was last persistently written to one or more storage devices; cause the data block to be stored in the common cache; and remove the data block from the particular cache. Data blocks in the common cache are maintained without being persistently written to the one or more storage devices.

Claims (118)

1. A method comprising:

allocating, in volatile memory of a first computing device, a first cache exclusively to a first instance of two or more data-processing instances, wherein the first cache is configured to store copies of a first set of data blocks that are persistently stored on one or more storage devices, and wherein the allocating the first cache is performed, at least in part, by an operating system (OS) instance;

allocating, in the same volatile memory of the first computing device, a second cache exclusively to a second instance of the two or more data-processing instances, wherein the second cache is configured to store copies of a second set of data blocks that are persistently stored on the one or more storage devices, and wherein the allocating the second cache is performed, at least in part, by the OS instance;

allocating at least a portion of a common cache in the same volatile memory of the first computing device, wherein the allocating at least a portion of the common cache is performed, at least in part, by the OS instance;

the first instance performing:

identifying for eviction from the first cache a first data block at least because the first data block has not been changed since the first data block was last persistently written to the one or more storage devices;

in response to identifying for eviction from the first cache a first data block at least because the first data block has not been changed since the first data block was last persistently written to the one or more storage devices:

causing the first data block to be stored in the common cache, and

removing the first data block from the first cache;

the second instance performing:

identifying for eviction from the second cache a second data block at least because the second data block has not been changed since the second data block was last persistently written to the one or more storage devices:

in response to identifying for eviction from the second cache a second data block at least because the second data block has not been changed since the second data block was last persistently written to the one or more storage devices:

causing the second data block to be stored in the common cache, and

removing the second data block from the second cache;

maintaining data blocks, including the first data block and the second data block, in the common cache without persistently writing the data blocks to the one or more storage devices; and

wherein the method is performed by the first computing device.

2. The method of claim 1 , wherein the two or more data-processing instances are two or more database instances that manage one or more databases that are stored on the one or more storage devices.

3. The method of claim 1 , wherein maintaining data blocks in the common cache comprises maintaining block-identifying data for each of the data blocks stored in the common cache.

4. The method of claim 1 , wherein maintaining data blocks in the common cache comprises:

maintaining the first data block in the common cache across a restart of the first instance; and

maintaining the second data block in the common cache across a restart of the second instance.

5. The method of claim 1 , further comprising:

in response to a first request for data from the first data block, the first instance retrieving the first data block from the common cache instead of the one or more storage devices, and storing the first data block back into the first cache; and

in response to a second request for data from the second data block, the second instance retrieving the second data block from the common cache instead of the one or more storage devices, and storing the second data block back into the second cache.

6. The method of claim 1 , further comprising:

in response to a request for data from the second data block, the first instance retrieving the second data block from the common cache instead of the one or more storage devices, and storing the second data block into the first cache.

7. The method of claim 1 , further comprising:

the first instance requesting the first data block from the common cache;

determining that the first data block is not stored in the common cache; and

retrieving the first data block from the one or more storage devices, wherein retrieving the first data block comprises one of:

the first instance retrieving the first data block from the one or more storage devices; or

an instance that manages the common cache retrieving the first data block from the one or more storage devices and returning the first data block to the first instance.

8. The method of claim 1 , further comprising:

after the first instance restarts, the first instance warming up the first cache by retrieving at least the first data block from the common cache instead of the one or more storage devices and storing the first data block back into the first cache; and

after the second instance restarts, the second instance warming up the second cache by retrieving at least the second data block from the common cache instead of the one or more storage devices and storing the second data block back into the second cache.

9. The method of claim 1 , wherein allocating the first cache comprises:

allocating, by the OS instance, a first range of memory addresses to the first instance;

allocating, by the first instance, a subset of the first range of memory addresses to the first cache; and

wherein allocating the second cache comprises:

allocating, by the OS instance, a second range of memory addresses to the second instance;

allocating, by the second instance, a subset of the second range of memory addresses to the second cache.

10. The method of claim 1 , wherein allocating the first cache comprises allocating, by the OS instance, a first range of memory addresses to the first cache and wherein allocating the second cache comprises allocating, by the OS instance, a second range of memory addresses to the second cache.

11. The method of claim 1 , further comprising:

the first instance sending a request for a third data block to a common cache instance that manages the common cache;

the common cache instance that manages the common cache performing determining that the third data block is not stored in the common cache;

retrieving the third data block from a second common cache that is allocated on a second computing device; and

returning the third data block to the first instance.

12. The method of claim 11 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a broadcast request to a plurality of computing devices that run a plurality of data-processing instances for the third data block;

wherein the plurality of computing devices comprises the second computing device;

receiving a response to the broadcast request from the second computing device, wherein the response comprises the third data block.

13. The method of claim 12 , wherein the plurality of computing devices is organized to operate in a cluster.

14. The method of claim 11 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a query to cluster directory to determine which particular common cache of a plurality of common caches has a copy of the third data block that is available;

wherein the plurality of common caches comprises the second common cache; and

receiving, in response to the query, an identification that the third data block is available in the second common cache.

15. The method of claim 14 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a request to a second common cache instance that manages the second common cache on the second computing device for the third data block; and

receiving, in response to the request, the third data block from the second common cache instance.

16. One or more non-transitory computer-readable media storing one or more sequences of instructions which, when executed by one or more processors, causes:

allocating, in volatile memory of a first computing device, a first cache exclusively to a first instance of two or more data-processing instances, wherein the first cache is configured to store copies of a first set of data blocks that are persistently stored on one or more storage devices, and wherein the allocating the first cache is performed, at least in part, by an operating system (OS) instance;

allocating, in the same volatile memory of the first computing device, a second cache exclusively to a second instance of the two or more data-processing instances, wherein the second cache is configured to store copies of a second set of data blocks that are persistently stored on the one or more storage devices, and wherein the allocating the second cache is performed, at least in part, by the OS instance;

allocating at least a portion of a common cache in the same volatile memory of the first computing device, wherein the allocating at least a portion of the common cache is performed, at least in part, by the OS instance;

the first instance performing:

identifying for eviction from the first cache a first data block at least because the first data block has not been changed since the first data block was last persistently written to the one or more storage devices;

in response to identifying for eviction from the first cache a first data block at least because the first data block has not been changed since the first data block was last persistently written to the one or more storage devices:

causing the first data block to be stored in the common cache, and

removing the first data block from the first cache; and

the second instance performing:

identifying for eviction from the second cache a second data block at least because the second data block has not been changed since the second data block was last persistently written to the one or more storage devices:

in response to identifying for eviction from the second cache a second data block at least because the second data block has not been changed since the second data block was last persistently written to the one or more storage devices:

causing the second data block to be stored in the common cache, and

removing the second data block from the second cache;

maintaining data blocks, including the first data block and the second data block, in the common cache without persistently writing the data blocks to the one or more storage devices.

17. The one or more non-transitory computer-readable media of claim 16 , wherein the two or more data-processing instances are two or more database instances that manage one or more databases that are stored on the one or more storage devices.

18. The one or more non-transitory computer-readable media of claim 16 , wherein maintaining data blocks in the common cache comprises maintaining block-identifying data for each of the data blocks stored in the common cache.

19. The one or more non-transitory computer-readable media of claim 16 , wherein maintaining data blocks in the common cache comprises:

maintaining the first data block in the common cache across a restart of the first instance; and

maintaining the second data block in the common cache across a restart of the second instance.

20. The one or more non-transitory computer-readable media of claim 16 , the sequences of instructions including instructions that, when executed by said one or more processors, causes the performance of the steps of:

in response to a first request for data from the first data block, the first instance retrieving the first data block from the common cache instead of the one or more storage devices, and storing the first data block back into the first cache; and

in response to a second request for data from the second data block, the second instance retrieving the second data block from the common cache instead of the one or more storage devices, and storing the second data block back into the second cache.

21. The one or more non-transitory computer-readable media of claim 16 , the sequences of instructions including instructions that, when executed by said one or more processors, cause:

in response to a request for data from the second data block, the first instance retrieving the second data block from the common cache instead of the one or more storage devices, and storing the second data block into the first cache.

22. The one or more non-transitory computer-readable media of claim 16 , the sequences of instructions including instructions that, when executed by said one or more processors, cause:

the first instance requesting the first data block from the common cache;

determining that the first data block is not stored in the common cache; and

retrieving the first data block from the one or more storage devices, wherein retrieving the first data block comprises one of:

the first instance retrieving the first data block from the one or more storage devices; or

an instance that manages the common cache retrieving the first data block from the one or more storage devices and returning the first data block to the first instance.

23. The one or more non-transitory computer-readable media of claim 16 , the sequences of instructions including instructions that, when executed by said one or more processors, cause:

after the first instance restarts, the first instance warming up the first cache by retrieving at least the first data block from the common cache instead of the one or more storage devices and storing the first data block back into the first cache; and

after the second instance restarts, the second instance warming up the second cache by retrieving at least the second data block from the common cache instead of the one or more storage devices and storing the second data block back into the second cache.

24. The one or more non-transitory computer-readable media of claim 16 , wherein allocating the first cache comprises:

allocating, by the OS instance, a first range of memory addresses to the first instance;

allocating, by the first instance, a subset of the first range of memory addresses to the first cache; and

wherein allocating the second cache comprises:

allocating, by the OS instance, a second range of memory addresses to the second instance;

allocating, by the second instance, a subset of the second range of memory addresses to the second cache.

25. The one or more non-transitory computer-readable media of claim 16 , wherein allocating the first cache comprises allocating, by the OS instance, a first range of memory addresses to the first cache and wherein allocating the second cache comprises allocating, by the OS instance, a second range of memory addresses to the second cache.

26. The one or more non-transitory computer-readable media of claim 16 , the sequences of instructions including instructions that, when executed by said one or more processors, cause:

the first instance sending a request for a third data block to a common cache instance that manages the common cache;

the common cache instance that manages the common cache performing:

determining that the third data block is not stored in the common cache;

retrieving the third data block from a second common cache that is allocated on a second computing device; and

returning the third data block to the first instance.

27. The one or more non-transitory computer-readable media of claim 26 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a broadcast request to a plurality of computing devices that run a plurality of data-processing instances for the third data block;

wherein the plurality of computing devices comprises the second computing device;

receiving a response to the broadcast request from the second computing device, wherein the response comprises the third data block.

28. The one or more non-transitory computer-readable media of claim 27 , wherein the plurality of computing devices is organized to operate in a cluster.

29. The one or more non-transitory computer-readable media of claim 26 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a query to cluster directory to determine which particular common cache of a plurality of common caches has a copy of the third data block that is available;

wherein the plurality of common caches comprises the second common cache; and

receiving, in response to the query, an identification that the third data block is available in the second common cache.

30. The one or more non-transitory computer-readable media of claim 29 , wherein retrieving the third data block from a second common cache that is allocated on a second computing device comprises:

sending a request to a second common cache instance that manages the second common cache on the second computing device for the third data block; and

receiving, in response to the request, the third data block from the second common cache instance.

Continuity (2)
Continuation 13037172 · Feb 28, 2011
Related Publication 20170308470A1 · Oct 26, 2017