Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3505173ybl; Mon, 12 Aug 2019 01:25:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ3K1NEBqGZDEmeUHieuFhBE54bEKE34rm2/eYYx+GClu/dKHJUxb9cT6cqjOkF25JkHg2 X-Received: by 2002:a17:902:4401:: with SMTP id k1mr31825785pld.193.1565598307116; Mon, 12 Aug 2019 01:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565598307; cv=none; d=google.com; s=arc-20160816; b=0slt/Ahq2eRzKVEzz0gUXWfVtfzOFGVzDATkAkKAZr0ltrFHeX56pMnjDEprdy76wd lDVXZCEE2LwNHI5+4Bb0D9p8H4DsvMEZ5XPcIqHbY6408/qHj+KKMW3tK2hbyHrf6OGi Je9g6VEpkeqCrzxbEohLzSgnvaJPIDbVtQgBbb0tMB+FkXoOv+6aLOjsNo8YzHiCUw7h 5tDGBzeMP9BLZQITS/7s+JUjS4R7qCeboAbZmoF4Lu5O91qeh7BqMjxjKOagAyaG6P7d CTUAOBrR3I3/i2GxaYpDKulNJ3kAsk2SHOetuPpC7G1ZGapfzra+z30jlj5lpkBRo/gs e7TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PM9hqvW6ARmiDL0X0m1bRq5ttIJLKpQaXgtX9X62/N8=; b=F4sLDSumAmGhSY3vUV2ZYjnh3ImwQXuNUgzGo0UgJGbZL1FGwf+rI3hCavP29A3fbr Q+wl3EiNK2gduQa3BPzIgpEG5VdtoFTjenQA3SK7qjJPECRZLl7mPbJ+qKpf24r136Kr BAq6Zo9JfQrGdwW2FF68x/RMLXxj+KADyFRIx/zYFBpNQhqnGZfDqH49lVypdu5x2NL7 OVr2ivK3bMQ5TTU7rvVggrK1Wtfh8sO3KcOpOYA17kjsXOV/ynCQnP8vO19KSEKT8fAq vxA3FirYeXmsBUny93vDaom6Legx1n8X1aFoEkCisSXqdQ4ghz3L2Ffw6LiAJuckM4Dn gnJw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k192si63428119pge.222.2019.08.12.01.24.50; Mon, 12 Aug 2019 01:25:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbfHLIYP (ORCPT + 99 others); Mon, 12 Aug 2019 04:24:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:45330 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726834AbfHLIYP (ORCPT ); Mon, 12 Aug 2019 04:24:15 -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 1D034AE04; Mon, 12 Aug 2019 08:24:14 +0000 (UTC) Date: Mon, 12 Aug 2019 10:24:11 +0200 From: Michal Hocko To: ndrw Cc: Johannes Weiner , Suren Baghdasaryan , Vlastimil Babka , "Artem S. Tashkinov" , Andrew Morton , 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: <20190812082411.GB5117@dhcp22.suse.cz> References: <20190808114826.GC18351@dhcp22.suse.cz> <806F5696-A8D6-481D-A82F-49DEC1F2B035@redhazel.co.uk> <20190808163228.GE18351@dhcp22.suse.cz> <5FBB0A26-0CFE-4B88-A4F2-6A42E3377EDB@redhazel.co.uk> <20190808185925.GH18351@dhcp22.suse.cz> <08e5d007-a41a-e322-5631-b89978b9cc20@redhazel.co.uk> <20190809085748.GN18351@dhcp22.suse.cz> <20190809105016.GP18351@dhcp22.suse.cz> <33407eca-3c05-5900-0353-761db62feeea@redhazel.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33407eca-3c05-5900-0353-761db62feeea@redhazel.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 10-08-19 13:34:06, ndrw wrote: > On 09/08/2019 11:50, Michal Hocko wrote: > > We try to protect low amount of cache. Have a look at get_scan_count > > function. But the exact amount of the cache to be protected is really > > hard to know wihtout a crystal ball or understanding of the workload. > > The kernel doesn't have neither of the two. > > Thank you. I'm familiarizing myself with the code. Is there anyone I could > discuss some details with? I don't want to create too much noise here. linux-mm mailing list sounds like a good fit. > For example, are file pages created by mmaping files and are anon page > exclusively allocated on heap (RW data)? If so, where do "streaming IO" > pages belong to? Page cache will be generated by both buffered IO (read/write) and file mmaps. Anonymous memory by MAP_PRIVATE of file backed or MAP_ANON. Streaming IO is generally referred to by an single data pass IO that is not reused later (e.g. a backup). > > We have been thinking about this problem for a long time and couldn't > > come up with anything much better than we have now. PSI is the most recent > > improvement in that area. If you have better ideas then patches are > > always welcome. > > In general, I found there are very few user accessible knobs for adjusting > caching, especially in the pre-OOM phase. On the other hand, swapping, dirty > page caching, have many options or can even be disabled completely. > > For example, I would like to try disabling/limiting eviction of some/all > file pages (for example exec pages) akin to disabling swapping, but there is > no such mechanism. Yes, there would likely be problems with large RO mmapped > files that would need to be addressed, but in many applications users would > be interested in having such options. > > Adjusting how aggressive/conservative the system should be with the OOM > killer also falls into this category. What would that mean and how it would be configured? -- Michal Hocko SUSE Labs