Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

system dump analyzer and worker-threads and ...

dodger_1
Occasional Advisor

system dump analyzer and worker-threads and ...

Hi guys,

when i use the sda prf extension to collect PC_Sampling information - why is the name of my process not in the following list (see attachment) =( There's just a "Not found"?
Found no information about this in the web... Maybe you can help me...

By the way - how can i identify Multiple-Kernel-Thread activity via sda/T4/monitor/TDC... and why is in the WORLD WIDE WEB not at least ONE Diagram which shows, what MKTs are really are... i'll never understand this term...

for example:

i have a process "serv"
- serv has 8 workerthreads
- link-flags mkt/upcalls = 1
- sysgen-param multithread=8
- sysgen-param multiproc=3
- i have 4 montvale cpus (intel itanium 9140N)
- OpenVMS 8.3 for IA-64 Arch.
- Process Priority 16

i only can speculate about, whats going on...

"serv" proc has:
8 workerthreads
8 kernel-threads

or do i have 8 kernel threads for all processes on my system...

And where is the boarder between the on-chip scheduling and the openvms-scheduling?
The Montvale can handle two threads per core... how does this handshake with the openvms scheduler... iam a little bit frustrated... sorry... searched very long for a clearifying answer... Maybe you guys know much more about this.

best greets!
Simon
4 REPLIES
Jon Pinkley
Honored Contributor

Re: system dump analyzer and worker-threads and ...

Hi,

PRF does not show PID's by default. You can use the following commands
to collect the PC samples for a process using PRF by following set of
commands.

SDA> PRF LOAD
SDA> prf start/index= pc_sampling
SDA> prf start collect
SDA> prf show collect

You can also use PCS sda extension as below to collect PC samples

SDA>PCS LOAD
SDA>PCS START TRACE
SDA>PCS STOP TRACE
SDA>PCS DUMP

Then you can use SDA>PCS ANALYZE to see PC samples
systemwide,particular process or processor.

If your process has multiple pthreads then only depending on
whether you have enabled upcalls while linking and also the
fact that you have multiple processors decides whether your
process is running a single kernel thread or multiple kernel
thread

Multiple Pthreads + Upcalls disabled = Single Kernel Thread
Multiple Pthreads + Upcalls Enabled = Multiple Kernel Thread

Default number of maximum possible kernel threads a process
will have is decided by the number processors/cores you have.
This can be figured out by looking at MULTITHREAD sysgen
parameter.

Regards,
Pramod.

Re: system dump analyzer and worker-threads and ...

Hi Simon,

User threads are created by using pthreads/DECthreads library (or any other user library) to create multiple parallel execution contexts within the same process. All these user threads are part of the same process (and hence they share the address space, help, static storage etc.). However, each user thread has its own stack and register set.

Prior to the introduction of kernel threads, the primary scheduling entity was a process. This means that even if the process was multithreaded, only one thread could be executing at one time (since execution of one thread would make the process CURrent).

We can also have an threaded process that has multiple user threads ready to be executed. So the state of the process will be CURrent if it is executing even one of the user threads. Now, in a multiprocessor environment, we could have other processors that are idle, but it cannot execute other user threads within the same process.

Kernel threads was introduced to take care of such a scenario. With OpenVMS V7.0, the primary scheduling entity is a kernel thread (instead of a process). This means, for a threaded process, OpenVMS creates as many "kernel threads" as there are processors. The user thread library "thinks" that each of the kernel thread is a processor. The user thread library (for e.g., pthreads library) has an internal scheduler which will schedule the user threads (pthreads) on the kernel threads. And the OpenVMS scheduler would schedule the kernel threads on the processors.

So if we consider the above example, the process has multiple user threads that are ready to run, OpenVMS would create multiple kernel threads for this process. The pthreads library would schedule the pthreads on the kernel threads and OpenVMS scheduler would schedule kernel threads on the CPUs. In effect, we can have multiple user threads running parallelly on multiple CPUs.

>> how can i identify Multiple-Kernel-Thread activity via sda/T4/monitor/TDC...
From DCL, you can give
$ SHOW SYSTEM /MULTITHREAD
This will display only the multiple kernel threaded processes on the system. If you use /FULL qualifier along with this, you will get detailed information about each kernel thread within the process.

From SDA, you can use
SDA> SHOW SUMMARY /THREAD
This will diplay all the processes, along with the kernel threads within the same process.



>> i only can speculate about, whats going on...
>>
>> "serv" proc has:
>> 8 workerthreads
>> 8 kernel-threads
>>
>> or do i have 8 kernel threads for all processes on my system...

The process "serv" has 8 kernel threads. Since MULTITHREAD parameter is 8, you *could* have upto eight kernel threads per process (for all the processes on the system). However, kernel threads are created *only* when there are more than one user thread. So if a process does not have multiple user threads (pthreads), then it will have only one kernel thread.

Also, if the application has only 4 user threads, only 4 kernel threads would be created for the process. The kernel thread is created when the application creates a user thread. However, the creation kernel threads would be limited by the MULTITHREAD parameter.


>> And where is the boarder between the on-chip scheduling and the
>> openvms-scheduling?
>> The Montvale can handle two threads per core...
>> how does this handshake with the openvms scheduler...

Hyperthreads (the threads on the chip) look to the operating system like CPUs.

Hyperthreads does not have the complete hardware that a core would have. The two threads on a core will share the cache and execution logic. Hence, inside the
hardware, only one of the two threads is executing at any one time. The
hardware swaps between each thread based on a timer. The swap also happens if one of the threads stall or is idle. The advantage of this is if one thread is waiting for (lets say) a cache fill, the other thread can execute, hence better utilizing the core. However, since only one thread is executing at once, if a program executing on one
thread it slows down the program executing on the other.


Hope this helps.

Best Regards,
Sandeep

Re: system dump analyzer and worker-threads and ...

Hi Pramod,

You can control the creation of multiple kernel threads during LINK time.

$ LINK /THREADS_ENABLE=(MULTIPLE_KERNEL_THREADS,UPCALLS)

will create multiple kernel threads on a multiprocessor system. The number of kernel threads to be created, however, is limited by the SYSGEN parameter MULTITHREAD.

Creation of multiple kernel threads require upcalls to be enabled. However, the other way round is not true.

So,

Multiple Pthreads + Upcalls disabled = Single Kernel Thread and no upcalls
Multiple Pthreads + Upcalls Enabled = Single Kernel Thread and upcalls
Multiple Pthreads + Upcalls Enabled + Multiple kernel threads enabled = Multiple Kernel threads

Also, if you have an application that is already built, you need not link it again to change these features.

On Alpha, you can use the THREADCP utility to change these image flags.
On Itanium, you can use the DCL $ SET IMAGE command.

Bet Regards,
Sandeep