# what is Single-depth WCHAN output? more scheduling overhead?

## turtles

Under processor type and features > I have  [ ] Single-depth WCHAN output .

(off)

 *Quote:*   

> This provides more accurate wchan values,                                                          │
> 
>   │ at the expense of slightly more scheduling overhead.

 

I am running a new to me cpu but it seems on a aging laptop I need more more scheduling overhead not less.

What is this option fore / do ?

Thanks

My info:

```
cat /proc/cpuinfo                                 

processor       : 0                                                     

vendor_id       : GenuineIntel                                          

cpu family      : 15                                                    

model           : 4                                                     

model name      : Mobile Intel(R) Pentium(R) 4 CPU 3.33GHz              

stepping        : 1                                                     

cpu MHz         : 3330.000                                              

cache size      : 1024 KB                                               

physical id     : 0                                                     

siblings        : 2                                                     

core id         : 0                                                     

cpu cores       : 1                                                     

apicid          : 0                                                     

initial apicid  : 0                                                     

fdiv_bug        : no                                                    

hlt_bug         : no                                                    

f00f_bug        : no                                                    

coma_bug        : no                                                    

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pebs bts pni dtes64 monitor ds_cpl est tm2 cid xtpr

bogomips        : 6650.17

clflush size    : 64

cache_alignment : 128

address sizes   : 36 bits physical, 32 bits virtual

power management:

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 15

model           : 4

model name      : Mobile Intel(R) Pentium(R) 4 CPU 3.33GHz

stepping        : 1

cpu MHz         : 3330.000

cache size      : 1024 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

apicid          : 1

initial apicid  : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc pebs bts pni dtes64 monitor ds_cpl est tm2 cid xtpr

bogomips        : 6649.00

clflush size    : 64

cache_alignment : 128

address sizes   : 36 bits physical, 32 bits virtual

power management:

```

I also have :

[*] SMT (Hyperthreading) scheduler support

 [ ] Multi-core scheduler support 

Since it is not a "milti core" rather a Hyperthreading I am assuming this is correct in that a Hyperthreading CPU can not take advantage of [ ] Multi-core scheduler support ?

thanks again.

----------

## Hu

 *turtles wrote:*   

> I am running a new to me cpu but it seems on a aging laptop I need more more scheduling overhead not less.

 Something was lost in translation.  Overhead is usually considered a bad thing, though it can be accepted if you get an appropriate benefit in return.

----------

## turtles

 *Hu wrote:*   

>  *turtles wrote:*   I am running a new to me cpu but it seems on a aging laptop I need more more scheduling overhead not less. Something was lost in translation.  Overhead is usually considered a bad thing, though it can be accepted if you get an appropriate benefit in return.

 

-- Yes thank you Hu for the reply, that is what I meant to say, l need more "free" scheduling overhead IE less taken up overhead; not things that deplete it like CONFIG_SCHED_OMIT_FRAME_POINTER = Y. I am looking for kernel options that indicate they are taking up overhead and turning them off. However the wchan (wait channel) might help older systems with less memory or CPU power? So i am unsure what are the pros and cons of this kernel option for this particular CPU and ones like it. 

Here is the complete help text:

 *menuconfig wrote:*   

> CONFIG_SCHED_OMIT_FRAME_POINTER:                                                                                    │
> 
>   │                                                                                                                     │
> 
>   │ Calculate simpler /proc/<PID>/wchan values. If this option                                                          │
> ...

 

So if I disable this (which I have) wait channel values will recurse back to the caller function and I will have less scheduling overhead. And if I enable this I will have accurate wait channel values, increasing scheduling overhead.

Since overhead is bad what is the purpose of the more accurate wait channel values? And how do I determine what types of systems need more precise values or what software needs this? I am going to recompile with and without and do more research.

I use KMS i915 driver and I noticed crashes have something like DO_WAIT_REQUEST piling up before a crash.

This seems related to the wait channel overhead.

It seems I get less GPU lockups when I disable this option.

EDIT this is interesting:

http://weichong78.blogspot.com/2006/10/wchan-waiting-channel.html

----------

## Hu

If you need the value of /proc/pid/wchan to be highly accurate, you want this option set =N.  If you do not understand whether you need it, then it is likely that you do not need it.

----------

## turtles

Hmmm I think you are right. Y = off and less overhead. 

I cant find a ifdef for it in the kernel source.

I did some more reading:

http://lkml.org/lkml/2008/11/6/24

And in these files:

```
grep -R 'get_wchan' /usr/src/linux/
```

Binary file /usr/src/linux/.tmp_vmlinux2 matches  

Binary file /usr/src/linux/vmlinux.o matches      

Binary file /usr/src/linux/kernel/built-in.o matches

/usr/src/linux/kernel/sched_fair.c:                                             (void *)get_wchan(tsk),

Binary file /usr/src/linux/kernel/sched.o matches                                                      

/usr/src/linux/System.map:c1001744 T get_wchan

/usr/src/linux/.tmp_System.map:c1001744 T get_wchan

Binary file /usr/src/linux/.tmp_vmlinux1 matches   

/usr/src/linux/lib/Kconfig.debug:         get_wchan() and suchlike.

Binary file /usr/src/linux/fs/proc/array.o matches                 

Binary file /usr/src/linux/fs/proc/proc.o matches                  

Binary file /usr/src/linux/fs/proc/base.o matches                  

/usr/src/linux/fs/proc/base.c:  wchan = get_wchan(task);

Binary file /usr/src/linux/fs/proc/built-in.o matches   

/usr/src/linux/fs/proc/array.c:         wchan = get_wchan(task);

Binary file /usr/src/linux/fs/built-in.o matches                

Binary file /usr/src/linux/vmlinux matches                      

...<snip>...

Binary file /usr/src/linux/arch/x86/kernel/process_32.o matches                                 

/usr/src/linux/arch/x86/kernel/process_64.c:unsigned long get_wchan(struct task_struct *p)

Binary file /usr/src/linux/arch/x86/kernel/built-in.o matches

/usr/src/linux/arch/x86/kernel/process_32.c:unsigned long get_wchan(struct task_struct *p)

/usr/src/linux/arch/x86/include/asm/processor.h:unsigned long get_wchan(struct task_struct *p);

/usr/src/linux/arch/x86/include/asm/system.h:/* frame pointer must be last for get_wchan */

Binary file /usr/src/linux/arch/x86/built-in.o matches

...<snip>...

----------

## Hu

[quote="turtles"]I cant find a ifdef for it in the kernel source.[/quote

See kernel/Makefile.

----------

