All Products
Search
Document Center

Alibaba Cloud Linux:Enabling the CONFIG_PARAVIRT_SPINLOCK kernel option may cause performance issues

Last Updated:Apr 01, 2026

CONFIG_PARAVIRT_SPINLOCK is a Linux kernel option that adds a paravirtualization layer for spinlocks. In Alibaba Cloud Linux, this option is disabled by default. If you are unsure about the risks, do not enable it. This document explains why enabling CONFIG_PARAVIRT_SPINLOCK on an Elastic Compute Service (ECS) instance can degrade performance and shows you how to check and disable it.

Problem description

On an ECS instance with multiple vCPUs, enabling CONFIG_PARAVIRT_SPINLOCK significantly reduces application performance when applications compete intensively for locks. For example, the throughput of NGINX when processing short-lived connections drops noticeably.

Cause

Enabling CONFIG_PARAVIRT_SPINLOCK introduces additional overhead and increases the complexity of the kernel spinlock mechanism, causing kernel performance to degrade.

Note

A spinlock is a synchronization mechanism that prevents multiple threads or processes from accessing shared resources simultaneously, which helps ensure data consistency.

Solution

Step 1: Check whether CONFIG_PARAVIRT_SPINLOCK is enabled

Run the following command to check the kernel configuration:

grep CONFIG_PARAVIRT_SPINLOCK /boot/config-$(uname -r)

Interpret the output:

OutputMeaning
CONFIG_PARAVIRT_SPINLOCKS=yThe option is enabled
CONFIG_PARAVIRT_SPINLOCKS is not setThe option is disabled — no action needed

If the option is disabled, stop here. If it is enabled, proceed to step 2.

Step 2: Recompile the kernel with the option disabled

Warning

Changing the kernel configuration and recompiling the kernel involves low-level system components. If you are unfamiliar with kernel compilation or installation, submit a ticket to contact Alibaba Cloud technical support before proceeding.

Recompile and reinstall the kernel with CONFIG_PARAVIRT_SPINLOCK disabled.