Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp827421ybl; Fri, 23 Aug 2019 08:56:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzua3JumyhId6RuhSoE0xfG3HYfhmk6ZbNJtJWDEn5we0UH+UWcZ/GuuxJSmqzCqTbv0vaA X-Received: by 2002:a17:90a:220a:: with SMTP id c10mr6082893pje.33.1566575793956; Fri, 23 Aug 2019 08:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566575793; cv=none; d=google.com; s=arc-20160816; b=Sg7xto/xfLakGSs2AzJQaLW8QuzEyqJaN983orWYLQdkyUeUEoaTEDBPMbyHRIBLXu aTSOKCqq2I3qc1P6u9u/AhD3Ami+g5udKDwP7Xx+PwWN93+evN0yAXjYHAQk+HwIT0uY Do8GTPsdu3XQQIqprFPUH0jrka5yTcH83GB+7LqNfGEiE0yoZmlPGemegwqPBOBDK8po 0JM87YT7ewSNzFo2Tj8MKNSVJXe0izVTMoO7JrZpu8rRR3jY0FdTfLu5Jk2n3hoZHpQF vLG/YQXiYSZBoWZoMbD/jqtUwqHDEJBiGQ4yhML9sdiXzsQvNHcMCXYixcIJn6ujVPAs pICQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=v+yoaL0ZPLneAXoi/yMtsF3DWZrVusCvFGklTdcFOqE=; b=Y/FEYXFQgolbauZxm4NHisNQj55UmeBvK1vVYJ8zjbcKculE7mrvrPf58GliZWnt9m eSSVluiQjhtu7B/trI+WfhGV/p0ozfJfCeNRs5xybmFCzMbcvC7rS1DD7WGUoFcEEN31 PqWiVAYL/AlNNABfguaCMrugW+4gCo5I0cNNFlo293Yh1A9PV52PIM30I0UScFU1mtyW MtaX2Is47RC9nZ9kMboo42bOh3jMAifWC3IfwSvdLvDW5T2kMMDtJ7gUr0V2TsMdWlnK UkPL6XlXvqqAbla12ZXat6WvwsML53CCR1nX/6UvjS8wlPYMgzLgVM8uxc1c2NlcEge8 LTFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v203si2259766pgb.302.2019.08.23.08.56.18; Fri, 23 Aug 2019 08:56:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388428AbfHWCEe (ORCPT + 99 others); Thu, 22 Aug 2019 22:04:34 -0400 Received: from vps.redhazel.co.uk ([68.66.241.172]:52128 "EHLO vps.redhazel.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733086AbfHWCEe (ORCPT ); Thu, 22 Aug 2019 22:04:34 -0400 X-Greylist: delayed 577 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Aug 2019 22:04:33 EDT Received: from [192.168.1.66] (unknown [212.159.68.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by vps.redhazel.co.uk (Postfix) with ESMTPSA id 9D73D1C021B5; Fri, 23 Aug 2019 02:54:55 +0100 (BST) Subject: Re: Let's talk about the elephant in the room - the Linux kernel's inability to gracefully handle low memory pressure To: Daniel Drake , aros@gmx.com Cc: linux-kernel@vger.kernel.org, linux@endlessm.com, hadess@hadess.net, hannes@cmpxchg.org References: <20190820064620.5119-1-drake@endlessm.com> From: ndrw Message-ID: <4d998874-d02b-395f-1b81-7034db1a8fcd@redhazel.co.uk> Date: Fri, 23 Aug 2019 02:54:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190820064620.5119-1-drake@endlessm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/08/2019 07:46, Daniel Drake wrote: > To share our results so far, despite this daemon being a quick initial > implementation, we find that it is bringing excellent results, no more memory > pressure hangs. The system recovers in less than 30 seconds, usually in more > like 10-15 seconds. That's obviously a lot better than hard freezes but I wouldn't call such system lock-ups an excellent result. PSI-triggered OOM killer would have indeed been very useful as an emergency brake, and IMHO such mechanism should be built in the kernel and enabled by default. But in my experience it does a very poor job at detecting imminent freezes on systems without swap or with very fast swap (zram). So far, watching MemAvailable (like earlyoom does) is far more reliable and accurate. Unfortunately, there just doesn't seem to be a kernel feature that would reserve a user-defined amount of memory for caches. > There's just one issue we've seen so far: a single report of psi reporting > memory pressure on a desktop system with 4GB RAM which is only running > the normal desktop components plus a single gmail tab in the web browser. > psi occasionally reports high memory pressure, so then psi-monitor steps in and > kills the browser tab, which seems erroneous. Is it Chrome/Chromium? If so, that's a known bug (https://bugs.chromium.org/p/chromium/issues/detail?id=333617) Best regards, ndrw