From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D67C4320E for ; Sun, 25 Jul 2021 02:11:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 331EA60E8F for ; Sun, 25 Jul 2021 02:11:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 331EA60E8F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C63356B0033; Sat, 24 Jul 2021 22:11:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C125C6B005D; Sat, 24 Jul 2021 22:11:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B28136B006C; Sat, 24 Jul 2021 22:11:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 97AC76B0033 for ; Sat, 24 Jul 2021 22:11:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9616B1E074 for ; Sun, 25 Jul 2021 02:11:33 +0000 (UTC) X-FDA: 78399483666.25.BC51464 Received: from r3-18.sinamail.sina.com.cn (r3-18.sinamail.sina.com.cn [202.108.3.18]) by imf06.hostedemail.com (Postfix) with SMTP id 9C97B8028FE1 for ; Sun, 25 Jul 2021 02:11:30 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([222.130.245.194]) by sina.com (172.16.97.35) with ESMTP id 60FCC84D0001EACD; Sun, 25 Jul 2021 10:11:28 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 7031315073525 From: Hillf Danton To: Alexey Avramov Cc: ndrw.xf@redhazel.co.uk, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: Let's talk about the elephant in the room - the Linux kernel's inability to gracefully handle low memory pressure Date: Sun, 25 Jul 2021 10:11:19 +0800 Message-Id: <20210725021119.1851-1-hdanton@sina.com> In-Reply-To: <20210725023201.13f0d2f2@mail.inbox.lv> References: <806F5696-A8D6-481D-A82F-49DEC1F2B035@redhazel.co.uk> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9C97B8028FE1 Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf06.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.18 as permitted sender) smtp.mailfrom=hdanton@sina.com X-Stat-Signature: qy1bguqpt443fseqnp6nbrdx1j49tka5 X-HE-Tag: 1627179090-792449 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.028061, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, 25 Jul 2021 02:32:01 +0900 Alexey Avramov wrote: >=20 >> Would it be possible to reserve a fixed (configurable) amount of RAM=20 >> for caches, and trigger OOM killer earlier, before most UI code is=20 >> evicted from memory? > >Yes! Try this patch: https://github.com/hakavlad/le9-patch Thanks for your patch. > >The patch provides sysctl knobs for protecting the specified amount of=20 >clean file pages under memory pressure. It helps more if you directly put the patch in the mail.