LWN: Comments on "Revisiting the kernel's preemption model, part 2" https://lwn.net/Articles/945422/ This is a special feed containing comments posted to the individual LWN article titled "Revisiting the kernel's preemption model, part 2". en-us Tue, 21 Oct 2025 02:41:28 +0000 Tue, 21 Oct 2025 02:41:28 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/995254/ https://lwn.net/Articles/995254/ meted <div class="FormattedComment"> <span class="QuotedText">&gt; For those who weren't at Kernel Recipes last week, Thomas gave a great presentation about this work there. The recording is available on YouTube</span><br> <span class="QuotedText">&gt; and complements the article nicely:</span><br> <span class="QuotedText">&gt; <a href="https://www.youtube.com/live/OUhB9-v-2r8?t=2h4m45s">https://www.youtube.com/live/OUhB9-v-2r8?t=2h4m45s</a></span><br> <p> The link says the "video has been removed". Could you post the presentations title so, who ever is curious can search for it?<br> </div> Wed, 23 Oct 2024 09:34:23 +0000 follow up? https://lwn.net/Articles/989721/ https://lwn.net/Articles/989721/ joib <div class="FormattedComment"> There was a presentation at the OSPM conference in June: <a href="https://www.youtube.com/watch?v=cVlT1CsRI18">https://www.youtube.com/watch?v=cVlT1CsRI18</a><br> </div> Wed, 11 Sep 2024 10:39:19 +0000 follow up? https://lwn.net/Articles/989666/ https://lwn.net/Articles/989666/ corbet There was a version of the lazy preemption patches posted in May. Since then I've seen bits of conversation that suggest that the idea is still alive, but I'm not sure how actively it is being developed at the moment. Tue, 10 Sep 2024 18:57:25 +0000 follow up? https://lwn.net/Articles/989665/ https://lwn.net/Articles/989665/ meyert <div class="FormattedComment"> I'm interested to know if this idea did make it to next or any other tree, I'm curious <br> </div> Tue, 10 Sep 2024 18:49:44 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946580/ https://lwn.net/Articles/946580/ tglx <div class="FormattedComment"> All of that is important, but can we please have the technical discussions on LKML instead of hand-waving here?<br> <p> </div> Thu, 05 Oct 2023 00:42:04 +0000 transparency https://lwn.net/Articles/946435/ https://lwn.net/Articles/946435/ mathstuf <div class="FormattedComment"> In Firefox, "Open image in new tab" from the image's context menu works well too.<br> </div> Wed, 04 Oct 2023 10:31:17 +0000 transparency https://lwn.net/Articles/946407/ https://lwn.net/Articles/946407/ bnorris <div class="FormattedComment"> That's this, which can be opened or downloaded separately to work around the problem: <a href="https://static.lwn.net/images/2020/preempt-count.svg">https://static.lwn.net/images/2020/preempt-count.svg</a><br> </div> Tue, 03 Oct 2023 23:51:30 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946342/ https://lwn.net/Articles/946342/ PaulMcKenney <div class="FormattedComment"> On RCU, indeed! It is very important to provide the occasional quiescent state to RCU, even if there is only one runnable task on the CPU in question. <br> <p> I was initially concern about nohz_full CPUs, but after more discussion with Frederic, this might actually be OK. If there is an RCU grace period in progress, RCU will restart the scheduler tick interrupt, otherwise maybe no one cares. Maybe. ;-)<br> </div> Tue, 03 Oct 2023 15:21:18 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946271/ https://lwn.net/Articles/946271/ terminus <div class="FormattedComment"> <span class="QuotedText">&gt; So, in other words, the path to a simpler and better scheduler has been laid out, but to get there somebody else is going to have to do the work to push the job through to completion. </span><br> <p> Working on a RFC series to do just that. Thomas' approach (obviously) works, but as always there are kinks to clean up.<br> <p> cond_resched(), in particular, has accumulated a variety of functionality almost in the manner of the fleas in the poem:<br> <p> "Great fleas have little fleas upon their backs to bite 'em, <br> And little fleas have lesser fleas, and so ad infinitum."<br> <p> As you note, keeping the preempt-count takes care of much of this but there are some tricky places, in particular RCU.<br> <p> Cheers<br> Ankur<br> </div> Tue, 03 Oct 2023 07:52:11 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946265/ https://lwn.net/Articles/946265/ alison <div class="FormattedComment"> <span class="QuotedText">&gt; It feels like it would be possible to go a step further, and have tasks designated as latency-sensitive or </span><br> <span class="QuotedText">&gt; throughput-sensitive, and have only latency-sensitive tasks preempt other tasks (and make them expend their</span><br> <span class="QuotedText">&gt; time slice faster if they do).</span><br> <p> An obvious way to perform such designations is via the deadline scheduler. The fact that deadline scheduling is scarcely mentioned in discussions like this article confirms the suspicion that it is usable only in a limited set of contexts. Perhaps deadline scheduling is really only workable for RTOSes or systems with fewer tasks, like guest OSes running on top of a hypervisor.<br> </div> Tue, 03 Oct 2023 04:44:30 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946250/ https://lwn.net/Articles/946250/ wildea01 <div class="FormattedComment"> For those who weren't at Kernel Recipes last week, Thomas gave a great presentation about this work there. The recording is available on YouTube and complements the article nicely:<br> <p> <a href="https://www.youtube.com/live/OUhB9-v-2r8?t=2h4m45s">https://www.youtube.com/live/OUhB9-v-2r8?t=2h4m45s</a><br> </div> Mon, 02 Oct 2023 20:47:16 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946226/ https://lwn.net/Articles/946226/ iabervon <div class="FormattedComment"> It feels like it would be possible to go a step further, and have tasks designated as latency-sensitive or throughput-sensitive, and have only latency-sensitive tasks preempt other tasks (and make them expend their time slice faster if they do). The system could then be configured to make tasks default to latency or throughput, but also able to give different tasks at the same priority different benefits.<br> </div> Mon, 02 Oct 2023 20:41:24 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946229/ https://lwn.net/Articles/946229/ joib <div class="FormattedComment"> If my reading of the thread is correct, particularly this message by Ingo Molnar: <a href="https://lwn.net/ml/linux-kernel/ZQlV5l4pbKunQJug@gmail.com/">https://lwn.net/ml/linux-kernel/ZQlV5l4pbKunQJug@gmail.com/</a> there wouldn't even be a need for some runtime/compile time knob to select between throughput-oriented and low-latency system modes as described in the article. But rather the lazy preemption would apply only to SCHED_OTHER (and IDLE and BATCH, not that I've ever seen anything use those) tasks with identical nice values, whereas higher priority tasks would preempt ASAP. So best of both worlds, in a sense.<br> </div> Mon, 02 Oct 2023 19:36:22 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946219/ https://lwn.net/Articles/946219/ Manifault <div class="FormattedComment"> This is a no-brainer improvement in my book. The model we currently have where a task is considered non-preemptible by default for CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY, rather than requiring it to communicate to the scheduler when it should try (keyword "try") to avoid being preempted, is fundamentally backwards and error prone. It's why we see the never-ending stream of "add cond_resched() call to avoid hogging CPU" patches flowing by. If it's a bug if we don't have a cond_resched() somewhere that would otherwise hog a core and starve important kthreads like ksoftirqd, then let's just flip the polarity and force callers to specify when they want the scheduler to try to avoid preemption for performance reasons.<br> </div> Mon, 02 Oct 2023 18:21:30 +0000 Revisiting the kernel's preemption model, part 2 https://lwn.net/Articles/946212/ https://lwn.net/Articles/946212/ josh <div class="FormattedComment"> The diagram in the article has a transparent background, which makes it unreadable for anyone using a dark background color on LWN.<br> </div> Mon, 02 Oct 2023 17:18:24 +0000