19 captures
08 Jun 2013 - 02 Dec 2025
May JUN Jul
08
2012 2013 2014
success
fail

About this capture

COLLECTED BY

Organization: Alexa Crawls

Starting in 1996, Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the Wayback Machine after an embargo period.

Collection: Alexa Crawls

Starting in 1996, Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the Wayback Machine after an embargo period.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20130608123222/http://lwn.net:80/Articles/549659/
 
LWN.net Logo

Log in now

Create an account

Subscribe to LWN

Little things that matter in language design

LWN.net Weekly Edition for June 6, 2013

Power-aware scheduling meets a line in the sand

Trusting upstream

LWN.net Weekly Edition for May 31, 2013

(Nearly) full tickless operation in 3.10

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 16:12 UTC (Wed) by busterb (subscriber, #560)
Parent article: (Nearly) full tickless operation in 3.10

So, what's the solution for running >1 process per CPU with NO_HZ_FULL? Use syscalls as the hook for an implicit schedule 'pump'?

Requiring the user to explicitly schedule with 'sched_yield' to produce a cooperative multitasking scenario might work well. I've worked on enough realtime systems to know that this can yield good performance if done correctly (since your performance-critical sections never get interrupted without you saying so), though it occasionally bites you if you forget to yield somewhere, e.g. waiting for a lock. I know I would have liked to have had something like this in past system designs Instead, 'yielding' was done with coroutines or tasklets/threads.

What about having the boot cpu do all the scheduling for all the other CPUs? Basically treat the other CPUs like a thread pool and distribute processes. Is the cost of IPIs too much for this to be practical?


(Log in to post comments)

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 16:22 UTC (Wed) by busterb (subscriber, #560) [Link]

On a related note, it seems like quite a few multi-core SoC vendors have implemented their own patches for this behavior as well, e.g. Tilera's 'zero overhead' Linux. Glad to see if it becomes mainstream, maybe they'll all adopt just one way to do it.

http://www.6windblog.com/linux-based-fast-path/

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 16:24 UTC (Wed) by simlo (subscriber, #10866) [Link]

After a little RTFC, I found that a HR-timer was used to calculate the next preemption point. I.e. instead of preempting on 100 Hz clock, it preempts exactly when the timeslot of the current process ends.

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 18:50 UTC (Wed) by blitzkrieg3 (subscriber, #57873) [Link]

Okay, this makes absolutely perfect sense, but because of the way operating systems have been designed for the past 40 years, that solution completely eluded me.

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 19:48 UTC (Wed) by intgr (subscriber, #39733) [Link]

I got the same impression as you. I think the wording in the article is unfortunate.

> Even then, a running CPU will only disable the timer tick if there is a single runnable process on that CPU. As soon as a second process appears, the tick is needed so that the scheduler can make the necessary time-slice decisions

It's misleading to call it "the tick" if it's not fixed to the HZ any more, seems more like a preemption timer.

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 19:52 UTC (Wed) by corbet (editor, #1) [Link]

Confused. If two processes are running, the period tick will run just like it does now. What am I missing? What is misleading?

(Nearly) full tickless operation in 3.10

Posted May 8, 2013 20:23 UTC (Wed) by intgr (subscriber, #39733) [Link]

Sorry, it's much more likely that I am missing something.

AFAICT the scheduler doesn't switch tasks at every timer tick, even when there is contention for a CPU -- it has its own concept of timeslice length that changes with load. So why does a contended CPU need to run the timer tick if it's not going to switch tasks?

And grandparent wrote something that seemed to match that line of thinking:

> After a little RTFC, I found that a HR-timer was used to calculate the next preemption point. I.e. instead of preempting on 100 Hz clock, it preempts exactly when the timeslot of the current process ends.

(Nearly) full tickless operation in 3.10

Posted May 9, 2013 2:16 UTC (Thu) by nevets (subscriber, #11875) [Link]

It's confusing because there's two things at play here. There's the hrtick and the scheduler_tick.

The hrtick is used to denote exact time slices for the CFS scheduler to create more fairness. It really doesn't do much more than that. But this does not replace the scheduler_tick, which does among other things, keeps track of the SCHED_RR time slices, manages load balancing, and updates task timings.

But I'm sure in the future the hrtick may be used more to get rid of the periodic tick.

(Nearly) full tickless operation in 3.10

Posted May 13, 2013 11:57 UTC (Mon) by dps (subscriber, #5725) [Link]

I believe that real tickless operation with pre-emptition is possible. Instead of recalculating that the same process keeps the CPU every n microseconds, until it does not, one could compute when another process would win the CPU and only schedule an interrupt and that time. Any periods in which the process would keep the CPU does not need interruption.

I know actually implementing this would not be trivial and I am not volunteering to do this myself.

(Nearly) full tickless operation in 3.10

Posted May 14, 2013 12:18 UTC (Tue) by Tobu (subscriber, #24111) [Link]

Part of the work will be to adjust the various accumulators, statistics, governors and feedback mechanisms to work when the timeslice they measure isn't constant any more.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds