From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755297AbdDRHMA (ORCPT ); Tue, 18 Apr 2017 03:12:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:41627 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754217AbdDRHL5 (ORCPT ); Tue, 18 Apr 2017 03:11:57 -0400 Date: Tue, 18 Apr 2017 09:11:53 +0200 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Johannes Weiner , Mel Gorman , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, vmscan: avoid thrashing anon lru when free + file is low Message-ID: <20170418071153.GC22360@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 17-04-17 17:06:20, David Rientjes wrote: > The purpose of the code that commit 623762517e23 ("revert 'mm: vmscan: do > not swap anon pages just because free+file is low'") reintroduces is to > prefer swapping anonymous memory rather than trashing the file lru. > > If all anonymous memory is unevictable, however, this insistance on > SCAN_ANON ends up thrashing that lru instead. Why would be the anonymous memory unevictable? If the swap is depleted then we enforce file scanning AFAIR. Are those pages pinned somehow, by who? It would be great if you could describe the workload which triggers a problem which you are trying to fix. > Check that enough evictable anon memory is actually on this lruvec before > insisting on SCAN_ANON. SWAP_CLUSTER_MAX is used as the threshold to > determine if only scanning anon is beneficial. > > Otherwise, fallback to balanced reclaim so the file lru doesn't remain > untouched. Why should we treat anonymous and file pages any different here. In other words why should file pages check for high wmark and anonymous for SWAP_CLUSTER_MAX. [...] -- Michal Hocko SUSE Labs