Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Only one core using kernel 4.9
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Sun Dec 25, 2016 1:55 pm    Post subject: Only one core using kernel 4.9 Reply with quote

I upgraded to kernel 4.9 lately and discovered a huge performance impact.

During an emerge job i used htop and saw there is only one cpu 100% busy.

Since i have a AMD FX(tm)-4100 Quad-Core Processor this was pretty weird (annoying so to speek).
Switching back to 4.8.10 i have my 4 cores back.

In the last years i was pretty lazy and just copied the .config from kernel to kernel (the first one was build from pappys kernel seed).
This did work most of the time. Sometimes i had to change a little bit, but that was because of software needs.
And now it seems i missed something.
Cross reading what i found in the net doesn't give me a clue what it is.

Does anyone use the 4.9 on an amd system? Or may someone could push me in a direction where to look for this problem?
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2289
Location: near Augsburg, Germany

PostPosted: Sun Dec 25, 2016 6:41 pm    Post subject: Reply with quote

Relevant part of kernel config?
SMP support.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Sun Dec 25, 2016 6:44 pm    Post subject: Reply with quote

You should start to adapt that kernel config.

takes half an hour but than its fixed.

just read and set Y / N / M ...

everything has a description when things are unsure most likely a N fits. check with a webbrowser also for additional hints

When you want performance, make your own kernel. set experimental flag, set processor architecture ... took of a few minutes compiling libreoffice here on every run
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Sun Dec 25, 2016 7:04 pm    Post subject: Reply with quote

Thanks for the reply.

SMP is set since it works with the sources of 4.8.10.

I'll try different kernel config stuff.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3433
Location: Gainesville, Florida

PostPosted: Mon Dec 26, 2016 6:20 am    Post subject: Reply with quote

Under Processor type and features you might try setting:

CONFIG_NR_CPUS=8

IIRC, I read somewhere it works in conjunction with SMP

Also, check your MAKEOPTS="- number in /etc/make.conf.

For my amd 8320 8 core cpu, mine is: MAKEOPTS="-j9"

If none of that works, maybe try the "threads" global USE flag in make.conf
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.2 USE=experimental python3_11
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Mon Dec 26, 2016 9:20 pm    Post subject: Reply with quote

Hi, thanks for the reply.

I have CONFIG_NR_CPUS=64 and -j5 in my make.conf.
As far as i understood this the NR_CPUS just reduces the size of the kernel.

The point is... everything works perfect with kernel 4.8.10 and below.

I tried different new things with no success.

dmesg | grep -i SMP
gives me different ouput for the two kernels:

Output with kernel 4.9.0

[ 0.000000] Linux version 4.9.0-gentoo (root@rabatz) (gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) ) #12 SMP PREEMPT Mon Dec 26 21:45:23 CET 2016
[ 0.000000] Using ACPI (MADT) for SMP configuration information
[ 0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[ 0.002340] Freeing SMP alternatives memory: 28K (ffffffff81b43000 - ffffffff81b4a000)
[ 0.005658] smpboot: APIC(10) Converting physical 1 to logical package 0
[ 0.005658] smpboot: Max logical packages: 4
[ 0.117517] smpboot: CPU0: AMD FX(tm)-4100 Quad-Core Processor (family: 0x15, model: 0x1, stepping: 0x2)
[ 0.127546] smpboot: Total of 1 processors activated (7185.02 BogoMIPS)

Output with kernel 4.8.10

[ 0.000000] Linux version 4.8.10-gentoo (root@rabatz) (gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) ) #4 SMP PREEMPT Sun Dec 25 17:08:46 CET 2016
[ 0.000000] Using ACPI (MADT) for SMP configuration information
[ 0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[ 0.002494] Freeing SMP alternatives memory: 28K (ffffffff81b4a000 - ffffffff81b51000)
[ 0.005827] smpboot: APIC(10) Converting physical 1 to logical package 0
[ 0.005828] smpboot: Max logical packages: 4
[ 0.117529] smpboot: CPU0: AMD FX(tm)-4100 Quad-Core Processor (family: 0x15, model: 0x1, stepping: 0x2)
[ 0.128562] x86: Booting SMP configuration:
[ 0.322556] smpboot: Total of 4 processors activated (28734.44 BogoMIPS)

The main difference is this:
[ 0.128562] x86: Booting SMP configuration:
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21498

PostPosted: Tue Dec 27, 2016 2:16 am    Post subject: Reply with quote

I think the following line is a bit more important:
v4.8.10:
[ 0.322556] smpboot: Total of 4 processors activated (28734.44 BogoMIPS)
v4.9:
[ 0.127546] smpboot: Total of 1 processors activated (7185.02 BogoMIPS)
That says num_online_cpus() is returning 1 instead of 4. Some of the other messages suggest that you probably have SMP=y in both kernels, which is good. Please pastebin the full dmesg of both kernels and the full configuration of both kernels.
Back to top
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2289
Location: near Augsburg, Germany

PostPosted: Tue Dec 27, 2016 10:14 am    Post subject: Reply with quote

And this difference:

kernel 4.8.10
[ 0.128562] x86: Booting SMP configuration:

kernel 4.9 does not contain this line
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Tue Dec 27, 2016 2:58 pm    Post subject: Reply with quote

Hi,

thanks for the reply.

config-kernel-4.8.10
http://pastebin.com/3XAnHqRc

dmesg-kernel-4.8.10
http://pastebin.com/9uEJmKDg

config-kernel-4.9
http://pastebin.com/V4DGTpeV

dmesg-kernel-4.9
http://pastebin.com/jwmps3pk

This is a lot of stuff.

Thanks for helping me in this matter.

DonMartio
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2289
Location: near Augsburg, Germany

PostPosted: Tue Dec 27, 2016 3:46 pm    Post subject: Reply with quote

To switch over from kernel 4.8.10 to 4.9.0 you can use the old config, but after that you must use make oldconfig.
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1213
Location: Massachusetts USA

PostPosted: Tue Dec 27, 2016 6:19 pm    Post subject: Reply with quote

In your dmesg-kernel-4.9 you have
Code:
[    0.002091] [Firmware Bug]: CPU0: APIC id mismatch. Firmware: 10 CPUID: 0
[    0.002095] [Firmware Bug]: CPU0: Using firmware package id 1 instead of 0
which is not in your dmesg-kernel-4.8.10. This could be causing the kernel to ignore the CPU information. This is a bug in the kernel. See https://m.reddit.com/r/linuxquestions/comments/5j1min/cryptic_error_message_on_boot_with_otherwise/ and https://patchwork.kernel.org/patch/9470341/
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Tue Dec 27, 2016 6:23 pm    Post subject: Reply with quote

@Keruskerfuerst : Thanks for the hint (never used this before). Tried that but with no success.

@jburns: Well this sounds reasonably, thanks. I think i'll stick with 4.8.10 and wait for an update.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Tue Dec 27, 2016 6:40 pm    Post subject: Reply with quote

On my Kaveri 4.9.0 I get
Code:
[    0.000000] Linux version 4.9.0-gentoo (root@gentoo) (gcc version 4.9.4 (Gentoo 4.9.4 p1.0, pie-0.6.4) ) #1 SMP Tue Dec 13 17:35:00 CST 2016
[    0.000000] found SMP MP-table at [mem 0x000fd720-0x000fd72f] mapped at [ffff8800000fd720]
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[    0.003507] Freeing SMP alternatives memory: 32K (ffffffff81b58000 - ffffffff81b60000)
[    0.007744] smpboot: APIC(10) Converting physical 1 to logical package 0
[    0.007749] smpboot: Max logical packages: 2
[    0.223301] smpboot: CPU0: AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G (family: 0x15, model: 0x30, stepping: 0x1)
[    0.223556] x86: Booting SMP configuration:
[    0.675435] smpboot: Total of 4 processors activated (24754.85 BogoMIPS)
My config is here: https://paste.pound-python.org/show/B0hkf6313viXdyhBQP99/
You might want to compare it to yours. I don't think anything is wrong with 4.9. I'm using it on the Kaveri and an old Athlon II. No such problems.
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Wed Dec 28, 2016 2:50 pm    Post subject: Reply with quote

Hi Tony0945,

thanks, but there are a lot of differences between our configurations.
The SMP and APIC stuff is the same so this won't help.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Wed Dec 28, 2016 2:55 pm    Post subject: Reply with quote

Just out of curiosity Ii made a copy of my kernel,

cp -a': cp -aR linux-4.9.0-gentoo linux-4.9.0-gentoo-r1

applied the patch jburns mentioned,

patch -p1 < apic.patch

and rebuild the kernel

make -j5 && make modules_install; cp arch/x86_64/boot/bzImage /boot/kernel-menuconfig-4.9.0-gentoo-r1

but that has no effect either.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21498

PostPosted: Sat Dec 31, 2016 5:04 pm    Post subject: Reply with quote

Your problem is beyond what I can handle. After rereading your dmesg from both kernels and examining the corresponding kernel source, I believe my earlier analysis about num_online_cpus() being low on the bad kernel is correct, but I lack the background to determine why this happens for you. I think you need help from someone comfortable with developing this part of the kernel.
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Sat Jan 07, 2017 5:31 pm    Post subject: Reply with quote

Thanks for the investigation. Tried kernel 4.9.1 today and there is the same problem.

Really strange.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Jan 08, 2017 1:49 am    Post subject: Reply with quote

Reading this, it seems like a bug in 4.9 that affects AMD CPUs: https://patchwork.kernel.org/patch/9470341/

I get the same on a Phenom II CPU, but it doesn't affect which cores work or not there:
Code:
[  +0.032006] x86: Booting SMP configuration:
[  +0.000002] .... node  #0, CPUs:      #1 #2
[  +0.082679] [Firmware Bug]: CPU2: APIC id mismatch. Firmware: 2 CPUID: 3
[  +0.079436]  #3
[  +0.000584] [Firmware Bug]: CPU3: APIC id mismatch. Firmware: 3 CPUID: 2
[  +0.079307] x86: Booted up 1 node, 4 CPUs


At a guess, you could try booting 4.9 with "noapic" but I have no idea if it's the source of the problem.
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Sun Jan 08, 2017 1:20 pm    Post subject: Reply with quote

Ant, thanks for posting the link to the patch.
Got the same firmware bug messages on a FX cpu, also without
serious effects.
Actually, I expected a fix in latest 4.9.1 release, but no such thing.
Patch applied to the 4.9.1 tree without problems and sofar everythings
well with the new kernel.
So, thanks again for the pointer.
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Sun Jan 08, 2017 4:06 pm    Post subject: Reply with quote

I had a bad experience with kernel 4.9 as well, but it was a kernel panic when trying to use wifi.

I'll stick to 4.8 for now.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Jan 09, 2017 2:48 am    Post subject: Reply with quote

FWIW there is a report in another forum SMP kernel 4.8.16 running only one core on AMD E-450.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Mon Jan 09, 2017 8:17 am    Post subject: Reply with quote

The release source of kernel-4.9.1 shows no problem on a AMD E-450
not even the firmware bug messages at the smpboot stage.
Code:
Linux localhost 4.9.1-kms #1 SMP PREEMPT Mon Jan 9 08:39:29 CET 2017 x86_64 AMD E-450 APU with Radeon(tm) HD Graphics AuthenticAMD GNU/Linux

Code:
 ....
[    0.027076] CPU: Physical Processor ID: 0
[    0.027253] CPU: Processor Core ID: 0
[    0.027348] mce: CPU supports 6 MCE banks
[    0.027466] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 4
[    0.027609] Last level dTLB entries: 4KB 512, 2MB 8, 4MB 4, 1GB 0
[    0.028745] Freeing SMP alternatives memory: 24K (ffffffff81f4a000 - ffffffff81f50000)
[    0.033604] smpboot: APIC(0) Converting physical 0 to logical package 0
[    0.033803] smpboot: Max logical packages: 1
[    0.034507] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.469204] smpboot: CPU0: AMD E-450 APU with Radeon(tm) HD Graphics (family: 0x14, model: 0x2, stepping: 0x0)
[    0.469521] Performance Events: AMD PMU driver.
[    0.469711] ... version:                0
[    0.469854] ... bit width:              48
[    0.469992] ... generic registers:      4
[    0.470133] ... value mask:             0000ffffffffffff
[    0.470259] ... max period:             00007fffffffffff
[    0.470355] ... fixed-purpose events:   0
[    0.470495] ... event mask:             000000000000000f
[    0.487423] x86: Booting SMP configuration:
[    0.487625] .... node  #0, CPUs:      #1
[    0.490258] x86: Booted up 1 node, 2 CPUs
[    0.490450] smpboot: Total of 2 processors activated (6586.51 BogoMIPS)
 ....

Code:

~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 20
model           : 2
model name      : AMD E-450 APU with Radeon(tm) HD Graphics
stepping        : 0
microcode       : 0x5000101
cpu MHz         : 1320.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf eagerfpu pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt hw_pstate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
bugs            : fxsave_leak sysret_ss_attrs null_seg
bogomips        : 3293.25
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 20
model           : 2
model name      : AMD E-450 APU with Radeon(tm) HD Graphics
stepping        : 0
microcode       : 0x5000101
cpu MHz         : 1320.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf eagerfpu pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt hw_pstate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
bugs            : fxsave_leak sysret_ss_attrs null_seg
bogomips        : 3293.25
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate



There are other issues with the ACPI table handling showing firmware bug messages.
But the kernel image itself seems to behave well from the short test I ran.
Back to top
View user's profile Send private message
donmartio
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 258

PostPosted: Tue Jan 10, 2017 6:35 am    Post subject: Reply with quote

Tried 4.9.2 and the the firmware error message is gone, but the problem stays.
Just one core recognized.
I think i miss something here, but i am gone through the kernel config
three times now and can't imagine what it is.
_________________
Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.
Back to top
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2289
Location: near Augsburg, Germany

PostPosted: Tue Jan 10, 2017 8:35 am    Post subject: Reply with quote

Have you changed the kernel config?
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Tue Jan 10, 2017 10:26 am    Post subject: Reply with quote

My issue with wifi seems solved with 4.9.2 (ath9k), but now I have a bluetooth issue (ath3k). I don't like this kernel =P
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
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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