Sponsored Content
Top Forums UNIX for Advanced & Expert Users Playing with the Linux Scheduler Post 302566054 by demigod85 on Wednesday 19th of October 2011 11:01:44 AM
Old 10-19-2011
Playing with the Linux Scheduler

Hi,

To begin with let me explain my system and then I will come to the problem.

System:

My program forks 2 child processes. These child processes further start 2 user level threads (pthreads) and 2 kernel level threads (kthread). All these threads issue various system calls. I am using Ubuntu with Linux kernel 2.6.39-rc7


Problem:

I want the following informtion about my system:

1. Scheduling information of the process and/or threads. ie. when was a particular process and/or thread scheduled.

2. Thread state information. ie. when and which thread is waiting for an I/O to get over. And is there a way, I can measure how much time does I/O takes?

3. Context switch information. ie. which system call caused the context switch and from which thread does this system call was called from?

Further, in case if I want to make changes to the linux scheduler and the context switch functionalities, then which files should I aim for?

I would really appreciate if you can answer all or part of these problems.

Thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Scheduler in Solaris

I am using Sun Solaris Where I can find scheduler program that can run another program automatically on scheduled time? Thank you. (1 Reply)
Discussion started by: wadiachmed
1 Replies

2. Solaris

About Control-M Scheduler

Hi all, Is anybody have any idea on Control-M schedular(bmcsoftware product) on Solaris/UNIX environment.If yes,can you please help me how to set it up and schedule a job. Please!!! it's Urgent!!! Regards, Uday (0 Replies)
Discussion started by: uday123
0 Replies

3. HP-UX

Help... LP scheduler problem...

My HPUX server can't accept all lp jobs for all my printers... I pinged the print servers and they are fine, ran lpstat -r and shows me that the scheduler is running, lpstat -t shows nothing and won't get back to # unless i terminate it, lpstat -a shows all printers fine, but in SAM it failed to... (1 Reply)
Discussion started by: amao
1 Replies

4. UNIX for Advanced & Expert Users

Scheduler program

Hi, what i need to do is build my own scheduler program. I am supposed to display my own prompt. at this prompt i accept a command in the following format. ls -l start 0:0:10:10 period 10 end 0:0:0:10 now this command should be executed in the background starting at 10 mins and 10 secs... (2 Replies)
Discussion started by: p_aishwarya
2 Replies

5. Solaris

CRON Scheduler

I have akorn shell job that I can run manually but when I run via cron it starts and finishes, but does not do what it does when I run it manually. Any ideals on why this is happening? (3 Replies)
Discussion started by: CAGIRL
3 Replies

6. UNIX for Dummies Questions & Answers

Linux scheduler....

HI could you comment on my small doubts below 1. which type of sheduler is used inb linux?? is it round robin or multi queue priority based round robin ??? 2. Which process has the PID 0 ?? if it is sheduler process then how to convinience myself?? i mean how to see on the system...?? is... (0 Replies)
Discussion started by: raj_b025
0 Replies

7. Shell Programming and Scripting

scheduler Script

Hi, My requirement is i want to send mails from server to all my employess with one attachment file for every monday and friday like scheduler.. how it is possible through bash script. please guide me.. With Regards Anish Kumar.V (8 Replies)
Discussion started by: anishkumarv
8 Replies

8. Linux

Playing with the Linux Scheduler

Hi, To begin with let me explain my system and then I will come to the problem. System: My program forks 2 child processes. These child processes further start 2 user level threads (pthreads) and 2 kernel level threads (kthread). All these threads issue various system calls. I am using... (1 Reply)
Discussion started by: demigod85
1 Replies

9. UNIX for Advanced & Expert Users

task scheduler for linux

Hello i am looking for good and popular application run on linux OS as centos to give same function as crontab i am seeking task scheduler with web portal and logs and so on i preferred good tool freeware. thanks for help (1 Reply)
Discussion started by: mogabr
1 Replies
KTHREAD(9)						   BSD Kernel Developer's Manual						KTHREAD(9)

NAME
kthread_create, kthread_destroy, kthread_exit, kthread_join -- kernel threads SYNOPSIS
#include <sys/kthread.h> int kthread_create(pri_t pri, int flags, struct cpu_info *ci, void (*func)(void *), void *arg, lwp_t **newlp, const char *fmt, ...); void kthread_destroy(lwp_t *l); void kthread_exit(int ecode); int kthread_join(lwp_t *l); DESCRIPTION
Kernel threads are light-weight processes which execute entirely within the kernel. Any process can request the creation of a new kernel thread. Kernel threads are not swapped out during memory congestion. The VM space and limits are shared with proc0 (usually swapper). FUNCTIONS
kthread_create(pri, flags, ci, func, arg, newlp, fmt, ...) Create a kernel thread. The arguments are as follows. pri Priority level for the thread. If no priority level is desired specify PRI_NONE, causing kthread_create() to select the default priority level. flags Flags that can be logically ORed together to alter the thread's behaviour. ci If non-NULL, the thread will be created bound to the CPU specified by ci, meaning that it will only ever execute on that CPU. By default, the threads are free to execute on any CPU in the system. func A function to be called when the thread begins executing. This function must not return. If the thread runs to comple- tion, it must call kthread_exit() to properly terminate itself. arg An argument to be passed to func(). May be NULL if not required. newlp A pointer to receive the new LWP structure for the kernel thread. May be NULL, unless KTHREAD_MUSTJOIN is specified in flags. fmt A string containing format information used to display the kernel thread name. Must not be NULL. The following flags are defined. KTHREAD_IDLE Causes the thread to be created in the LSIDL (idle) state. By default, the threads are created in the LSRUN (runnable) state, meaning they will begin execution shortly after creation. KTHREAD_MPSAFE Specifies that the thread does its own locking and so is multiprocessor safe. If not specified, the global kernel lock will be held whenever the thread is running (unless explicitly dropped by the thread). KTHREAD_INTR Specifies that the thread services device interrupts. This flag is intended for kernel internal use and should not normally be specified. KTHREAD_TS Causes the kthread to be created in the SCHED_OTHER class (timeshared). The thread's priority will be dynamically adjusted by the scheduler. Increased activity by the kthread will cause its priority to fall; decreased activity will cause its priority to rise. By default, kthreads are created in the SCHED_RR class, with a fixed priority specified by pri. Threads in the SCHED_RR class do not have their priority dynamically adjusted by the scheduler. KTHREAD_MUSTJOIN Indicates that created kthread must be joined. In such case kthread_exit() will wait until kthread_join() will be called. kthread_destroy(l) From another thread executing in the kernel, cause a kthread to exit. The kthread must be in the LSIDL (idle) state. kthread_exit(ecode) Exit from a kernel thread. Must only be called by a kernel thread. kthread_join(l) Suspend execution of calling thread until the target kthread terminates. Conceptually the function can be compared to the user space pthread_join(3), however it must be called only once for kernel thread which was created using the KTHREAD_MUSTJOIN flag and would wait on kthread_exit. RETURN VALUES
Upon successful completion, kthread_create() returns 0. Otherwise, the following error values are returned: [EAGAIN] The limit on the total number of system processes would be exceeded. [EAGAIN] The limit RLIMIT_NPROC on the total number of processes under execution by this user id would be exceeded. CODE REFERENCES
The kthread framework itself is implemented within the file sys/kern/kern_kthread.c. Data structures and function prototypes for the frame- work are located in sys/sys/kthread.h. SEE ALSO
condvar(9), driver(9), softint(9), workqueue(9) HISTORY
The kthread framework appeared in NetBSD 1.4. BSD
August 7, 2011 BSD
All times are GMT -4. The time now is 07:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy