PERCPU: allocation failed when loading module kvm

Bug #1088433 reported by Jean-Baptiste Lallement
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
Quantal
Fix Released
Medium
Chris J Arges
Raring
Fix Released
Medium
Unassigned

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:

https://lkml.org/lkml/2012/10/11/198

The following patch solves the issue:
8d8022e8aba85192e937f1f0f7450e256d66ae5c
This is in 3.8/3.11
https://lkml.org/lkml/2013/7/11/545

-

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 3.5.7.1
Uname: Linux 3.5.0-20-generic x86_64
AlsaDevices:
 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
PciMultimedia:

ProcEnviron:
 LANGUAGE=en_US:
 TERM=screen-bce
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-20-generic root=UUID=58f9a800-2e0c-4da5-9d94-c4bb4bed4fa2 ro quiet
RelatedPackageVersions:
 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)
dmi.bios.date: 04/30/2012
dmi.bios.vendor: Intel Corp.
dmi.bios.version: SE5C600.86B.99.99.2050.043020121425
dmi.board.asset.tag: ....................
dmi.board.name: 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..................:
dmi.product.name: LH Pass
dmi.product.version: ....................
dmi.sys.vendor: Intel Corporation

CVE References

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
description: updated
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . 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.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.7-rc8-raring/

Changed in linux (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

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

tags: added: kernel-da-key
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

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

http://people.canonical.com/~jsalisbury/lp1088433/

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
Revision history for this message
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)
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)
description: updated
Revision history for this message
Chris J Arges (arges) wrote :
Chris J Arges (arges)
description: updated
Revision history for this message
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 https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-quantal
Revision history for this message
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 3.5.7.32 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
    MMU
    - 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
    events
    - 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...

Read more...

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.