Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3406680imm; Tue, 17 Jul 2018 04:27:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf79zkjGc2tyKVnV/YASUCIvNZfZDuZJ7pYFKeHljuTV0hRwSSRc+ltqzg/qLsYiJeueqHW X-Received: by 2002:aa7:84cf:: with SMTP id x15-v6mr285467pfn.220.1531826848946; Tue, 17 Jul 2018 04:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826848; cv=none; d=google.com; s=arc-20160816; b=aHy+gEL90nSz+JUV1ktT5sGgHsxRUGySdfs2zK14akapWQDDlUNHPxY6CmDR1rydOM YZUz2NII+IvupVubnvra0UOx64vzz0QHDWwyhwNr2L1gXi09Dvuw+KgeonpqFIQwRHuj gj/g8t4iE+Hd0gmjQA4MZH4UKYU/msvd1/pa7cnnxuuvGtb3FtlvDPrBPjM6u/1q9wwq jRAlpYCAdZi9BlK0+ZYaSBZUEKWJhG+ibO1JdV2pNHBu96SuqqSiWtyOcHh5cE0mKaIZ sN1606D3ZA1yJvBu4g6i/JaixFQhtXkAgjqNoCD/r1UHIgPnu1JCVZP+Gos6OCSj0b0J IgMw== 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:arc-authentication-results; bh=JkJLeVTN3W23JHOxNDLxw/oJuyubyeePxvkqx2+P374=; b=jSHmjfqdLgEXelHlWjHMW586cqwKBHNmJn7/0DwWvNs0Z0y48zK21Kvybv9mz7AyCC Jo6Cc4sR2/U71eT685FN8srL8B966OFA6IqKMMBO9tcvfUY+xLJRDqHpI9tBrzzZTRa/ gljukny7+FIvk7dYIrqGI1CPwQAwcX3yBCfvS/txah0exb0XGWw29YuUX9W2a65HXSHk Lr4jT2eQdbno23VH0OdRyT+9Wk5qDqbIN31zya9HnQbV+o3gxmxF3O9jM+wD4US7t170 x044sSQsOuhOzXHnX5cS82XkJvhfN/ly7ZEm0DQ1bx2sy6U++JReqHRcUk68yJDyxZ+k FUlQ== 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 y34-v6si635716plb.317.2018.07.17.04.27.13; Tue, 17 Jul 2018 04:27:28 -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 S1731542AbeGQL53 (ORCPT + 99 others); Tue, 17 Jul 2018 07:57:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:38616 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731256AbeGQL52 (ORCPT ); Tue, 17 Jul 2018 07:57:28 -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 3CDD6ADB3; Tue, 17 Jul 2018 11:25:16 +0000 (UTC) Date: Tue, 17 Jul 2018 13:25:15 +0200 From: Michal Hocko To: Daniel Drake Cc: hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux@endlessm.com, linux-block@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andrew Morton , Tejun Heo , Balbir Singh , Mike Galbraith , Oliver Yang , Shakeel Butt , xxx xxx , Taras Kondratiuk , Daniel Walker , Vinayak Menon , Ruslan Ruslichenko , kernel-team@fb.com Subject: Re: [PATCH 0/10] psi: pressure stall information for CPU, memory, and IO v2 Message-ID: <20180717112515.GE7193@dhcp22.suse.cz> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180716155745.10368-1-drake@endlessm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180716155745.10368-1-drake@endlessm.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 16-07-18 10:57:45, Daniel Drake wrote: > Hi Johannes, > > Thanks for your work on psi! > > We have also been investigating the "thrashing problem" on our Endless > desktop OS. We have seen that systems can easily get into a state where the > UI becomes unresponsive to input, and the mouse cursor becomes extremely > slow or stuck when the system is running out of memory. We are working with > a full GNOME desktop environment on systems with only 2GB RAM, and > sometimes no real swap (although zram-swap helps mitigate the problem to > some extent). > > My analysis so far indicates that when the system is low on memory and hits > this condition, the system is spending much of the time under > __alloc_pages_direct_reclaim. "perf trace -F" shows many many page faults > in executable code while this is going on. I believe the kernel is > swapping out executable code in order to satisfy memory allocation > requests, but then that swapped-out code is needed a moment later so it > gets swapped in again via the page fault handler, and all this activity > severely starves the system from being able to respond to user input. > > I appreciate the kernel's attempt to keep processes alive, but in the > desktop case we see that the system rarely recovers from this situation, > so you have to hard shutdown. In this case we view it as desirable that > the OOM killer would step in (it is not doing so because direct reclaim > is not actually failing). Yes this is really unfortunate. One thing that could help would be to consider a trashing level during the reclaim (get_scan_count) to simply forget about LRUs which are constantly refaulting pages back. We already have the infrastructure for that. We just need to plumb it in. -- Michal Hocko SUSE Labs