Earlier quoted context omitted.
What is proposed is to not have an OOM killer with a selection process, meaning that the "someone other allocates" would be the one dying.
The problem is that Linux has memory overcommit and it will OOM when a process faults a page in, not just when someone allocates memory. So the OOM condition can hit any random process, not necessarily one that just tried to allocate. If you don't have some sort of selection, then you would still have an OOM killer, only it will be killing completely at random.
Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
31–40 of 103 posts
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#32Especially in an era where RAM is so expensive, the obvious answer is to simply never use memory. If your data can't fit in the plethora of CPU registers at your disposal, your software is probably too complicated. /s
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#33I confess, this is very funny and the underlying situation is a bit absurd, but it's unclear what point Brouwer is making by pointing out the absurdity. There surely is something absurd about having to register specific processes as exempt from the OOM killer. But given that the OOM killer exists, and could kill xlock...how should that be fixed?
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#34I confess, this is very funny and the underlying situation is a bit absurd, but it's unclear what point Brouwer is making by pointing out the absurdity. There surely is something absurd about having to register specific processes as exempt from the OOM killer. But given that the OOM killer exists, and could kill xlock...how should that be fixed?
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#35"The protect command is used to mark processes as protected. The kernel does not kill protected processes when swap space is exhausted. [...] If you protect a runaway process that allocates all memory the system will deadlock."
[1] https://man.freebsd.org/cgi/man.cgi?query=protect&apropos=0&...
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#36I confess, this is very funny and the underlying situation is a bit absurd, but it's unclear what point Brouwer is making by pointing out the absurdity. There surely is something absurd about having to register specific processes as exempt from the OOM killer. But given that the OOM killer exists, and could kill xlock...how should that be fixed?
The point is that the OOM killer shouldn't exist and arguing about how to tweak it is addressing the wrong problem
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#37It's 2026 and I still can't configure the OOM killer to kill firefox before anything else.
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#38Earlier quoted context omitted.
I’m not against taking down the kernel if the situation is that catastrophic. Better than killing the lock screen for sure.
IMO if the security of a system depends on the lock screen not crashing then the system is not very secure. Security protocols should never fail open like that; a lock screen should never simply be a layer on top of the authenticated desktop. Windows and macOS get this right. I believe Wayland display managers are also able to get this right (but I haven't checked).
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#39I’d say, let the one who tried to allocate memory crash, and if you’re a critical process like xlock, use statically allocated memory and don’t alloc again.
Statically allocated memory can still OOM on access, due to overcommit and lazy page table population. What you really want is mlockall(2) (probably with MCL_CURRENT|MCL_ONFAULT followed by madvise with MADV_POPULATE_*)
Re: Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)
#40Earlier quoted context omitted.
The point is that the OOM killer shouldn't exist and arguing about how to tweak it is addressing the wrong problem
I agree that that's the point he's making, but I don't see how that would work practically. His attitude is that malloc(1<<63) should immediately crash the system, every time? How is that better?