|
|
Subscribe / Log in / New account

Killing processes that don't want to die

Killing processes that don't want to die

Posted May 29, 2018 23:46 UTC (Tue) by wahern (subscriber, #37304)
In reply to: Killing processes that don't want to die by Cyberax
Parent article: Killing processes that don't want to die

Reading a cgroups list from /proc is not intrinsically different than reading any other process list. Yes, it's probably faster.[citation needed] But you could always have 2 or 3 or 20 processes in a fork loop. As a practical matter it's a distinction without a difference. We shouldn't address TOCTTOU races by making loops faster, and it would be foolhardy to think doing so presents any significant barrier. It would be nice to have a way to reliably, consistently, and *provably* do process management without having to roll dice. Preferably using a mechanism that isn't easily broken with the next absent-minded patch set. The nice thing about relying on UID semantics is that it's not an area where people tend to be oblivious to the ramifications of their changes because it's always been possible to atomically kill, e.g., process groups. Though, by all means lobby for making it possible to atomically kill a cgroup. Not my choice, but defensible.


to post comments

Killing processes that don't want to die

Posted May 29, 2018 23:46 UTC (Tue) by wahern (subscriber, #37304) [Link]

s#/proc#/sys#

Killing processes that don't want to die

Posted May 30, 2018 0:14 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

Try it. cgroup-based killing is way faster than the classic /proc-based tools and you can't realistically outrace it in regular conditions.

I used to worry about it, but in practice it's not a problem. It'd be interesting to add support for atomic signalling to cgroups, though.

If your cgroups also have attached controllers, you can start by decreasing the cgroups CPU and memory priority.


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