Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3862336ybh; Tue, 6 Aug 2019 02:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7Fo+qh2YKUY5mA9dZK0PYsbkbRRaa1xvcxewyWYEvsd5kbYj9//8uTrHKX9XA0lfYCX2K X-Received: by 2002:a17:902:bf4c:: with SMTP id u12mr2161352pls.317.1565084352937; Tue, 06 Aug 2019 02:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565084352; cv=none; d=google.com; s=arc-20160816; b=qdBFXsutRldhpYONYLHEhH8YAdHh7HBq4jl9CVwy1D9SR/OJ2Zx89D4+i/OO155DHn pDoQSsD+Pee0CtORWDNqdhFXv+D5HAeR5AHL97ifqGhmO71hMh6ijnPI0DyWYsdiEpJr UN2iviVU6d/uUr7VGHUH5WlhshPIsqGc9noYS2a1+9c+/m7bqFLUOtPs0fS9pOPTzTQU OzUs8FOHv05e2t773U0YB2NcdVRMcbqsJWRyP7g7lrpPdZ4sE4SUw2yfMS9VdbJspjzM hvUGHQQjmHR2ZWcS6S6kcykh06Z2diFC/GHKaqS/5rvmeL85G5xNH/USEDJMrvgSvpU/ ejKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=WjVNe2F3OQqP8hJUCG4PYhkJJ017ssBHh7IEW0bHEE0=; b=lyT/cA7U/poLqy29OHbEUpqTwUBcZoj3RbtadysQjRd9RxRJthkPU4JqerQ022cXt8 hx1NEhHPb9LYp60jEbSPg03XazM+8EjJbSBxJ5v/M1keWsoNDBTtWPCi2u2tb9skUrCT Cg8RuldqrCUnYAW6tt/ymk3lAqYZEzdupDnWiSPqlkwjzRhxZtyT1x+7NlJ5HnUg7gM0 mqk5Seo+WgrDKohxmAvc3coMsAgRG9GQ4StHjk147LWka/T79gl3TZ/mQSuP7EcrtTMm wObwVUvYP7k79YfQoUYQYGWtZiMSeNR2E8DmYr0eJ85fHlKvCilATxr8Va7gI8mCHYtZ st9g== 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 1si48252480pfe.271.2019.08.06.02.38.56; Tue, 06 Aug 2019 02:39:12 -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 S1732519AbfHFJgu (ORCPT + 99 others); Tue, 6 Aug 2019 05:36:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:48414 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726713AbfHFJgu (ORCPT ); Tue, 6 Aug 2019 05:36:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2BE57AE2E; Tue, 6 Aug 2019 09:36:49 +0000 (UTC) Subject: Re: Let's talk about the elephant in the room - the Linux kernel's inability to gracefully handle low memory pressure To: Suren Baghdasaryan , Johannes Weiner Cc: "Artem S. Tashkinov" , LKML , linux-mm , Michal Hocko References: <20190805193148.GB4128@cmpxchg.org> From: Vlastimil Babka Message-ID: <398f31f3-0353-da0c-fc54-643687bb4774@suse.cz> Date: Tue, 6 Aug 2019 11:36:48 +0200 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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/6/19 3:08 AM, Suren Baghdasaryan wrote: >> @@ -1280,3 +1285,50 @@ static int __init psi_proc_init(void) >> return 0; >> } >> module_init(psi_proc_init); >> + >> +#define OOM_PRESSURE_LEVEL 80 >> +#define OOM_PRESSURE_PERIOD (10 * NSEC_PER_SEC) > > 80% of the last 10 seconds spent in full stall would definitely be a > problem. If the system was already low on memory (which it probably > is, or we would not be reclaiming so hard and registering such a big > stall) then oom-killer would probably kill something before 8 seconds > are passed. If oom killer can act faster, than great! On small embedded systems you probably don't enable PSI anyway? > If my line of thinking is correct, then do we really > benefit from such additional protection mechanism? I might be wrong > here because my experience is limited to embedded systems with > relatively small amounts of memory. Well, Artem in his original mail describes a minutes long stall. Things are really different on a fast desktop/laptop with SSD. I have experienced this as well, ending up performing manual OOM by alt-sysrq-f (then I put more RAM than 8GB in the laptop). IMHO the default limit should be set so that the user doesn't do that manual OOM (or hard reboot) before the mechanism kicks in. 10 seconds should be fine.