# How 2 switch kernel CPU mode between Threaded / UnThreaded

## CaptainBlood

Hi,

Should I achieve this with 2 differents .config?

Or should kernel command line suffices?

I expect "UnThreaded"   to be time saving while emerging single threaded ebuilds.

Thks 4 ur attentionLast edited by CaptainBlood on Sun Feb 15, 2015 8:37 pm; edited 1 time in total

----------

## Ant P.

Your expectations are broken, unless you plan to run that emerge as the init process on a machine with no consoles or background processes at all.

----------

## CaptainBlood

Thks for advice...  :Embarassed: 

Anyhow the question remains:

Is it possible to configure kernel (via .config or command line) so that the 2 cores are taken into account, and that each core isn't splitted into 2 logical ones?

Thks 4 ur attention, interest & support

----------

## NeddySeagoon

CaptainBlood,

Turn off Hyperthreading support in the BIOS and in the kernel.

I don't see a command line option in /usr/src/linux/Documentation/kernel-parameters.txt

Maybe there is something in the kernel help?

----------

## CaptainBlood

 *NeddySeagoon wrote:*   

> CaptainBlood,
> 
> Turn off Hyperthreading support in the BIOS and in the kernel.
> 
> I don't see a command line option in /usr/src/linux/Documentation/kernel-parameters.txt
> ...

 

My laptop hasn't got such a setting.

Seems like there is no setting in kernel .config, but replacement of the CPU embeded hyperthreading scheduler.

Thks 4 ur attention, interest & support.

----------

## Yamakuzure

BIOS: Here you can (normally) set whether HyperThreading is supported or not. To use it, it must be enabled.

Kernel: Either build with the SMT Scheduler (CONFIG_SCHED_SMT) or not.

Disabling the SMT-Scheduler disables HyperThreading, no matter what you have set in your BIOS.

Enabling the SMT-Scheduler without enabling support in the BIOS only adds overhead.

On my laptop (i7, 4 cores) the overall performance is worse without HyperThreading. Nowadays it is a too rare occasion that a single process hogs only one logical CPU for disabling HyperThreading to give me any benefit.

This might, of course, be completely different on your setup.

----------

## CaptainBlood

Hi,

No such an option in laptop BIOS.

So seems like there are little chances to have dual core cpu involved without each being splited into 2 logical CPUs.

While doing  *Quote:*   

> emerge -e word

 I've noticed many single threaded phases.

This is why I'm trying so hard to have system to work with the 2 physical CPUs.

Thks 4 ur attention; interest & support

----------

## s4e8

just add kernel param maxcpus=<half_of_#cpu>, it only work on single cpu package or some 2way server.

----------

## CaptainBlood

Yes that's an issue, only 1 CPU until next reboot.

Not an option, sorry.  :Wink: 

 *Quote:*   

> some 2way server

 What do you mean?

Thks 4 ur attention, interest & support

----------

## CaptainBlood

 *Yamakuzure wrote:*   

> Enabling the SMT-Scheduler without enabling support in the BIOS only adds overhead.

 should be the way...

Let me think it over, & I'll get back 4 more results.

----------

## s4e8

On single CPU system, logical cpus always sorted by coreid threadid, ie: all physical cores at first, threaded-cpus next.

On two CPU system, some m/b sorted by coreid socketid threadid and others by coreid threadid socketid. First method upper half cpus is threaded, but second method, upper half cpus is second socket's.

 *CaptainBlood wrote:*   

> 
> 
>  *Quote:*   some 2way server What do you mean?
> 
> Thks 4 ur attention, interest & support

 

----------

