← Back to team overview

kernel-packages team mailing list archive

[Bug 1073148] Re: High cpu overhead on using multiple cores

 

The BIOS is now up to date:

sworddragon@ubuntu:~$ sudo dmidecode -s bios-version && sudo dmidecode -s bios-release-date
P1.40
10/02/2013


But the bug still exists on Ubuntu 14.04 dev with linux-image-generic 3.12.0.3.5. I have also updated the testcase: It is now written in C to exclude Python as the source of problems (compiling with "gcc -o threads ./threads.c -lpthread") and instead of creating 2 threads it is creating the number of online cpu cores * 2 as threads (on my processor with 6 cores 12 threads are created) as the overhead gets much higher with more threads.

Here are the results:

Calling ./test will result in a cpu usage of ~185%/600%.
Calling taskset -c 0 ./threads will result in a cpu usage of ~30%/600%.

** Changed in: linux (Ubuntu)
       Status: Incomplete => New

** Tags removed: bios-outdated-1.40

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1073148

Title:
  High cpu overhead on using multiple cores

Status in “linux” package in Ubuntu:
  New

Bug description:
  I'm using Ubuntu 13.04 dev and have noticed a high cpu overhead if a
  process is using multiple threads and computing them on different
  cores. To measure this I have written a little script in Python which
  I will attach.

  The script will create 2 threads which are using only a little time of
  a cpu core. On my AMD Phenom II X6 1045T the Linux kernel will assign
  the 2 threads on 2 cores which will use a total cpu time of 40% from a
  maximum of 600%. But if I'm using "taskset -ap 0x00000001
  pid_of_script" the 2 threads will be assigned to 1 core and the total
  cpu usage will be only 25% from 600%.

  I'm wondering why there is a cpu overhead of 60% if the Linux kernel is using 2 cores instead of 1 core.
  ---
  AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.25.
  AplayDevices:
   **** List of PLAYBACK Hardware Devices ****
   card 0: SB [HDA ATI SB], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
     Subdevices: 0/1
     Subdevice #0: subdevice #0
  ApportVersion: 2.6.1-0ubuntu6
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  sworddragon   2374 F.... plugin-containe
   /dev/snd/pcmC0D0p:   sworddragon   2374 F...m plugin-containe
   /dev/snd/timer:      sworddragon   2374 f.... plugin-containe
  CRDA: Error: [Errno 2] No such file or directory
  Card0.Amixer.info:
   Card hw:0 'SB'/'HDA ATI SB at 0xf9ff4000 irq 16'
     Mixer name	: 'Realtek ALC662 rev1'
     Components	: 'HDA:10ec0662,18497662,00100101'
     Controls      : 33
     Simple ctrls  : 18
  CurrentDmesg:
   Error: command ['sh', '-c', 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm: /var/log/dmesg: No such file or directory
   dmesg: write failed: Broken pipe
  DistroRelease: Ubuntu 13.04
  EcryptfsInUse: Yes
  IwConfig: Error: [Errno 2] No such file or directory
  Lsusb: Error: [Errno 2] No such file or directory
  MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
  MarkForUpload: True
  NonfreeKernelModules: nvidia
  Package: linux (not installed)
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=de_DE.UTF-8
   SHELL=/bin/bash
  ProcFB: 0 VESA VGA
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-17-generic root=UUID=f1ce7323-74dc-46f7-95f7-887cc54403e7 ro
  ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
  RfKill: Error: [Errno 2] No such file or directory
  Tags:  raring
  Uname: Linux 3.5.0-17-generic x86_64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dialout lpadmin plugdev sambashare sudo
  dmi.bios.date: 05/21/2012
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: P1.20
  dmi.board.asset.tag: BC5FF4739C55
  dmi.board.name: 960GM/U3S3 FX
  dmi.board.vendor: ASRock
  dmi.chassis.asset.tag: To Be Filled By O.E.M.
  dmi.chassis.type: 3
  dmi.chassis.vendor: To Be Filled By O.E.M.
  dmi.chassis.version: To Be Filled By O.E.M.
  dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.20:bd05/21/2012:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rn960GM/U3S3FX:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
  dmi.product.name: To Be Filled By O.E.M.
  dmi.product.version: To Be Filled By O.E.M.
  dmi.sys.vendor: To Be Filled By O.E.M.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1073148/+subscriptions