Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Only 1 core out of 4 being used with kernel 4.0.5 [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 8:46 am    Post subject: Only 1 core out of 4 being used with kernel 4.0.5 [SOLVED] Reply with quote

Hello,

I'm running the following kernel with SMP enabled in the kernel options.

Code:
Linux localhost 4.0.5-gentoo #3 SMP Sun Jun 28 15:47:02 CEST 2015 x86_64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz GenuineIntel GNU/Linux


Strangely enough, the only core that is being used is #2. Very periodically i can see #1 jump to 10% or something but it never gets utilised more than this. #3 an #4 are always at 0%. Especially when I'm emerging something this slows down everything severely.
My portage options are:

Code:
Portage 2.2.20 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-4.8.4, glibc-2.20-r2, 4.0.5-gentoo x86_64)
=================================================================
System uname: Linux-4.0.5-gentoo-x86_64-Intel-R-_Core-TM-_i5-2500K_CPU_@_3.30GHz-with-gentoo-2.2
KiB Mem:    12258416 total,  10775204 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 30 Jun 2015 20:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo
dev-util/cmake:           3.2.3::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /storage/portage
    sync-type: rsync
    sync-uri: rsync://rsync.nl.gentoo.org/gentoo-portage
    priority: -1000

local_overlay
    location: /storage/local/portage
    masters: gentoo
    priority: 0

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

Installed sets: @kde-frameworks, @kde-plasma
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/storage/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mirror.leaseweb.com/gentoo/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/storage/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv jpeg kde kipi lcms ldap libnotify lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt3support qt4 qt5 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmxext mmx sse sse2 avx sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20 ruby22" USERLAND="GNU" VIDEO_CARDS="fglrx" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


I can put my kernel options on pastebin or something if that would help but I have enabled SMP and multi-core scheduler support.

Furthermore, I am dual booting with windows from uefi as suggested in https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8.

The cores are all functioning properly under windows so it is not a malfunction. Just let me know if I need to output some more logs or data.

Thanks


Last edited by Raspoetin on Tue Jul 07, 2015 8:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42841
Location: 56N 3W

PostPosted: Mon Jul 06, 2015 9:18 am    Post subject: Reply with quote

Raspoetin,

Welcome to Gentoo.

Code:
4.0.5-gentoo #3 SMP
tells that you have SMP in your kernel.
Code:
MAKEOPTS="-j5"
allows the build system to run 5 instances of make.

On the surface it all looks good. There are a few corner cases where MAKEOPTS="j1" is forced by the ebuild, as parralel make is broken.

On bootup, how many tuxes do you see at the top of the screen?
None means you don't have the option set.
One means your kernel can only see one core.
Four is the right answer.

Try
Code:
dmesg | grep x86
I get
Code:
$ dmesg | grep x86
[    0.183272] x86: Booting SMP configuration:
[    0.276371] x86: Booted up 1 node, 6 CPUs

What does your kernel tell you?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 10:05 am    Post subject: Reply with quote

Hey Neddy,

Thanks for the reply. I see 4 tux logos during boot, as I always did with previous kernel versions. Furthermore dmesg gives me

Code:
$ dmesg | grep x86
[    0.031976] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.046581] x86: Booting SMP configuration:
[    0.086221] x86: Booted up 1 node, 4 CPUs


I've never had this problem before with kernels 3.x. I know that some package force MAKEOPTS="-j1" but for every single package I install only core #2 is used.
Also during internet browsing, video playback etc. only core #2....
Even a benchmark test like intel linpack is using a single thread only whereas it always used 4.
Luckily it's a pretty fast CPU so things don't get slowed down too bad but it is noticeable.

Could it be related to uefi because, besides the kernel version, that is pretty much the only thing I did different with this gentoo install.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2540
Location: Near Toronto

PostPosted: Mon Jul 06, 2015 10:47 am    Post subject: Reply with quote

with sysbench you can explicitly set number of threads in
the cpu test -- it might be interesting to see what happens
when you ask for more than 1
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 11:31 am    Post subject: Reply with quote

Hey albright,

thanks for the tip. I tried sysbench with 2 threads and 4. Same result for both, only core #2 was at 100% and the other 3 did nothing.

http://i.imgur.com/uwsy3o8.png

The weird thing is that the cores do get recognised by the kernel but just not get utilised....
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Mon Jul 06, 2015 12:06 pm    Post subject: Reply with quote

Is this a vserver or is it in a chroot? Is it limited via a cgroup to one core?
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://portage.schorsch-tech.de
git clone https://portage.schorsch-tech.de/portage.git
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 1:33 pm    Post subject: Reply with quote

Quote:

Is this a vserver or is it in a chroot? Is it limited via a cgroup to one core?


Neither a vserver or in chroot. Just a regular desktop install with default kernel options (besides some specific video, sound, systemd etc. options). Also I've never used control groups.
Back to top
View user's profile Send private message
MustrumR
n00b
n00b


Joined: 15 Nov 2011
Posts: 71
Location: Right here

PostPosted: Mon Jul 06, 2015 1:40 pm    Post subject: Reply with quote

Maybe for some reason the CPUs are disabled. Could you check

Code:

$ cat /sys/devices/system/cpu/cpu*/online
$ dmesg | grep smpboot -B 3
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 2:16 pm    Post subject: Reply with quote

Hey MustrumR,

here is the output:

Code:
$ cat /sys/devices/system/cpu/cpu*/online
1
1
1


So cpu1 - 3 seem to be online. For cpu0 I get: "cat: /sys/devices/system/cpu/cpu0/online: No such file or directory"
Maybe this is normal behaviour?

Furthermore:

Code:
$ dmesg | grep smpboot -B 3
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000                                                                     
[    0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
--
[    0.037935] Freeing SMP alternatives memory: 20K (ffffffff819b7000 - ffffffff819bc000)                                     
[    0.042267] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1                                                           
[    0.052262] TSC deadline timer enabled                                                                                     
[    0.052264] smpboot: CPU0: Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz (fam: 06, model: 2a, stepping: 07)
--
[    0.052443] x86: Booting SMP configuration:
[    0.052444] .... node  #0, CPUs:      #1 #2 #3
[    0.092081] x86: Booted up 1 node, 4 CPUs
[    0.092083] smpboot: Total of 4 processors activated (26400.06 BogoMIPS)


It might be a problem with the CPU idle options that I enabled in the kernel config, going to disable them and post the results.
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 3:11 pm    Post subject: Reply with quote

In the kernel config I disabled: "cpuidle driver for intel processors", "intel enhanced speedstep", "intel pentium 4 clock modulation", and "intel p-state control", and did a reinstall
Still no difference. I also installed kernel 3.18.16 with the same kernel options as much as possible (most of them were autocompleted to match the current kernel options).
After booting the downgraded kernel the problem was still there, so it might be something other than the kernel.
Is there anything else that might affect CPU core utilisation in such a big way? Maybe something with the UEFI booting process that is going wrong? I have no idea where else to look.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2540
Location: Near Toronto

PostPosted: Mon Jul 06, 2015 4:02 pm    Post subject: Reply with quote

just wild guess: do you have hotplug_cpu enabled in kernel?
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42841
Location: 56N 3W

PostPosted: Mon Jul 06, 2015 5:43 pm    Post subject: Reply with quote

Raspoetin,

Its scary that cpu0 has gone offline. Thats the only one you must have.
Is there anything in dmesg?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Mon Jul 06, 2015 8:08 pm    Post subject: Reply with quote

Quote:
just wild guess: do you have hotplug_cpu enabled in kernel?


It was indeed automatically enabled due to the fact that ARCH_SUSPEND_POSSIBLE [=y] and ARCH_HIBERNATION_POSSIBLE [=y]. Disabling both these options and hotplug cpu and then rebuilding the kernel did give me during boot "hotpluggable CPUs 0", but it didnt change anything for the multicore support.

Quote:
Its scary that cpu0 has gone offline. Thats the only one you must have.
Is there anything in dmesg?


There is nothing in dmesg about cpu0. Even when I boot from a systemrescue USB I also get "cat: /sys/devices/system/cpu/cpu0/online: No such file or directory" but then all cores are functioning fine (checked this by doing a sysbench and linpack test). So it might be sort of normal.

I guess I'm gonna do a fresh install once again and check more closely for all the tips given here and post again when I have a cleaner and minimal install.
Thanks for all the help guys!
Back to top
View user's profile Send private message
Raspoetin
n00b
n00b


Joined: 05 Jul 2015
Posts: 8

PostPosted: Tue Jul 07, 2015 8:05 pm    Post subject: Reply with quote

I did a complete reinstall with the unstable branch, so kernel 4.1.1-r1. Somehow everything is working again now. I guess I'll never find out what went wrong there.

Again, thanks for the help.
Back to top
View user's profile Send private message
jfranz2
n00b
n00b


Joined: 24 Oct 2014
Posts: 37

PostPosted: Wed Jul 08, 2015 7:15 am    Post subject: Reply with quote

Make sure
Code:
CONFIG_SMP=y
is set in the kernel config

Description for configuration setting CONFIG_SMP ("CPU" refers to each core)

Quote:
This enables support for systems with more than one CPU. If you have a system with only one CPU, say N. If you have a system with more than one CPU, say Y.

If you say N here, the kernel will run on uni- and multiprocessor machines, but will use only one CPU of a multiprocessor machine. If you say Y here, the kernel will run on many, but not all, uniprocessor machines. On a uniprocessor machine, the kernel will run faster if you say N here.

People using multiprocessor machines who say Y here should also say Y to "Enhanced Real Time Clock Support", below.

_________________
#TYBG
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum