From: rohit verma <[email protected]>
Subject: Re: [LTP] Regarding ht_enable test case failure
Date: Wed, 13 May 2009 15:03:39 +0530

> Hi,
> 
> I want to update HT_enable test case in LTP.
> 
> *HT_enabled:*Test for whether HT enabling is the default setting and the
> kernel option works as expected.
> 
> *Issue:* Reported as failed in my System. However /proc/cpuinfo shows two
> cpu and ht flag.
> 

If HT has been disabled in BIOS, you can still see the ht flag in
/proc/cpuinfo, so it is not enough to just look at it there. We have
looked at this before, and looks like the proper place to see if HT or
more generic term -- symmetrical multithreading (SMT) is sysfs (at least
for RHEL 5 kernels). There is a CPU topology information,

/sys/devices/system/cpu/cpuX/topology/thread_siblings

It looks like this,

00000001

00000002

00000008

In all those case, It means there is no HT or SMT.

If you see something like this,

00000003

This one mean CPU0 and CPU1 are two threads in the same CPU core. This
is because the nth CPU id is,

2 raised to n.

3 = CPU0 (1) + CPU1 (2)

There is also a tool to find out this information.

lscpu from the latest utils-linux-ng package,
http://koji.fedoraproject.org/koji/packageinfo?packageID=4906

> Can you pls tell me how to enable/disable hyperthreading in linux kernel. I
> could not found proper document for the same.
> 

I am not sure if "noht" is still working. At least it has no effect in
RHEL5 kernel. Instead, it was suggested to use the following commands to
enable/disable it,

>From a public bug in Red Hat Bugzilla,
https://bugzilla.redhat.com/show_bug.cgi?id=440321

"RHEL5 ships with CPU_HOTPLUG enabled.  This option allows a user to
disable and enable HW or HT cores.

For example,

I have a 4 cpu system with two HT processors.

To disable the HT processors one can do:

echo 0 > /sys/devices/system/node/node0/cpu1/online
echo 0 > /sys/devices/system/node/node0/cpu3/online

You could write a system service script that does something similar to
(please note that this code is untested and is just a suggestion):

grep noht /proc/cmdline

if [ $? -eq 0 ]; then
     # noht specified on the command line, disabling HT cpus
     echo 0 > /sys/devices/system/node/node0/cpu1/online
     echo 0 > /sys/devices/system/node/node0/cpu3/online
fi
"

> I also found that the check for kernel option "noht" is useless by looking
> into code(HT_enabled.c).
> 
> I think, we can remove that.

I guess we can remove it if it is proved to be a dead option.

CAI Qian

> 
> Regards,
> 
> Rohit
> 
> On Sat, Apr 11, 2009 at 2:25 PM, CAI Qian <[email protected]> wrote:
>>
>> Hi,
>>
>> --- On Mon, 3/30/09, rohit verma <[email protected]> wrote:
>>
>>> From: rohit verma <[email protected]>
>>> Subject: [LTP] Regarding ht_enable test case failure
>>> To: [email protected]
>>> Date: Monday, March 30, 2009, 9:10 PM
>>> O/P:
>>>
>>>
>>> ht_enable    0  INFO  :
>>> Begin: HyperThreading Enabled
>>> ht_enable    0  INFO  :  The kernel boot paramter
>>> 'noht' is not set.
>>>
>>> ht_enable    1  FAIL  :  HT feature is not included
>>> in this Linux Kernel.
>>> ht_enable    0  INFO  :  End: HyperThreading Enabled
>>>
>>>
>>>
>>>
>>> but noht is for
>>> disabling
>>> hyperthreading.
>>>
>>>
>>>
>>> Function
>>> is_ht_kernel (file:
> testcases/kernel/sched/hyperthreading/ht_affinity/HTutils.c) checks for
>>> string cpu_package in /proc/cpuinfo
>>> .
>>>
>>>
>>>  but
>>> cpu_package string
>>>  information  does not exist in  /proc/cpuinfo for
>>> 2.6.29 kernel
>>>
>>
>> From the page,
>>
>>
> https://lists.linux-foundation.org/pipermail/cgl_discussion/2002-October/002632.html
>>
>> looks like cpu_package has been added in 2.4.x kernel by HT patches.
>> Has this field been removed later? I can't see it with 2.6.18 kernel.
>>
>> I have copied the author of those tests - Sonic Zhang to see if he has any
>> insight of it.
>>
>> Anyway, this piece of code seems check if the kernel has HT support or
> not.
>> I am not sure if we'll still need it, because HT support has been added
>> to kernel many years ago.
>>
>> CAI Qian
>>
>>>
>>>
>>>
>>> Regards,
>>> Rohit
>>>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to