Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5932550ybh; Wed, 7 Aug 2019 14:04:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqz79iyVv9w5ymnf7WFXtBQoTLMyGi15g2S9cCU22NUkq/R4m6n0T+s5mYA9tuxSf0SbK1+g X-Received: by 2002:a17:902:be12:: with SMTP id r18mr9549053pls.341.1565211861586; Wed, 07 Aug 2019 14:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565211861; cv=none; d=google.com; s=arc-20160816; b=hGIY3qWFbY5uCXaiRRBA9O1gbKqxJbB1rSPVgUXqykLLrnlIoCEwR9FzUpefmW9vue LUerujOm9fXq2IcmN2NCB/wl6iz4TLZz5scq4rrqSDANjvOAC+hlSSIJRKGazGpwPqD4 GPcPzmFzQO+Z9vo/abPzs04Z0Rt/VTQdXGx1TewyDoLqTavZQkrH+MAc+/cfDkSgY4uj s7B1DmMIXCDVezBf5RYWEd5iqzklkNfAU5TgEIDRXYPPUFLMGEAKCL+rkCsIZ69RrAhf 0IwGmYDvnxaZ5qJEVHFVgSNZzwsKPUKTNFn5uQfjV2EdKRIpQaHXYKrCS54o4uQlX1Ya ztNA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9Bqfh4I9+7QrHMf7ofuM1/JRfKOR22mvXehSEW2OYNI=; b=aTpeuB7XlXQKMe1rlE1ODwnRBpyHW5w7Rlcc0qYifJPoP3XtriH0QIkmPtTllL3fQn Qj86nCY7srsP66oFGFa7o/m8AEJS6OXuSor04XsdZtL7+8xdVvUt3dA2hBjdHCTvkH28 YVi5pN+UoZvPnqo9f/urwEy9H6Y3j/YFez90hfsvGUVVrU4FlCXqipS3AMGiOLaKOSKI hq9CBG0jtS06RNWYMBGaoD0ObjkG9N2pgxxUFm44jYRNVHBni2oNKrgcD77g9EcveGTP NOF/wn3VY6b8h8K9prk9Olr5Kukq+qxm7j+wpH6LYZKJUqub6yjlDHIJSYyN3ZOZQbrm mkIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oVKMpM2e; 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 q38si37041112pgk.63.2019.08.07.14.04.05; Wed, 07 Aug 2019 14:04:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=oVKMpM2e; 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 S1730182AbfHGVBc (ORCPT + 99 others); Wed, 7 Aug 2019 17:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:59286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729934AbfHGVBc (ORCPT ); Wed, 7 Aug 2019 17:01:32 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42E452173C; Wed, 7 Aug 2019 21:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565211691; bh=+qBbfBSMAH7Y3GHuWbe+rylHpzCgkxGkF76I78EmJxY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oVKMpM2eI1851tBovePX/3oFkhm0jedmWGpX0lOJRCyhVvcrHTCVgDWE9WFHNn1rP WFubGz9PQLZVC6YbI6q6EFc8Pfl349VJXeEIbnTNvRnETpfhuKci6P9uqPrkNuoWI2 OZaLmDlzO29vPnGG+m4zGuD1EldUfhdTABKXMH6k= Date: Wed, 7 Aug 2019 14:01:30 -0700 From: Andrew Morton To: Johannes Weiner Cc: Michal Hocko , Suren Baghdasaryan , Vlastimil Babka , "Artem S. Tashkinov" , LKML , linux-mm Subject: Re: Let's talk about the elephant in the room - the Linux kernel's inability to gracefully handle low memory pressure Message-Id: <20190807140130.7418e783654a9c53e6b6cd1b@linux-foundation.org> In-Reply-To: <20190807205138.GA24222@cmpxchg.org> 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> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Aug 2019 16:51:38 -0400 Johannes Weiner wrote: > However, eb414681d5a0 ("psi: pressure stall information for CPU, > memory, and IO") introduced a memory pressure metric that quantifies > the share of wallclock time in which userspace waits on reclaim, > refaults, swapins. By using absolute time, it encodes all the above > mentioned variables of hardware capacity and workload behavior. When > memory pressure is 40%, it means that 40% of the time the workload is > stalled on memory, period. This is the actual measure for the lack of > forward progress that users can experience. It's also something they > expect the kernel to manage and remedy if it becomes non-existent. > > To accomplish this, this patch implements a thrashing cutoff for the > OOM killer. If the kernel determines a sustained high level of memory > pressure, and thus a lack of forward progress in userspace, it will > trigger the OOM killer to reduce memory contention. > > 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. Could be implemented in userspace?