Kernel Module Hot Upgrades via Read-Write Interface Locking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The inefficiency of kernel module upgrades due to the need to disable and deactivate numerous service components, leading to prolonged downtime and reduced upgrade efficiency.

Innovation Solution

A hot upgrade method that utilizes a read-write lock to block interface address information in a non-hot-upgradable module, allowing for the replacement of interface address information in a hot-upgradable module without deactivating service components, enabling online software updates.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If service components are disabled and deactivated during kernel module upgrade, then upgrade reliability is improved, but upgrade time and system downtime increase

Engineering Contradiction:
Improveupgrade reliabilityVSAvoidupgrade time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The kernel module is divided into a basic module and a hot-upgradable module. The basic module contains critical functions that must remain active, while the hot-upgradable module contains replaceable functionality. This segmentation allows the upgradable portion to be replaced without affecting the entire kernel module or requiring service component shutdown.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A hot upgrade thread acts as an intermediary mechanism between the old and new hot-upgradable modules. This thread manages the transition by obtaining read-write locks, blocking old interface addresses, and redirecting calls to new interface addresses, enabling seamless updates without service interruption.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If service components remain online during kernel module upgrade, then upgrade efficiency is improved, but system stability may be compromised

Engineering Contradiction:
Improveupgrade efficiencyVSAvoidsystem stability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

Before the actual upgrade, the system performs preliminary actions including inserting the new hot-upgradable module, obtaining read-write locks on the basic module, and blocking the old interface address information. These preparatory steps ensure that the transition can proceed safely while services remain online.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The hot-upgradable module is replaced by copying the new module into the running system. The new module contains copied interface address information that is then activated through the hot upgrade thread, allowing the system to switch to the new version without complete reinitialization.

Inventive Principle:
Principle #26Copying

3Reliability

If interface address information is blocked using read-write locks, then hot upgrade safety is improved, but module access complexity increases

Engineering Contradiction:
Improvehot upgrade safetyVSAvoidmodule access complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The read-write lock mechanism serves multiple functions: it provides mutual exclusion during module insertion, blocks old interface addresses during upgrade, and manages the transition between old and new modules. This multi-functionality reduces the need for separate control mechanisms for each upgrade phase.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS20250224955A1Hot upgrade method and apparatus for kernel module, device, and storage medium
Publication Date: 2025.07.10 BEIJING VOLCANO ENGINE TECH CO LTD
  • US20250224955A1 patent drawing
  • US20250224955A1 patent drawing
  • US20250224955A1 patent drawing

AI summary

A hot upgrade method for a kernel module includes: when a hot upgrade request for a kernel module is triggered, calling a hot upgrade thread in a newly inserted hot upgrade updating module, and obtaining, by using the hot upgrade thread, a read-write lock that is pre-inserted into a basic module in the kernel module, to block first interface address information of a hot-upgradable module in the kernel module from being called, where the hot upgrade updating module includes second interface address information corresponding to each of a plurality of function call interfaces; and calling each function to be hot-upgraded by using the hot upgrade thread, and replacing, for a function call interface corresponding to each function, the first interface address information corresponding to the function call interface with the second interface address information by using the hot upgrade thread, to complete hot upgrade for the kernel module.