Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum

Keywords: Match:
Podcast explores real-time features of Linux 2.6
Aug. 03, 2007

TimeSys has produced another entertaining podcast on the always lively topic of real-time capabilities in the 2.6 kernel. Having defined lots of real-time related terms in last week's episode, co-hosts Gene Sally and Maciej Halasz explore ways developers can avoid or control interrupt, scheduler, and kernel latency.

Spread the word:
digg this story
tAfter some further definitions of terms such as "spin-lock" and "mutex," the discussion gets underway with a rundown of various sources of latency. Those discussed include:
  • Shared interrupts, in which multiple ISRs (interrupt service requests) are assigned to the same line (i.e., IRQ7). Halasz says this leads to ISRs being executed in "cascades," so that "by the time the system gets to the ISR that's important to you, there are some other ISRs that get executed first." He notes that cascading is sometimes unavoidable, due to a limited number of hardware interrupt lines. "It comes down to figuring out which interrupt lines are important, and mapping ISRs according," he said.

  • Badly written device drivers that simply disable interrupts rather than trying to fairly schedule CPU time -- Sally calls this the "sledgehammer method," noting, "Disabling interrupts is the easy way, but you're going to suffer tremendous scheduling penalties."

  • Forward-ported device drivers from 2.4 -- Sally says that "In 2.4, even the best device drivers didn't care about areas that are important to real-time performance." Halasz adds that macros aimed at helping authors port drivers "don't always do the right thing."
Next, the duo looks at real-time improvements in the 2.6 kernel, starting with the 0(1) scheduler, which was among the first changes to appear in the earliest 2.6 kernels. Sally explains that "0(1)" as a term refers to "constant time." He notes, "As you add or remove tasks, or switch tasks, it takes the same amount of time, regardless of how many tasks are running. This makes the kernel more predictable."

Halasz explains in more detail, "To achieve a constant interval [between task switches], [the scheduler] grabs the highest priority task from the 'active' area, executes for the time slice it has, and moves it to 'expired.' When all tasks in 'active have been executed, it swaps 'active' with 'expired,' and starts all over again. Regardless of how many tasks are scheduled, the interval is constant."

Sally notes, "There are corner cases where there are too many things running, such that no one process gets enough time to get much done."

He also observes that "inexperienced engineers sometimes create a bunch of threads they think they can schedule." Halasz agrees, noting, "For real-time, reduce the number of threads so you have a better understanding of how your system behaves. Scheduling safety is difficult with a large numbers of threads. You want to minimize the number of high-priority threads."

Next, the discussion moves to preemption, and additional scheduling points added to 2.6 to improve SMP (symmetrical multiprocessor) performance. Sally notes that with multiple processors, you "really do have concurrent processing," so you need to be able to "stop at any point, and do a context switch." Such context switches can be instigated by voluntary preemption or through priority inheritance, the pair suggests.

The lively half-hour ends with a discussion about "soft" ISRs, which offer developers a way to schedule interrupts as kernel threads. Halasz explains, "Let's say you have an interrupt that arrives at one of the lines fairly frequently. The real-time task relies on two other interrupts that are arriving. Moving the ISRs into kernel threads allows you to compete for the CPU, because you can raise the priority of the real-time tasks above the priority of interrupts that do not interest you. You can control what kind of latency your application will experience."

Halasz is quick to add, "On the downside, as you move the ISRs into kernel threads, you increase the amount of time they take to execute," due to scheduling overhead. This frustrates many engineers who "want both -- they want all the packets to arrive as fast as possible, and also to execute the real-time application in a reliable way," he said.

With time running short, the two agree to wait until next week's episode to discuss two additional new real-time capabilities in Linux 2.6:
  • High resolution timer support

  • Mechanisms that allow you to track various latencies in the kernel by default, "so you can just enable them, and collect the data," Halacz said
Also planned for next week's episode is a discussion of which real-time options are enabled by default.

You can listen to this informative LinuxLink Radio episode in MP3 or OGG formats here (MP3) and here (OGG). The compete list of LinuxLink Radio podcasts is here.



Related Stories:


(Click here for further information)


FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
GOLD SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

mobile phones!

other cool
gadgets



BREAKING NEWS

• Hacker-friendly karaoke PMP runs Linux
• Maemo gains KOffice port
• OLPC partners with Amazon, ITU
• "cJTAG" debuts
• First $100 laptop runs Linux
• First Linux on Everest
• Dell ships Ubuntu- and Atom-based netbook
• Smallest x86 board ever?
• MontaVista Vision gains focus
• "Olympics" phone runs Linux
• Android Challenge winners push location awareness
• Atmel-based industrial SBC runs Linux
• Atom squeezes onto Pico-ITX board
• Via frees Chrome graphics driver source
• Webinar dissects Linux multicore migration


Most popular stories -- past 90 days:
• Open source phone goes mass-market
• Updated! Linux Mobile Phones Showcase
• World's cheapest Linux-based laptop?
• Garmin Nav devices run Gnome Linux
• First Atom-based notebook runs Linux
• ARM9 board boots Debian in 0.69 seconds
• Open source camera records geotagged video to SATA HDD
• Linux-friendly Beagle fetches $150
• "PDA phone" runs Linux
• Intel offers $80 "Little Falls" Atom mobo
• Netflix Player runs Linux


DesktopLinux headlines:
• OSCON 2008 presentations, videos posted
• Debian distro named for little green man
• Google spins web browser
• Summit debuts for Linux end users
• "UbuntuLite" reviewed
• Linux in the SME
• Linux: not yet photo-friendly
• Linux to gain anti-virus software
• Linux gains backup utility
• Testing Lenny


Also visit our sister site:


Sign up for LinuxDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Linux is a registered trademark of Linus Torvalds. All other marks are the property of their respective owners.