IP Library Granted Patent US 11,023,299
Granted Patent B2
US 11,023,299 · App. 16/516,995 · Granted Jun 1, 2021

System and method of a shared memory allocator

Inventors: Stuart Ritchie (Bowen Island, CA); Sebastian Sapa (Vancouver, CA); Christopher Neilson (Vancouver, CA); Eric Secules (Vancouver, CA); Peter Edwards (Santa Clara, CA)
Assignee: Arista Networks, Inc.
G06F9/544G06F9/44536G06F9/5016G06F13/1663G06F2209/503G06F2209/504
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 11,023,299
App. No.
16/516,995
Granted
Jun 1, 2021
Kind
B2
Abstract

A method and apparatus of a network device that allocates a shared memory buffer for an object is described. In an exemplary embodiment, the network device receives an allocation request for the shared memory buffer for the object. In addition, the network device allocates the shared memory buffer from shared memory of a network device, where the shared memory buffer is accessible by a writer and a plurality of readers. The network device further returns a writer pointer to the writer, where the writer pointer references a base address of the shared memory buffer. Furthermore, the network device stores the object in the shared memory buffer, wherein the writer accesses the shared memory using the writer pointer. The network device further shares the writer pointer with at least a first reader of the plurality of readers. The network device additionally translates the base address of the shared memory buffer to a reader pointer, where the reader pointer is expressed in a memory space of the first reader.

Claims (54)

1. A non-transitory machine-readable medium having executable instructions to cause one or more processing units to perform a method to allocate a shared memory buffer for an object, the method comprising:

receiving an allocation request for the shared memory buffer for the object;

allocating the shared memory buffer from shared memory of a network device, wherein the shared memory buffer is accessible by a writer and a plurality of readers;

returning a writer pointer to the writer;

storing the object in the shared memory buffer, wherein the writer accesses the shared memory using the writer pointer;

sharing the writer pointer with at least a first reader of the plurality of readers, wherein the writer and the first reader have different memory spaces; and

generating a reader pointer using at least the writer pointer, wherein the reader pointer is expressed in a memory space of the first reader.

2. The non-transitory machine-readable medium of claim 1 , further comprising:

retrieving versions of the object at differing time points; and

comparing the retrieved versions.

3. The non-transitory machine-readable medium of claim 2 , wherein the retrieval of versions of the object comprises:

reading a first version of the object;

reading the object from the shared memory buffer;

reading a second version of the object; and

returning the object when the first and second versions match.

4. The non-transitory machine-readable medium of claim 3 , wherein the first and second version are associated with one of a plurality of entries in the object.

5. The non-transitory machine-readable medium of claim 3 , wherein the first version is cached by the first reader.

6. The non-transitory machine readable medium of claim 3 , wherein the first and second versions are a root version for an object that includes a plurality of nodes stored in the shared memory buffer.

7. The non-transitory machine-readable medium of claim 1 , wherein the allocation of the shared memory buffer comprises:

allocating the buffer within one of a plurality of regions that have been allocated for the writer.

8. The non-transitory machine-readable medium of claim 7 , wherein the allocation of the shared memory buffer further comprises:

determining that the one of the plurality of regions has enough free space to allocate the buffer.

9. The non-transitory machine-readable medium of claim 1 , wherein the reader pointer and the writer pointer are identical.

10. The non-transitory machine-readable medium of claim 1 , wherein the allocation of the shared memory buffer comprises:

checking for shared memory growth; and

allocating a region when a size of the object is greater than an allocable space in the shared memory.

11. The non-transitory machine-readable medium of claim 1 , wherein generating the reader pointer comprises:

accessing a map that correlates a base address with the reader pointer, wherein a region map is used for the generating and wherein a writer pointer to reader pointer translation is cached.

12. The non-transitory machine-readable medium of claim 1 , further comprising:

notifying at least the first reader when the object in the shared memory buffer changes.

13. The non-transitory machine-readable medium of claim 1 , wherein the first reader maps a writer shared memory region at a point in time when data from that region is required.

14. The non-transitory machine-readable medium of claim 1 , wherein the first reader releases a writer shared memory region in response to a notification received by the first reader.

15. A method to allocate a shared memory buffer for an object, the method comprising:

receiving an allocation request for the shared memory buffer for the object;

allocating the shared memory buffer from shared memory of a network device, wherein the shared memory buffer is accessible by a writer and a plurality of readers;

returning a writer pointer to the writer;

storing the object in the shared memory buffer, wherein the writer accesses the shared memory using the writer pointer;

sharing the writer pointer with at least a first reader of the plurality of readers, wherein the writer and the first reader have different memory spaces; and

generating, for at least a first reader of the plurality of readers, a reader pointer using at least the writer pointer, wherein the reader pointer is expressed in a memory space of the first reader.

16. The method of claim 15 , further comprising:

retrieving versions of the object at differing time points; and

comparing the retrieved versions.

17. The method of claim 16 , wherein the retrieval of versions of the object comprises:

reading a first version of the object;

reading the object from the shared memory buffer;

reading a second version of the object; and

returning the object when the first and second versions match.

18. The method of claim 15 , wherein the allocation of the shared memory buffer comprises:

allocating the buffer within a region.

19. The method of claim 15 , wherein the allocation of the shared memory buffer comprises:

checking for shared memory growth; and

allocating a region when a size of the object is greater than an allocable space in the shared memory.

20. The method of claim 15 , wherein the generating the reader pointer comprises:

translating a base address to the reader pointer using a region map, wherein the region map maps the base address to the reader pointer.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 19, 2019
From: RITCHIE, STUART; SAPA, SEBASTIAN; NEILSON, CHRISTOPHER; SECULES, ERIC; EDWARDS, PETER
To: ARISTA NETWORKS, INC.
Reel/Frame 049807/0383 →
Continuity (2)
Provisional Application 62739118 · Sep 28, 2018
Related Publication 20200104196A1 · Apr 2, 2020
Cited By (1)
US 12,379,963