From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50C4BC2D0DB for ; Wed, 29 Jan 2020 13:39:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1817F20716 for ; Wed, 29 Jan 2020 13:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1817F20716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9F70E6B0007; Wed, 29 Jan 2020 08:39:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 980BA6B0008; Wed, 29 Jan 2020 08:39:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 848766B000A; Wed, 29 Jan 2020 08:39:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 6A1136B0007 for ; Wed, 29 Jan 2020 08:39:14 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1B503181AEF09 for ; Wed, 29 Jan 2020 13:39:14 +0000 (UTC) X-FDA: 76430778228.08.week91_16592ad395b50 X-HE-Tag: week91_16592ad395b50 X-Filterd-Recvd-Size: 4700 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Jan 2020 13:39:13 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id m16so585895wrx.11 for ; Wed, 29 Jan 2020 05:39:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vE+ko0jkzj6Lve0C3jdFO6gm18AMHVx8Agu7z400EkI=; b=fJHVdEwbkrXveyEg8kFqbq2200r/vBA7gDWslDL0x4NowuIBRP3/N0uAMlxjGr9Lem Qf/E4TVEuuWKuD5gZLO+wNc88CzkN+TgneIQd24K4xFVUtcPAX0KSi2WwDIcQVVzpBW6 fyfySkKQPmetzVo8vJQs7OqBYEVai+OiYz1JBEhq9RIL9gcu5Wm/Q/pjp1qdvv9h6zCG vwDhd2WjYDPXYQDl/+ZbvTpeQ1A3ojEtx05kNX7X59WRuze3Mnp2zO2qzjA5+uEqUIvJ +mCoDRUZdLMN7eB6iiS4VWtrDRf1Mm+3jWl8dMAh2JOGxefdiJnN5UR5EZuWa7UQc+XI WOTA== X-Gm-Message-State: APjAAAUI5XRljtSJO+VlHXZLqaTp+cCpc9jcbayW7ZdFjIN4R3oWb3CO jVtIKcjEbeqcGsI/N5trU52Be3+O X-Google-Smtp-Source: APXvYqzYbtIYV0GsDFTuXJi//qhxaU1Ch0AAHPt7UrF1+wwZXw0ABYi72B4EtwERB2HHGgIzq0YFfw== X-Received: by 2002:a5d:4602:: with SMTP id t2mr34027757wrq.37.1580305152487; Wed, 29 Jan 2020 05:39:12 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id a13sm2893733wrp.93.2020.01.29.05.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 05:39:11 -0800 (PST) Date: Wed, 29 Jan 2020 14:39:11 +0100 From: Michal Hocko To: Chris Edwards Cc: Johannes Weiner , "linux-mm@kvack.org" Subject: Re: Paging out when free memory is low but not exhausted (and available memory remains high) Message-ID: <20200129133911.GM24244@dhcp22.suse.cz> References: <20200123123127.GK29276@dhcp22.suse.cz> <1579844599463.32567@otago.ac.nz> <20200124100423.GP29276@dhcp22.suse.cz> <20200127100646.GA203985@cmpxchg.org> <1580181722920.30551@otago.ac.nz> <1580187538078.61819@otago.ac.nz> <1580195997590.47770@otago.ac.nz> <1580297769621.48601@otago.ac.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1580297769621.48601@otago.ac.nz> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 29-01-20 11:36:09, Chris Edwards wrote: > Following the idea that it's some interaction with the X server, I further noticed that switching out of X to a text virtual console makes the page-outs stop. Going back to the X VT, the page-outs resume. > > I've attached another set of vmstat logs for the following timeline: > > 1580290800 System is running Xorg, stress to limit memory, and dd to exercise the buffer cache, with constant page-outs > 1580290810 Switch to a text virtual console - page-outs stop > 1580290830 Switch back to X VT - page-outs resume > > I'm vaguely suspecting something to do with the way Xorg handles old-fashioned programs that do CPU-driven bitmap-based rendering, as my desktop does typically have a lot of these (urxvt instances, xosview, the Notion window manager itself) - maybe they cause some particular pattern of memory churn in the X server, and perhaps only with certain video drivers...could Xorg perhaps wrongly madvise() the kernel about certain memory? It seems notable that having glxgears should cause the page-outs to stop. > > However, even a minimal X session with a sakura or qterminal window seems to show some degree of needless page-outs with low memory and busy cache, though not as severe - however, it's difficult to avoid observer effects! There did seem to be a notable pattern of increasing swap utilisation when switching away from the X VT, and a drop in swap utilisation when switching back to X. > > Should I perhaps take it up with the Xorg people instead? It is quite possible that those GUI applications are over allocating and talking to Xorg people might give you some hints how to pursue debugging in that direction. >From the MM kernel POV it is still very interesting to find out why the anonymous memory is evicted while there is a lot of clean page cache. I didn't get to look at your recent vmstat data though and will vanish on vacation during the weekend. Can you somehow simplify your test so that it is clear what is the allocation pattern and less components are interacting? -- Michal Hocko SUSE Labs