回复:[补丁] OOM_pardon,又名:别杀我的 xlock
Re: [PATCH] OOM_pardon, a.k.a. don't kill my xlock (2004)

原始链接: https://lwn.net/Articles/104185/

这封2004年Linux内核邮件列表中的邮件往来,通过一则讽刺寓言批评了Linux的内存溢出(OOM)杀手机制。 在该比喻中,一家面临燃料短缺的航空公司实施了一种将乘客抛出机外以维持飞行的方法。工程师们沉迷于复杂的算法来确定“最佳”受害者——权衡体重、年龄或财富等因素,而不是解决根本的燃料问题。作者用这个故事强调了微调OOM杀手启发式算法的荒谬性,并指出该机制有时甚至在并未真正出现内存短缺时也会触发。 这段通信是对内核内存管理方式的批判,暗示与其制定复杂的规则来决定牺牲哪个进程,系统更应优先考虑稳定性并避免不必要的终止。写信者是在回应一项关于“赦免”功能的提议;该功能旨在允许用户将特定进程标记为不受OOM杀手影响,从而防止内核“抛出”如Xlock这类关键应用程序。

这篇 Hacker News 讨论重温了关于 Linux 内核内存溢出(OOM)终止机制的长期争论。该讨论帖源于 2004 年关于“OOM_pardon”的一项提议,即在内存耗尽时保护 `xlock` 等特定进程不被终止。 参与者讨论了各种解决方案的有效性: * **静态分配/mlock**:尽管这些方法试图预留内存,但用户指出,由于内存超额分配(overcommit)和延迟页面加载,它们仍然存在风险。 * **内存超额分配(Overcommit)**:这是一个争议点;禁用它虽然可以避免 OOM 问题,但会牺牲内存超额分配所带来的系统稳定性优势。 * **OOM 轮盘赌**:一些人主张完全放弃 OOM 终止程序的选择过程,建议直接让导致内存耗尽的进程失败。 对话最终转向了系统安全性,贡献者们认为仅依赖锁屏进程来保障系统安全存在本质缺陷。他们认为,安全的架构不应在锁屏程序崩溃时“默认开启(fail open)”,并指出现代显示管理器和其他操作系统设计是处理屏幕锁定安全性的更好范例。
相关文章

原文
From:  Andries Brouwer <aebr-AT-win.tue.nl>
To:  Thomas Habets <thomas-AT-habets.pp.se>
Subject:  Re: [PATCH] oom_pardon, aka don't kill my xlock
Date:  Fri, 24 Sep 2004 01:45:20 +0200
Cc:  linux-kernel-AT-vger.kernel.org
On Thu, Sep 23, 2004 at 01:23:08AM +0200, Thomas Habets wrote:

> How about a sysctl that does "for the love of kbaek, don't ever kill these 
> processes when OOM. If nothing else can be killed, I'd rather you panic"?

An aircraft company discovered that it was cheaper to fly its planes
with less fuel on board. The planes would be lighter and use less fuel
and money was saved. On rare occasions however the amount of fuel was
insufficient, and the plane would crash. This problem was solved by
the engineers of the company by the development of a special OOF
(out-of-fuel) mechanism. In emergency cases a passenger was selected
and thrown out of the plane. (When necessary, the procedure was
repeated.)  A large body of theory was developed and many publications
were devoted to the problem of properly selecting the victim to be
ejected.  Should the victim be chosen at random? Or should one choose
the heaviest person? Or the oldest? Should passengers pay in order not
to be ejected, so that the victim would be the poorest on board? And
if for example the heaviest person was chosen, should there be a
special exception in case that was the pilot? Should first class
passengers be exempted?  Now that the OOF mechanism existed, it would
be activated every now and then, and eject passengers even when there
was no fuel shortage. The engineers are still studying precisely how
this malfunction is caused.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



联系我们 contact @ memedata.com