March 05 2011

A PRACTICAL (COMPARATIVE) STUDY OF SCHEDULING POLICIES IN LINUX AND WINDOWS 2K OPERATING SYSTEMS

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

A  PRACTICAL (COMPARATIVE) STUDY OF

 SCHEDULING POLICIES

IN

LINUX AND WINDOWS 2k  OPERATING SYSTEMS

 

*B.Madar

Abstract

Shared-memory multiprocessors are frequently used as compute servers with multiple parallel applications executing at the same time. In such environments, the efficiency of a parallel application can be significantly affected by the operating system scheduling policy.

 

It is common to evaluate scheduling policies based on their mean response times. Another important, but sometimes opposing, performance metric is a scheduling policy’s fairness.

 

Then, how do we evaluate a scheduling policy:

Ability to satisfy all deadlines.
CPU utilization—percentage of time devoted to useful work.
Scheduling overhead—time required to make scheduling decision.

 

 

We will concentrate on scheduling at the level of selecting among a set of ready processes. Scheduler is invoked whenever the operating system must select a user-level process to execute:

• After process creation/termination

• A process blocks on I/O

• I/O interrupt occurs

• Clock interrupt occurs (if preemptive).

 

Introduction on Scheduling Policies.

 

Types of processes:

• Interactive jobs

• low priority, cpu bound jobs that use excess processor capacity (e.g., calculating _ to

101000000 decimal places)

• Somewhere in between

Distinguish between a short and long process. Based on the time a process runs when it

gets the CPU. An I/O bound process is short and a CPU bound process is long.

Note; The idea of short vs. long is determined by how much of its time slice that a process uses, not the total amount of time it executes.

 

 

 

 

Criteria

 

Criteria for a good scheduling algorithm:

 

• Fairness: all processes get fair share of the CPU

• Efficiency: keep CPU busy 100% of time

• Response time: minimize response time

• Turnaround: minimize the time batch users must wait for output

• Throughput: maximize number of jobs per hour

They are competing. Fairness/efficiency, interactive/batch

 

Measurements

In order to compare different short-term policies, we need a measure of performance.

Assume that a process needs t time in execution before it leaves the ready list:

Execution time (t) — execution time

Response time (T) — finish time – arrival time. (Wall clock time)

Missed time (M) — T – t; time spend on the ready list or in blocked state.

Penalty ratio (P) — T/t; penalty of 1 ideal (lower penalty is good)

Response ratio (R) — t/T; response of 1 ideal (higher response is good)

 

Other useful measures:

• Kernel time — amount of time the spent by the kernel in making policy decisions and carrying them out. Context switching. A well tuned O.S. Uses between 10-30%.

• System time — kernel time devoted to a process.

• Idle time — amount of time spend when the ready list is empty. Thus running a

NULL process or running NULL routine code.

 

Scheduling Policies of LINUX OS

Linux offers 3 different ways to deal with scheduling, 2 of them for real-time applications and 1 for normal processes. A static priority value, sched_priority, ranging from 0 to 99, is assigned to each process. This static priority value can be changed only via system calls. The scheduler keeps a list of runnable processes with these priority values. The way Linux determines which process will be running next is by looking at such list for the highest priority number, and then takes the process at the head of the list. The scheduling policy determines where a process will be inserted in the event that it has an equal priority value with another process. Likewise, it will determine how it will move once inside the list.

Most processes use SCHED_OTHER which is the default universal time-sharing scheduler policy. Other most time-critical applications that require precise control use SCHED_FIFO and SCHED_RR. When using SCHED_OTHER, processes must be assigned an static priority value of 0. Otherwise, if using the two other algorithms, the priority value shall range from 1 to 99. Only such processes with super user privileges can have a priority value greater than 0, therefore they may use SCHED_FIFO and SCHED_RR.

All scheduling is preemptive, meaning that if a process with a higher priority is ready to run, the currently running process is preempted and taken to the wait list. It is the task of the scheduling policy to determine the ordering within the list of runnable processes with equal static priority value.

SCHED_FIFO: First In – First Out Scheduling

SCHED_FIFO is used only with priority values ranging from 1 to 99, that is, a SCHED_FIFO process ready to be run will always preempt a normal, SCHED_OTHER, process currently running. SCHED_FIFO does not deal with time slicing. If a SCHED_FIFO process has been preempted by a higher priority process, it will go to the top of the wait list and will resume running as soon as all processes with higher priority values have been blocked.

 

SCHED_RR: Round Robin Scheduling

SCHED_RR works just like SCHED_FIFO, but with one difference: each SCHED_RR process is allowed to run for a specified time quantum. As soon as a running process reaches its allotted time quantum it will be put back at the end of the same-priority-value list. If a SCHED_RR process has been preempted by a higher value priority process, it will complete the unexpired portion of its allotted time quantum when it resumes execution.

SCHED_OTHER: Default Linux Time-Sharing Scheduling

This is the usual time-sharing scheduling algorithm used for all normal processes, or processes that do not require special static priority real-time mechanisms. The process that runs is determined by a dynamic priority inside the list of the same static priority values processes, namely 0. The dynamic priority is based on the nice level and increased for each time quantum the process is ready to run, but denied to run by the scheduler. This way ensures fairness among all static priority 0 processes.

Nice Level – the ‘nice’ command changes the priority level value of a process. The priority that may be adjusted by ‘nice’ runs from -20, the highest, to 19 the lowest.

 IMPLEMENTATION

Each of the three programs in both, the Kernel and User Levels, was run 25 times, which produced varying time results depending on the random numbers generated by them. An average was computed of these 25 results to come up with a final result for each algorithm.

The time was accurately measured using the following commands:

start_time = clock ();
end_time = clock ();
cpu_time_used = ((double) (end_time – start_time)) / CLOCKS_PER_SEC;
system (“date”);

 IMPLEMENTATION OF SCHEDULING AT KERNEL LEVEL

SCHED_FIFO: First In – First Out Scheduling

Three different programs were written in C to implement and test the FIFO algorithm. Each program creates 10 threads, and each thread, in turn, generates between 300,000 and 3,000,000 random numbers so they utilize CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

SCHED_RR: Round Robin Scheduling

Three different programs were written in C to implement and test the Round Robin algorithm. Each program creates 10 threads, and each thread, in turn, generates between 300,000 and 3,000,000 random numbers so they utilize CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

SCHED_OTHER: Default Linux Time-Sharing Scheduling

Three different programs were written in C to implement and test the other algorithm. Each program creates 10 threads, and each thread, in turn, generates between 300,000 and 3,000,000 random numbers so they utilize CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

 IMPLEMENTATION OF SCHEDULING AT USER LEVEL

SCHED_FIFO: First In – First Out Scheduling

Three different programs were written in C to implement and test the FIFO algorithm. Each program creates 10 threads, and each thread, in turn, increases or decreases the number of random numbers by a random number so each utilizes CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

Shortest Job Fist Scheduling

Three different programs were written in C to implement and test the Shortest Job First algorithm. Each program creates 10 threads, and each thread, in turn, increases the number of random numbers so they utilize CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

 

 

Longest Job Fist Scheduling

Three different programs were written in C to implement and test the Shortest Job First algorithm. Each program creates 10 threads, and each thread, in turn, decreases the number of random numbers so they utilize CPU resources in varying time slots.

A completely different program from the ones indicated in the paragraph above runs the 3 main programs.

 TEST RESULTS

After running each of the programs for each of the algorithms 25 times, as specified earlier, the average time results have been placed in the table below:

 

 

Program 1
Time (secs)

Program 2
Time (secs)

Program 3
Time (secs)

TOTAL
TIME (secs)

sched_setscheduler (pid, SCHED_FIFO, &p)

31

11

8

50

sched_setscheduler (pid, SCHED_FIFO, &p)

31

11

8

50

sched_setscheduler (pid, SCHED_RR, &p)

17

13

18

48

sched_setscheduler (pid, SCHED_OTHER, &p)

29

11

11

51

SJF

40

31

30

101

LJF

36

32

29

97

 

 

Scheduling in Windows 2000

 

Windows 2000 schedules at the thread granularity.
Priority-driven, preemptive scheduling system
The highest-priority runnablethread always runs.
Time-sliced, round-robin within a priority level.
Windows 2000 uses 32 priority levels
System level (0), Variable levels (1-15), Real-time levels (16-31)

from Win32 point of view

Processes are given a priority class upon creation:

Idle, Below Normal, Normal, Above Normal, High, Real-time

Changeable by Task Manager.
The individual threads have a relative priority within the class:
Idle, Lowest, Below-Normal, Normal, Above Normal, Highest, Time-Critical.

 

 

 

 

 

 

 

Quantum in Windows 2000
By default, threads start with a quantum value of

      6 on Windows 2000 Professional

36 on Windows 2000 Server
The rationale for longer default value on Windows 2k Server is to minimize context switching.
Each time the clock interrupts, the clock-interrupt routine deducts a fixed value (3) from the thread quantum.
The clock interval for most x86 uniprocessorsis 10ms, and for most x86 multiprocessors, 15ms.

 

Partial quantum decay–The reason quantum is expressed in terms of a multiple of 3 quantum units per clock tick is to allow for partial quantum decay on wait completion.–When a thread executes a wait function, its quantum is reduced by 1 quantum unit. –This partial decay addresses the case in which a thread enters a wait state before the clock interval timer fires.–If this adjustment is not made, it would be possible for threads never to have their quanta reduced.

 

 

 

 

 

•Foreground quantum boost

–The field is an index into a three-entry quantum table used to obtain the quantum for the threads in the foreground process.

•The value of 3 is invalid and treated as 2.

–The quantum for threads in background processes is taken from the first entry in this quantum table.

–The foreground process is the process that owns the thread that owns the window that’s in focus.

 

CONCLUSIONS

The results at the Kernel Level were much better for the Round Robin algorithm and much worse for the other algorithm.

The results at the User Level were best for LJF and worst for SJF.

Scheduling performance criteria and goals are dependent on environment

There exist several different algorithms targeted for various systems

Traditional OSes like Windows, Linux, Unix….Usually uses a priority level algorithms

We conclude that there exists a false dichotomy between schedulers based on proportional share techniques and schedulers. The important question is not which class of algorithms is better, but rather, for a given operating system and set of applications,

(1) to what degree must existing infrastructure such as a periodic timer interrupt and system for manipulating priorities be utilized; (2) how much pessimism and context switch overhead is acceptable; and, (3) what scheduling parameters can the developers of real-time applications be reasonably expected to provide?

 

  BIBLIOGRAPHY

1. Operating Systems Class Website
2.Operating Systems, Harvey M. Deitel, Paul J. Deitel, David R. Choffnes, Third Edition
3.Understanding the Linux Kernel, O’Reilly Online Catalog
4.Linux Process Scheduling
5.Linux Process Scheduling – Summary.

6. Various websites related to OS

 

 

* Faculty in Alluri Institute of Management Sciences, Hunter Road Warangal,Andhra Pradesh-506001

February 21 2011

Installing Linux PS3

Tagged Under : , , , , , , , , , , , , , , , , , , , , ,

It is fantastic that so many people still don’t know that their very own PS3 is one of the worlds best super computers. Typically folks don’t realize because they only use it to play games. But with the power of the Linux Operating System your PS3 can be 3 times as dynamic as your home PC. Even with the installation process of linux being straightforward as pie, a number of PS3 owners are nervous to take the jump.

Linux is built for computer’s but express versions can be installed on your PS3 to turn it into somewhat of an excellent computer. While you can install Ubuntu, Redhat, Kubuntu and even Fedora, the best distro to pick is Yellow Dog Linux. The reasoning being that Yellow Dog was without delay commissioned by Sony to be built for the PS3.

Sony does not make the installation process extremely user friendly but they did the best they could with it. The user will have to know where to start and where to go next. The very first thing you’ll wish to do is BACK UP YOUR FILES! Don’t do anything else before backing up your information. Even though installing Linux on your PlayStation 3 console will not erase or replace the local operating system, it will wipe out your saved games. So again, back up your data!

After you install Linux on your PS3, there will be two operating systems on your gaming console : the native GameOS and the Linux OS. The native operating system lets you play all the games by creating a channel of communication between you and the system’s hardware. So when you are playing a game, scrolling through the cross menu bar ( XMB ), listening to music or watching movies, the GameOS allows for this to happen. Linux will run on top of the GameOS which will then supply the link between Linux and the PS3 hardware.

Whatever you decide, installing Linux on your PS3 is a good idea if you need to completely customise your games console and have another entirely working home desktop computer. Doing this does not take away your PS3′s local gaming capabilities at all. Remember, Sony designed the PS3 to be capable of running Linux so don’t let this be the reason why you don’t want to install it. Above all else, have a good time with it! That’s pretty much the point of having this first-rate gaming system.
.

February 18 2011

You Dont Have To Switch Totally When Using Linux Desktop

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , ,

When people talk about operating systems and compared and contrast them, the debate generally revolves around the argument of which one would you use if you could only use one operating system and not have access to the others.  These debates do have some validity but the reality is that a person can use as many operating systems as they want. 
Much of the time when talking about the Linux desktop someone might point out that they can’t switch because of a function or application they are tied to on their machine.  The reality is that a switch is not needed to use Linux.

Since Linux is free and open source, the software can be distributed and installed to as many computers, external hard drives, USB sticks, SD cards, and other devices as you wish.

There are no limitations.  The idea that someone couldn’t use Linux or it’s features while preferring another operating system are not mutually exclusive.

Some use Linux in a virtual machine.  The advantage of this is that this gives the user a way of surf the internet without infecting their main machine.  There are too many vulnerabilities while surfing the internet anymore that using a virtual machine with Linux gets rid of the headaches completely.

Another use of Linux is for fast boot option on their hard drive.  There are versions of Linux that boot up quickly that can be used for quick connections to the internet to take care of 90% of the computer’s tasks.  These are great on laptops and netbooks.

Some also use Linux as a way of testing out server software.  It’s easy to run a multitude of server-like functions on a Linux distribution or server.  This can be done installed to the hard drive or on a virtual machine.

There are a variety of reasons why learning to use Linux as a tool or as an operating system are important.  Switch or not, the benefits are helpful.

February 15 2011

How To – Retrieve Deleted Files/directories From Linux Computer?

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , , , ,

Is your system virus infected and the virus has deleted your valuable files? Have you accidentally deleted your critical business files from Linux hard drive? If your answer is ‘Yes’ for any of the above questions, you have encountered a critical data loss situation that may severely affect your business as well as personal operations. In such cases, you need to perform Linux Data Recovery to get your mission-critical data back.

Recovering deleted files from other operating systems is quite easy as compared to Linux, as a number of free or paid recovery software are available for them. But how to recover lost data from Linux system?

To recover deleted files from the Linux hard drive, Linux operating system provides two in-built utilities. These tools are actually based on the file system of Linux, which you are using on your hard drive. The Linux Recovery tools are:

Extundelete- It is a tool, which recovers deleted files from Ext4 or Ext3 file system volume of Linux operating system. Both these file systems are popular and widely used in Linux. These tool uses information stored in journal of Ex3 or Ext4 volumes to recover the file, which has been deleted from the volume. The utility recovers both the file names and contents of the file.

Ext3undel- It is a set of scripts for helping you to retrieve deleted files from Ext3 or Ext2 file system volumes. This utility attempts to automate various difficult manual recovery jobs to help retrieve lost files from specified disk. You can recover a particular file by its file name or can recover all the files that are marked as deleted.

E2undel- It is an interaction console utility, which recovers lost or deleted files from the Ext2 file system volume. It enables you to perform Data Recovery Linux for selected files by file name. It is quite simple to use.

Although, the above tools are helpful in recovering deleted files from Linux hard drive, they can neither handle severe disk corruption nor can guarantee recovery in all cases of data loss. In such cases, Linux Data Recovery software come to your rescue, and work in all cases of logical data loss. They are totally safe and easy to use.

February 13 2011

Linux dedicated server, what does it mean

Tagged Under : , , , , , , , , , , , , , , , , , , , , , ,

A time will come were the traffic visiting your website is so much as a result of the popularity of your business. As a consequence of such a huge traffic in your websites all your applications would take much time to operate and would create inconveniences for the visitors. To avoid such a situation it is always advisable to move into a dedicated server from a shared server service. A dedicated server means more power to your business as you could maintain your own operating system and applications. Also you would have a dedicated IP address of your own.

 

Most of us who are familiar with some of the products in the online world know that the Linux application and products are free. Linux dedicated server is the most preferred type of dedicated server as it is much cost effective and easy to operate when compared to other dedicated servers.

 

Many entrepreneurs go in for a Linux dedicated server due to the cost advantage that it offers to them. Microsoft is the nearest competitor to Linux dedicated servers. Both of them combined have the majority in the dedicated server market. In the case of a Microsoft dedicated server individual licenses are required for each of their software packages. But is the case of Linux this is not the case and requires no cost.

 

The main advantage of the Linux dedicated server is the reliability it offers to the users. Since it comes from the company Linux, which is a trusted name in most of the households all over the world, it brings much reliability with it. Linux is a name which is highly reputed in the industry as well. An important advantage that Linux dedicated server has over other servers is that it can run for a much longer time. Almost all the operating systems that are available today are compatible with Linux servers. Not only they are compatible, but also they can be operated with much ease. So having understood the benefits that a linux dedicated server have over other servers, it is better to choose this server from our options.

February 03 2011

Linux – Eminent Choice Or Not?

Tagged Under : , , , , , , , , , , , , , , , , , , , ,

Linux has been something like monotony nowadays. Its fame makes it being the talk of the town – various Linux downloads, Linux programs, etc… And what’s great about this is – it’s all for free! However, free programs or software would always come to an end due to the rising number of users as well as the demands them constantly plea. There will really come a time that some of them will be priced just right for its effectiveness and usage. But that won’t tremble any of the existing and satisfied users of Linux because they already know how great it is to use such system.

Most of today’s Linux subscribers were actually using other operating systems and decided to transfer to Linux because of some annoying experiences. You can almost hear their murmurs whenever they talk about their previous systems. A complaint from a lady in her workplace have been heard telling that she got all fed up and totally annoyed with her current operating system and thinks of migrating to Linux. No worries at all because I think it’s just so easy to do it. Another thing is, switching to Linux can be very fast for her since she’s not using the software herself.

Beforehand, switching to Linux will require you to take a closer look around your software as well as to make some research about this new operating system. You should be aware of the software that are compatible with this new OS. Will your software run faster, or will be more user-friendly and effective once you transfer to this new system? Consider the advantages and disadvantages before you finally decide.

A large number of Linux software usually comes for free. And yes, they are indeed FREE! But are that free software doesn’t bother you at all? A colleague once mentioned that the more ‘free’ a software becomes, the more it is prone to get affected by some malicious programs. So before planning to use Linux, better watch out for these unwanted possibilities.

Another thing to consider is the commands that Linux has. Since it is new, there’s a possibility that some of its commands are different from your old OS. You have to get familiar with it first and then see to it that it has some sort of a familiar environment with your previous operating system. In that way, you won’t be caught something like grasping for breath because you have experienced a shock after suddenly switching to something you aren’t familiar with yet. So, it would be better to check everything out in order to get all things done – safely.

Anyhow, if you think you are ready enough to switch and try something new, then better opt for something that have positive feedbacks. Try to look at the bright side of your choice. Don’t worry too much about some adverse comments, for as long as you know that you, yourself can handle any problems that may occur (we could never really get rid of any unexpected failures). Consider the point that Linux has been very congenial to its users and is very friendly to the budget too. You won’t have to fret since some of its software are still offered for free (to download and to use as well).

I guess, the best thing to do primordially is to seek for valuable inputs about the Linux OS. Search and read a lot of reviews. Visit those sites that have favorable recommendations as well as some critics about this new operating system. Check out for software compatibilities and make sure that you’ve done checking the list of important software that you have – of which ones are and are not compatible with Linux. Better be ready before deciding to make a shift.

To finish this off, it will make sense to weigh all the odds and to consider the possibilities first before deciding to switch for Linux. A dissatisfied OS user (of another system) may opt for Linux to try its proficiency and effectiveness. He may go through a lot of new commands to learn and get familiar with, yet the important thing is, he is happy and comfortable with his choice. Well, the bottom lines for this is – if you are already fed up with what you currently have and is already annoyed of its performance, then why stick to that when you have greater options to choose from? So to speak, Linux may have been waiting for you all along.

February 02 2011

Why Linux Web Hosting ? the Most Popular Web Hosting

Tagged Under : , , , , , , , , , , , , , , , , , , , , , , ,

When discussing websites, servers and web hosting, one of the most frequently used phrases is “stability”. Computer users, experts and programmers love to use equipment that is operating along very stable lines. Generally, this means that the operating software and other systems are communicating well and performing at optimal or reliable levels.

Everyone knows just how frustrating it is to have a computer come, literally, to a “grinding halt”; the machine works slower and slower, seeming to struggle with simple operations such as saving a document, until finally it crashes or becomes inoperable. While this is rarely fatal to a computer or server, it is definitely annoying to a computer operator. A poorly operating website is generally the result of an inefficient operating platform, and frequently the cause of lost business and income.

What can be done to improve stability? Generally, most computer programmers and web developers turn to a few key programs to create stable operating environments, and one of the most common is Linux. Most people immediately ask why Linux web hosting is the most popular web hosting platform, and the answer to their question is fairly complex.

First, Linux has been in existence for a significantly long period of time, meaning it has had many of the most common flaws or “bugs” worked out of it. Additionally, it has continually demonstrated a lengthier “uptime” when compared to many other operating systems, and never needs to be “rebooted” when files are added or changes are made.

Next, Linux is able to interface successfully with the major web development programs, like Apache and PHP. It generally accepts a broader range of file extensions, which is handy when accessing a server, writing pages, and utilizing “server-side” scripts, like “ColdFusion”.  Another consideration about the flexibility of the Linux software is its remarkable convertibility, meaning that any Linux website is easily transferable to other operating software programs, such as Microsoft Windows.

Finally, many computer professionals look to Linux first because of its open source software, meaning it is the least expensive and easiest system to get “up and running”. There are low costs associated with its licensing, with most versions available as free downloads.

Where security is concerned, most operating platforms and software are under a constant barrage of viruses and hacking attempts. While Linux is known to be far less vulnerable than other platforms, ultimately it is the responsibility of the web hosting company to also provide some security to their client’s sites as well.