LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-26-2008, 10:51 AM   #1
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Rep: Reputation: 0
Question Process scheduling - what is Linux 2.4 doing every second for 100ms?


Hi Folks!

Here comes my second post to this great forum!

I created a small programm that is creating several tasks, that run in RR scheduling and are about to share CPU time fairly. This works quite acceptable for my needs, though its far away from real-time requirements.
The only thing that really bothers me is a break every second for exactly 100ms, where the mashine is doing everything, but nothing for me...

Can anybody tell whats happening in this period? And maybe somebody can give me a hint how to allocate CPU time more uniformly?

I am using:

Linux version 2.4.26-OM (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #OM Thu Sep 2 11:17:56 CEST 2004

Processor:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz
stepping : 13
cpu MHz : 2200.048
cache size : 64 KB

 
Old 05-26-2008, 07:11 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,894

Rep: Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613Reputation: 2613
Well, it keeps track of various stats eg see the output of top, sar, vmstat etc.
It also uses a journaling filesystem (unless you've chosen a non-std one).
IOW, there's a fair bit of 'housework' going on.
 
Old 05-27-2008, 02:00 AM   #3
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Cool So far...

Thank you so far Chris!

But I think this is too obvious to be just a little side effect that sometimes happens. The time slice is exaclty 100ms and it appears exactly every second.
Does anybody have a hint what this could be? What has to run at least every second for exactly 100ms? I tried several configurations, always the same period and duration!

Seems like this is a hardly scheduled task in the scheduling algorithm, but this is not the solution. If it would, it would be common knowledge, wouldn´t it?

I will post a few prints of the stats - tools when I found out how to use them

Regards

The D
 
Old 05-27-2008, 02:50 AM   #4
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Post To be more precise...

Hi,

here some more details about my program, maybe this helps to understand the problem.

I am creating several Round-Robin-scheduled processes (Prio 19) and several FIFO scheduled processes (Prio 20). Their task is to create and receive network traffic. This should be done as smooth as possible, what means there should be no 100ms break during sending!

Any idea?
 
Old 05-27-2008, 06:00 AM   #5
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Post more information

Hi Gurus!

Yeah, its him again...

By looking superficially at the output of top, the only processes, beside mine showing acitivity were the following ones:

- ksoftirq_CPU
I could rarely find any information about that one on the web. Does anybody know exactly, what this process is responsible for? I would assume it has something to do with the scheduling, right?

- kjournald
This process seems to be responsible for the consistency of the file system. Can anybody give more information about this topic? Is there a way to adapt its behaviour to my needs?

- syslogd
After a shutdown of the syslog service, the problem still persisted, so I assume this was not the culprit.

please help...
 
Old 05-27-2008, 06:35 AM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
ksoftirq_CPU
This is handling software interrupts, softirq's are used to free up hardware interrupt handler whenever possible.

kjournald
This is filesystem journaling daemon, it won't run if you do not use journaling filesystems.

There's lots of good information in kernel source ~/Documentation directory.
 
Old 05-27-2008, 06:51 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,916

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Top won't have the granularity to show what is happening at that level.

Why a 2.4 kernel ??? - can you get on a (current) 2.6 kernel ???. Ingo recently re-wrote the scheduler, and there are tools making there way into the mainline that should allow you to see the sched events.
Might be worth a custom build.
 
Old 05-27-2008, 07:53 AM   #8
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Post

Hi syg00, Hi Emerson!

Reconsidering the problem, I have to ask myself: who the hell is using 10% from my CPU time . I would like to share 1-2% for management purposes, though its a Dual-Core, but this is just too much to ignore!

- The FS journaling commit time is set to 5s, so this should not be the problem.

- Right now, I have to stick with the 2.4 Kernel. Maybe in the near future I can switch, but for now I have to struggle around with it. Is there a possible way to see what the scheduler does within one second?

- Considering all collected info until now, it seems more and more obvious that the problem lies in my own program? No, impossible! I simplified it as much as possible, still the same problem. Even with just one sending process and nothing else scheduled.
I played around with the priorities, still the same result. But there should be more people facing this problem, shouldn´t there?

Have to go for a little walk to lift the clowds from my mind, at least a little bit...

Last edited by baddad; 05-27-2008 at 07:56 AM.
 
Old 05-27-2008, 11:05 AM   #9
baddad
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
Cool Mea Culpa

Hi Folks!

At first I have to mention that the problem is solved!

Everybody who is happy now, might feel free to go on to the next thread now!

All those who are interessted in the solution, might read on, but might get disappointed. No, the problem was of course not Linux , a problem of such an dimension would have been mentioned before, didn't I tell you that? So thanks for your trust, but the problem was caused by my-stupid-self
I wrote, in a trace of megalomania, my own little RAW network logger (as can be seen in another thread, had weird probs there too ). From there I exported the data into a MySQL-DB, from there, again, into a PCAP file format to make it readable e.g. for WireShark. While transferring it into the PCAP format(using text2pcap.exe, shipped with WireShark), I had to extract the UNIX-Timestamp given in Secs and Microsecs. While concatenating the Microsecs to the secs with an little '.' in the middle, I forgot the padding zeros for values consisting of less than 6 digits. This caused, that the overall amount of frames per second was correct, but the ones without leading zeros were just put somewhere in between. Where they actually belonged, there was just a great void...


Hope my description was at least a little bit understanable


Seems like I owe you a beer, or even more

Thank you anyway for your trust and time!

Best Wishes

The D

Last edited by baddad; 05-27-2008 at 11:07 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
process scheduling problem.. nick021 General 3 12-13-2007 02:41 PM
Scheduling in Linux asurya Linux - General 5 08-31-2005 08:34 AM
Process Scheduling in Linux Newbiegal Programming 6 10-04-2004 12:08 PM
Process scheduling (CPU) kiwi_bloke *BSD 1 08-29-2004 09:07 PM
Linux Scheduling Kumar Programming 3 06-14-2004 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration