Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp532936ybi; Fri, 12 Jul 2019 00:15:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyokM8rsuDYwOeoHwnyGe9u7l2A9Weinl3btSH6yvxCxw4CXlNXrQswGqeg7nuB3tqfHK2K X-Received: by 2002:a17:90a:220a:: with SMTP id c10mr10053563pje.33.1562915733361; Fri, 12 Jul 2019 00:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562915733; cv=none; d=google.com; s=arc-20160816; b=XDW/Igr770aetevItHotibL4DYyBSN7EvvajUIalXcS2gI0vF9nwyJp/6CE81QPp36 KxA2mYcFVQwHIczy7QyhYxyoAV9nQ5nzXEhD9LFtHUypAJajY+Bae/P9mza1fDLEk/jH UTWmyacnhD9FDm79/fABVpYZdoC+l3ZnFa52k/Tpca5oLxAJ+hmLNl8nVekzMR2MAFJB 3JFsjoW80BiaTwJptinlAQTt0lyPN3sNEW4K2zbh5VSSXGuBhVk1IoT28dBbm6RbH+bW n872NmZ2vOFxrq71AOUNaTWxT0KCmvf06NxVo9a+tGgbPY30yGfh2sIrKD5+PYJ7dcXJ Z3Sw== 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=toxXyfFcENzhlGtfCwLXjsG4XsCPKy2Hcjp1RDAf030=; b=uIr0VBimx2s79w/YOGhhgrj3U81KJzzeQws/lEuLkHhU16siUJ9sgpAWwoNZ3U0He8 yUU7d6Mld1KstzWouBBYH4W42v49Ra9FNu2fZq/Z5xngFf+cgfiURIbBxoGkAB5MWvBJ uOSMxPyYODfIDtFgNAE9ukVEWWW4DEc5bcBFaH06RvRkG2ZuMfaLts5nPtRU5Km1SRcv zp6TqYDzSF33ODm9BcrpMXkQbSxHdxe9j2qfsXu4ytGsQhHRWvrCnXjwOJxxsU2WSVOM UCIw6M/ZlX8fLUW2kC+dLwF/ex9TPD/3oc5+gU/VF+i2aQVqAFtrE2sR8HSxhVYaJwCo wbzg== 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 s19si7598544pgm.291.2019.07.12.00.15.17; Fri, 12 Jul 2019 00:15:33 -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 S1726180AbfGLHOB (ORCPT + 99 others); Fri, 12 Jul 2019 03:14:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:49180 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726033AbfGLHOB (ORCPT ); Fri, 12 Jul 2019 03:14:01 -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 38EF9AC2D; Fri, 12 Jul 2019 07:14:00 +0000 (UTC) Date: Fri, 12 Jul 2019 09:13:59 +0200 From: Michal Hocko To: Kuo-Hsin Yang Cc: Andrew Morton , Johannes Weiner , Minchan Kim , Sonny Rao , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: scan anonymous pages on file refaults Message-ID: <20190712071359.GN29483@dhcp22.suse.cz> References: <20190628111627.GA107040@google.com> <20190701081038.GA83398@google.com> <20190703143057.GQ978@dhcp22.suse.cz> <20190704094716.GA245276@google.com> <20190704110425.GD5620@dhcp22.suse.cz> <20190705124505.GA173726@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190705124505.GA173726@google.com> 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 Fri 05-07-19 20:45:05, Kuo-Hsin Yang wrote: > With 4 processes accessing non-overlapping parts of a large file, 30316 > pages swapped out with this patch, 5152 pages swapped out without this > patch. The swapout number is small comparing to pgpgin. which is 5 times more swapout. This may be seen to be a lot for workloads that prefer no swapping (e.g. large in memory databases) with an occasional heavy IO (e.g. backup). And I am worried those would regress. I do agree that the current behavior is far from optimal because the trashing is real. I believe that we really need a different approach. Johannes has brought this up few years back (sorry I do not have a link handy) but it was essentially about implementing refault logic to anonymous memory and swap out based on the refault price. If there is effectively no swapin then it simply makes more sense to swap out rather than refault a page cache. That being said, I am not nacking the patch. Let's see whether something regresses as there is a no clear cut for the proper behavior. But I am bringing that up because we really need a better and more robust plan for the future. -- Michal Hocko SUSE Labs