PERCPU: allocation failed when loading module kvm

Bug #1088433 reported by Jean-Baptiste Lallement on 2012-12-10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Chris J Arges

Bug Description

SRU Justification:
Impact: When using VMs with many CPUs on kvm, the module is loaded per CPU which can cause allocation failures.

Fix: 8d8022e8aba85192e937f1f0f7450e256d66ae5c solves the issue which is present in 3.8 series and beyond.

Testcase: Boot a VM with many CPUs, reboot and check if issue occurs.


The kernel tries to load the KVM module for each CPU even though it really only needs to be loaded once. For each subsequent load, the kernel is trying to allocate the per-cpu area before it checks if the module is loaded already. This can result in the following backtrace:

[ 8.294573] PERCPU: allocation failed, size=304 align=32, alloc from reserved chunk failed
[ 8.294578] Pid: 1490, comm: modprobe Not tainted 3.5.0-20-generic #31-Ubuntu
[ 8.294579] Call Trace:
[ 8.294597] [<ffffffff81143924>] pcpu_alloc+0x974/0x9d0
[ 8.294604] [<ffffffff810b185a>] ? each_symbol_section+0x2a/0x70
[ 8.294607] [<ffffffff810b18d1>] ? find_symbol+0x31/0x70
[ 8.294610] [<ffffffff81143c43>] __alloc_reserved_percpu+0x13/0x20
[ 8.294613] [<ffffffff810b413a>] layout_and_allocate+0x2fa/0xaf0
[ 8.294615] [<ffffffff810b4a29>] load_module+0xf9/0x1170
[ 8.294630] [<ffffffff810b5af2>] sys_init_module+0x52/0x230
[ 8.294640] [<ffffffff8168b969>] system_call_fastpath+0x16/0x1b
[ 8.294642] kvm: Could not allocate 304 bytes percpu data

Reproduced with kernel from quantal-release and quantal-proposed

I found this reference on LKML:

The following patch solves the issue:
This is in 3.8/3.11


ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: linux-image-3.5.0-20-generic 3.5.0-20.31
ProcVersionSignature: Ubuntu 3.5.0-20.31-generic
Uname: Linux 3.5.0-20-generic x86_64
 total 0
 crw-rw---T 1 root audio 116, 1 Dec 10 10:54 seq
 crw-rw---T 1 root audio 116, 33 Dec 10 10:54 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CRDA: Error: [Errno 2] No such file or directory: 'iw'
Date: Mon Dec 10 11:03:33 2012
HibernationDevice: RESUME=UUID=c595dd75-dab5-4fcd-a089-302addcaef96
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
MachineType: Intel Corporation LH Pass
MarkForUpload: True

 PATH=(custom, no user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-20-generic root=UUID=58f9a800-2e0c-4da5-9d94-c4bb4bed4fa2 ro quiet
 linux-restricted-modules-3.5.0-20-generic N/A
 linux-backports-modules-3.5.0-20-generic N/A
 linux-firmware 1.95
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install) 04/30/2012
dmi.bios.vendor: Intel Corp.
dmi.bios.version: SE5C600.86B.99.99.2050.043020121425
dmi.board.asset.tag: .................... S4600LH....
dmi.board.vendor: Intel Corporation
dmi.board.version: ..........
dmi.chassis.asset.tag: ....................
dmi.chassis.type: 23
dmi.chassis.vendor: ...............................
dmi.chassis.version: ..................
dmi.modalias: dmi:bvnIntelCorp.:bvrSE5C600.86B.99.99.2050.043020121425:bd04/30/2012:svnIntelCorporation:pnLHPass:pvr....................:rvnIntelCorporation:rnS4600LH....:rvr..........:cvn...............................:ct23:cvr..................: LH Pass
dmi.product.version: ....................
dmi.sys.vendor: Intel Corporation

CVE References

Jean-Baptiste Lallement (jibel) wrote :
description: updated

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to . Please test the latest v3.7 kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.


Changed in linux (Ubuntu):
importance: Undecided → Medium
Joseph Salisbury (jsalisbury) wrote :

I can also build a test kernel with commit e9bda3b reverted.

tags: added: kernel-da-key
Joseph Salisbury (jsalisbury) wrote :

A Quantal test kernel is available with commit e9bda3b reverted. The kernel is available from:

Can you test that kernel and report back if it has the bug or not?

Thanks in advance!

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Chris J Arges (arges) on 2013-09-24
Changed in linux (Ubuntu):
status: Expired → Fix Released
Changed in linux (Ubuntu Raring):
status: New → Fix Released
Changed in linux (Ubuntu Quantal):
status: New → In Progress
assignee: nobody → Chris J Arges (arges)
importance: Undecided → Medium
Changed in linux (Ubuntu Raring):
importance: Undecided → Medium
description: updated
Chris J Arges (arges) on 2013-09-24
description: updated
Chris J Arges (arges) on 2014-03-26
description: updated
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-quantal' to 'verification-done-quantal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-quantal
Launchpad Janitor (janitor) wrote :
Download full text (5.1 KiB)

This bug was fixed in the package linux - 3.5.0-49.73

linux (3.5.0-49.73) quantal; urgency=low

  [ Kamal Mostafa ]

  * Release Tracking Bug
    - LP: #1300894

  [ Kamal Mostafa ]

  * [config] updateconfigs after Linux stable update

  [ Upstream Kernel Changes ]

  * ata: enable quirk from jmicron JMB350 for JMB394
    - LP: #1295768
  * sata_sil: apply MOD15WRITE quirk to TOSHIBA MK2561GSYN
    - LP: #1295768
  * ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling
    - LP: #1295768
  * x86: dma-mapping: fix GFP_ATOMIC macro usage
    - LP: #1295768
  * SUNRPC: Fix races in xs_nospace()
    - LP: #1295768
  * ext4: don't try to modify s_flags if the the file system is read-only
    - LP: #1295768
  * drm/i915/dp: increase native aux defer retry timeout
    - LP: #1295768
  * drm/i915/dp: add native aux defer retry limit
    - LP: #1295768
  * rtlwifi: rtl8192ce: Fix too long disable of IRQs
    - LP: #1295768
  * rtlwifi: Fix incorrect return from rtl_ps_enable_nic()
    - LP: #1295768
  * rtl8187: fix regression on MIPS without coherent DMA
    - LP: #1295768
  * PCI: Enable INTx if BIOS left them disabled
    - LP: #1295768
  * cifs: ensure that uncached writes handle unmapped areas correctly
    - LP: #1295768
  * ext4: fix online resize with a non-standard blocks per group setting
    - LP: #1295768
  * ext4: don't leave i_crtime.tv_sec uninitialized
    - LP: #1295768
  * ALSA: usb-audio: work around KEF X300A firmware bug
    - LP: #1295768
  * avr32: fix missing module.h causing build failure in mimc200/fram.c
    - LP: #1295768
  * avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use
    - LP: #1295768
  * ARM: 7957/1: add DSB after icache flush in __flush_icache_all()
    - LP: #1295768
  * ahci: disable NCQ on Samsung pci-e SSDs on macbooks
    - LP: #1295768
  * USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8
    - LP: #1295768
  * workqueue: ensure @task is valid across kthread_stop()
    - LP: #1295768
  * cgroup: update cgroup_enable_task_cg_lists() to grab siglock
    - LP: #1295768
  * hwmon: (max1668) Fix writing the minimum temperature
    - LP: #1295768
  * cpufreq: powernow-k8: Initialize per-cpu data-structures properly
    - LP: #1295768
  * ACPI / video: Filter the _BCL table for duplicate brightness values
    - LP: #1295768
  * perf tools: Remove extraneous newline when parsing hardware cache
    - LP: #1295768
  * perf tools: Fix cache event name generation
    - LP: #1295768
  * net: fix 'ip rule' iif/oif device rename
    - LP: #1295768
  * tg3: Fix deadlock in tg3_change_mtu()
    - LP: #1295768
  * bonding: 802.3ad: make aggregator_identifier bond-private
    - LP: #1295768
  * usbnet: remove generic hard_header_len check
    - LP: #1295768
  * net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode
    - LP: #1295768
  * net: add and use skb_gso_transport_seglen()
    - LP: #1295768
  * net: ip, ipv6: handle gso skbs in forwarding path
    - LP: #1295768
  * net: asix: handle packets crossing URB boundaries
    - LP: #1295768
  * net: asix: add missing flag to struct driver_info
    - LP: #1295768
  * fs/proc/p...


Changed in linux (Ubuntu Quantal):
status: In Progress → Fix Released
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers