Zero Copy Memory Reclaim via Copy-on-Write

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Zero copy techniques in networking face issues due to delays between granting direct memory access (DMA) to a network interface controller (NIC) and completing data transmission, leading to potential memory page lockouts and transport overhead, preventing memory pages from being modified or reused during transmission.

Innovation Solution

Implementing a method that locks or pins memory pages for zero copy transmission, using a timer to determine if the transmission is taking too long, and applying a copy-on-write policy to allow modifications and reclaim the memory page for other uses, ensuring efficient resource utilization without corrupting data being transmitted.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of energy

If zero copy technique is used to grant NIC direct memory access to memory page, then transport overhead is reduced, but memory page cannot be released or modified until transmission completes

Engineering Contradiction:
Improvetransport overheadVSAvoidmemory page reusability
Core Design Contradiction:
Loss of energyVSAdaptability or versatility

Solution Approach 1:

The patent implements copy-on-write mechanism that creates a copy of the memory page when the application attempts to modify it during zero copy transmission. This allows the original memory page to remain locked for NIC access while the application can modify the copy, resolving the contradiction between maintaining zero copy efficiency and enabling memory reusability.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent dynamically adjusts memory page access rights based on transmission status. The memory page is locked during active transmission to prevent modifications, but the system dynamically creates copies or releases locks when appropriate, transforming the static memory access model into a dynamic one that adapts to transmission needs.

Inventive Principle:
Principle #15Dynamics

2Reliability

If memory page is locked for zero copy transmission, then data integrity during transmission is ensured, but memory page cannot be reused causing delays

Engineering Contradiction:
Improvedata integrityVSAvoidmemory page availability
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

When the application needs to modify a locked memory page during transmission, the system creates a copy of the page. The original remains locked and intact for NIC transmission, ensuring data integrity, while the copy can be freely modified by the application, eliminating the time delay caused by waiting for transmission completion.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent segments the memory page usage into separate copies - one dedicated to NIC transmission and another for application modification. This segmentation allows both data integrity during transmission and application flexibility to coexist without mutual interference.

Inventive Principle:
Principle #1Segmentation

3Adaptability or versatility

If traditional copying method is used to transfer data to socket buffer, then memory page can be released and reused, but transport overhead increases

Engineering Contradiction:
Improvememory page reusabilityVSAvoidtransport overhead
Core Design Contradiction:
Adaptability or versatilityVSLoss of energy

Solution Approach 1:

Instead of copying data to a socket buffer before transmission, the patent uses copy-on-write to create a copy of the memory page only when modification is needed. This eliminates unnecessary copying overhead while maintaining the ability to release and reuse memory pages through the copy-on-write mechanism.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10503405B2Zero copy memory reclaim using copy-on-write
Publication Date: 2019.12.10 RED HAT ISRAEL
  • US10503405B2 patent drawing
  • US10503405B2 patent drawing
  • US10503405B2 patent drawing

AI summary

A processing device receives a request to provide a hardware device with direct memory access to a contents of a virtual memory location in application memory of an application. Responsive to the request, the processing device locks the virtual memory location. The processing device makes a determination to reclaim a physical memory location mapped to the virtual memory location. The processing device then determines whether the hardware device has completed the access to a physical memory location mapped to the virtual memory location. Responsive to determining that the hardware device has not completed the access to the physical memory location, the processing device implements a copy-on-write policy for the virtual memory location.