Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbdIOLzk (ORCPT ); Fri, 15 Sep 2017 07:55:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44596 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184AbdIOLzj (ORCPT ); Fri, 15 Sep 2017 07:55:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 121A281DEA Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=zkabelac@redhat.com Subject: Re: Detecting page cache trashing state To: Taras Kondratiuk , linux-mm@kvack.org Cc: xe-linux-external@cisco.com, Ruslan Ruslichenko , linux-kernel@vger.kernel.org References: <150543458765.3781.10192373650821598320@takondra-t460s> From: Zdenek Kabelac Organization: Red Hat Message-ID: <20733be8-6038-434f-c50f-0a57616ebe47@redhat.com> Date: Fri, 15 Sep 2017 13:55:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <150543458765.3781.10192373650821598320@takondra-t460s> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 15 Sep 2017 11:55:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2010 Lines: 47 Dne 15.9.2017 v 02:16 Taras Kondratiuk napsal(a): > Hi > > In our devices under low memory conditions we often get into a trashing > state when system spends most of the time re-reading pages of .text > sections from a file system (squashfs in our case). Working set doesn't > fit into available page cache, so it is expected. The issue is that > OOM killer doesn't get triggered because there is still memory for > reclaiming. System may stuck in this state for a quite some time and > usually dies because of watchdogs. > > We are trying to detect such trashing state early to take some > preventive actions. It should be a pretty common issue, but for now we > haven't find any existing VM/IO statistics that can reliably detect such > state. > > Most of metrics provide absolute values: number/rate of page faults, > rate of IO operations, number of stolen pages, etc. For a specific > device configuration we can determine threshold values for those > parameters that will detect trashing state, but it is not feasible for > hundreds of device configurations. > > We are looking for some relative metric like "percent of CPU time spent > handling major page faults". With such relative metric we could use a > common threshold across all devices. For now we have added such metric > to /proc/stat in our kernel, but we would like to find some mechanism > available in upstream kernel. > > Has somebody faced similar issue? How are you solving it? > Hi Well I witness this when running Firefox & Thunderbird on my desktop for a while on just 4G RAM machine till these 2app eat all free RAM... It gets to the position (when I open new tab) that mouse hardly moves - kswapd eats CPU (I've no swap in fact - so likely just page-caching). The only 'quick' solution for me as desktop user is to manually invoke OOM with SYSRQ+F key - and I'm also wondering why the system is not reacting better. In most cases it kills one of those 2 - but sometime it kills whole Xsession... Regards Zdenek