Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7132143ybh; Thu, 8 Aug 2019 10:38:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyv6mtiOvIuWerRgMaaDGz9AdunYsp7IPq7coouA60gy7dhDzgAWKn/TsIvcKWieqAZR4dX X-Received: by 2002:a65:6846:: with SMTP id q6mr13899229pgt.150.1565285922984; Thu, 08 Aug 2019 10:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565285922; cv=none; d=google.com; s=arc-20160816; b=qxh/5Y2755kOLvwdSuXo9qW0tR5GA/GPyR8xqkBiQ1j2FHZvuEFs1fsHvA7EzVsycP dICISEJPMTa9PRrqdlufBYWvyfMUVrskXcvqelIR2q7waxSvz/Y9G2Xyaw37IYEYighs n43NNT7L6pGYfOZzLoovHljyOcrUfUo93C0qpu0zZvajVRF1pm8Izulc/7I3VwRPIRUt 9orbDb81CAPQSCwa2rROLljc9zM9v+kakSOQ4i5/fknZSd34NXg9JrtMnNUjeivU0wp9 KeGemISP4795b3W8c/bEjVe+PhKVdSmewi0riKA/h+bCZaX6LkNtDX0lR8yJczoi1Rds uA0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=kcWZqZuyapno5ho8ojSWwKBaTFEiFPAtUOENO8HPgPc=; b=JrhGNC9U4eQdzPa+8Ze3DkvFCM/crhwOuv08herq8v84QSfTSpYbn/rV/HG/jl6ieZ OiDb1oD/8oGaFw7AGs3qi/rK4FJRqF9ay8L79BXNXF9yfj1yKD4b/rgX+tqRTaJ3PlFf wVw5b7zReD8Bxd07fBOVDdT2ZU7hnLKjcb7fWXA/Vz9q43dLJFYwBDzLmF4TxjBSDHiF A4xZK1ZLtJ4GLTZaRnWQA/iwRhIt+dyaOjOGF46YlInW8Nhm2w4mWhhxNanXxhszpD7Q C1HdASvBRyKO/4ca32qb4aQS2hDsfq7NtC586UQJ+KhpZyl0JkVgYqgFxODOdJ2G5O1e B4mA== 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 t31si2386169pjb.25.2019.08.08.10.38.27; Thu, 08 Aug 2019 10:38:42 -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 S2389968AbfHHPTQ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Aug 2019 11:19:16 -0400 Received: from 68.66.241.172.static.a2webhosting.com ([68.66.241.172]:55760 "EHLO vps.redhazel.co.uk" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1732680AbfHHPTQ (ORCPT ); Thu, 8 Aug 2019 11:19:16 -0400 X-Greylist: delayed 545 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Aug 2019 11:19:15 EDT Received: from [100.121.56.177] (unknown [213.205.240.53]) (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 1A2EB1C02183; Thu, 8 Aug 2019 16:10:09 +0100 (BST) Date: Thu, 08 Aug 2019 16:10:07 +0100 User-Agent: K-9 Mail for Android In-Reply-To: <20190808114826.GC18351@dhcp22.suse.cz> References: <20190805193148.GB4128@cmpxchg.org> <398f31f3-0353-da0c-fc54-643687bb4774@suse.cz> <20190806142728.GA12107@cmpxchg.org> <20190806143608.GE11812@dhcp22.suse.cz> <20190806220150.GA22516@cmpxchg.org> <20190807075927.GO11812@dhcp22.suse.cz> <20190807205138.GA24222@cmpxchg.org> <20190808114826.GC18351@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: Let's talk about the elephant in the room - the Linux kernel's inability to gracefully handle low memory pressure To: Michal Hocko , Johannes Weiner CC: Suren Baghdasaryan , Vlastimil Babka , "Artem S. Tashkinov" , Andrew Morton , LKML , linux-mm From: ndrw.xf@redhazel.co.uk Message-ID: <806F5696-A8D6-481D-A82F-49DEC1F2B035@redhazel.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8 August 2019 12:48:26 BST, Michal Hocko wrote: >> >> Per default, the OOM killer will engage after 15 seconds of at least >> 80% memory pressure. These values are tunable via sysctls >> vm.thrashing_oom_period and vm.thrashing_oom_level. > >As I've said earlier I would be somehow more comfortable with a kernel >command line/module parameter based tuning because it is less of a >stable API and potential future stall detector might be completely >independent on PSI and the current metric exported. But I can live with >that because a period and level sounds quite generic. Would it be possible to reserve a fixed (configurable) amount of RAM for caches, and trigger OOM killer earlier, before most UI code is evicted from memory? In my use case, I am happy sacrificing e.g. 0.5GB and kill runaway tasks _before_ the system freezes. Potentially OOM killer would also work better in such conditions. I almost never work at close to full memory capacity, it's always a single task that goes wrong and brings the system down. The problem with PSI sensing is that it works after the fact (after the freeze has already occurred). It is not very different from issuing SysRq-f manually on a frozen system, although it would still be a handy feature for batched tasks and remote access. Best regards, ndrw