Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2471115ybh; Mon, 9 Mar 2020 06:35:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPuc+fQp4uDuMA3+ZD1cRzSAKbsb5htGj+YsCpWn2SAOMtqjtvTLTjh1Zp/IqkxpVGCype X-Received: by 2002:a05:6830:4b1:: with SMTP id l17mr5192132otd.275.1583760913330; Mon, 09 Mar 2020 06:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583760913; cv=none; d=google.com; s=arc-20160816; b=VrSq7DI5NYLXVQ3rBP6hy7AHxf3CuHQdUZW9w5c5KeKoQm+LjwZfOIIvx50Csuthbi 9B4mhC3okL2RHPixLig2taNC8U+uM6ivNtbSQ2VIE4fvENXcHXQza/ae2LHSmAmniKpi XenuTR+gdTUXJ1hTcHi8zX5n8iImTr1HACjQseBiHWLkNzO1IxDvHGwru1T0uh/Uxj7m Pkvk+lm04bg+H3bmaGbk8/A4eG8EDVi5XHOqjXW1tRoqRXxs3h2ZUWGz87BKjs3I1sxQ WWO3ZGqxGNLzpM6OfUx+Jaygs6QZz8eMqmPZnNlZFZDiOed1kKb1r1lhAclDHbm8Cj/P mW7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=mBkoofexayvc80D+b8CRvELGfMIVe/vAbbaCvGmi7/A=; b=tbU5O4nzCCHgv/FURylPGXBpudMfeycfKJ3vvUxG5JHQv6ZOW/AlklbMgQZgIgpvmy pPn/LRPIISwLDgRy5edefG1fSXRYNLsoIq3MFq9EwGgbF6zPwID/Jni7JyBkwwATeQ4H J6SiOe5XpLX0fV2riu3tTr6ctYMUAAa+SnZ12dGnJX4iDgql+AuCTUJQC62Myz74LKRX z9McKzbkjl1Q4sbEj/iFERHJEx8XH57+OIVqvY/xkq5JR9L0wJbrCKKfJOCsJrqLT5VG Zq9tD01qcq1vfn4xAFhCFci5VjbBWJViWCTDtWm3reDY1xld49JLH3GpclvFkuHB+fnl +Uaw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si6350556ote.187.2020.03.09.06.34.58; Mon, 09 Mar 2020 06:35:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbgCINdq (ORCPT + 99 others); Mon, 9 Mar 2020 09:33:46 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:53183 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbgCINdq (ORCPT ); Mon, 9 Mar 2020 09:33:46 -0400 Received: from mail-qv1-f53.google.com ([209.85.219.53]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1Mft3h-1jrX2P2EMT-00gDOE; Mon, 09 Mar 2020 14:33:44 +0100 Received: by mail-qv1-f53.google.com with SMTP id m2so4309429qvu.13; Mon, 09 Mar 2020 06:33:44 -0700 (PDT) X-Gm-Message-State: ANhLgQ2cGAClHxhhKYxLdxfmsD+WXhy1WPw1CGiz4PpyJrVPFMQhm1vZ gxUOAsFjnRqYkKxWoVVmtYkFkSBzVSkA5bYA5zg= X-Received: by 2002:a0c:f647:: with SMTP id s7mr14720813qvm.4.1583760823316; Mon, 09 Mar 2020 06:33:43 -0700 (PDT) MIME-Version: 1.0 References: <20200211164701.4ac88d9222e23d1e8cc57c51@linux-foundation.org> <20200212085004.GL25745@shell.armlinux.org.uk> <671b05bc-7237-7422-3ece-f1a4a3652c92@oracle.com> <7c4c1459-60d5-24c8-6eb9-da299ead99ea@oracle.com> <20200306203439.peytghdqragjfhdx@kahuna> <20200308141923.GI25745@shell.armlinux.org.uk> In-Reply-To: <20200308141923.GI25745@shell.armlinux.org.uk> From: Arnd Bergmann Date: Mon, 9 Mar 2020 14:33:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU To: Russell King - ARM Linux admin Cc: Nishanth Menon , Santosh Shilimkar , Tero Kristo , Linux ARM , Michal Hocko , Rik van Riel , Catalin Marinas , Santosh Shilimkar , Dave Chinner , Linux Kernel Mailing List , Linux-MM , Yafang Shao , Al Viro , Johannes Weiner , linux-fsdevel , kernel-team@fb.com, Kishon Vijay Abraham I , Linus Torvalds , Andrew Morton , Roman Gushchin Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:4Uk+eoxAdYLQYHRtietrYb/hTUc9UW68fZ0BAFbzJwMndYqTN4Y sTOPub1ZgVM71gXs3eC8FIDH0TINzzRgwsAbaNrajuJNM8rOOm+L5YzOyby0c2wyVccUHbS wvM2hT/dKoAJqHTNDktPnQmeRsPrd0uzzuqgJFJeAKkD+5iv7Er0Bp9nXGMn5MPodnNyptz gPERQcI/KqH3hodQSIklQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:H87OSnfdRG0=:3Huc2lYEQZdXcoQyysvwu/ MAAnJcFQsh7prCScZjCUCeiKCR14VSlb333panzZgcBxJAD2uCYrcZlk855x/hV/CoJY3jB5S PIbzwXAPWyb0iWqwH6ASOSNT8CduNHk3JQqdF5HWk7jhvHblMPjltBtU2PzToD7HhYgSOMjI7 Hn9ttSzzgQARATgxNtTmzDCmc91V4u84BSf6NRle04a8gvGmFU76fxdXk71UGDLSRhpQa3clg GqRxgn8w4TxBCmGZX6slaYcyHYKqe77Jdb1xYXAcuVVnMGqyWcYfsQaHdwpOnZLjIhmhGKKK2 /CbUu1MaRoat9o16AMShuyB+vYAqTcONL2pFPtW0+BUtAK7ZDl5IsaZv+/YgFpjo/MVAAKQTT R5Q2TF3c9b1n6kbWYNWGYo3mMjjcQIjf16meh9Hx+oMEdl5w+kPH5T269PZ1GvL2b9UJPMoDK 0+SdJZyP5Bgedn2COyuPlunE6Kyg1Oq4bslI4U48OyO7M4DKUFcEXrNfZRtzQT5YAUU9u9MTU 1eOuRu894Wc2tlJzylqH0lvsG6QZsukyJ5ZwcSN/JPMEVpdStFgfSQneRiGrOoI8aERZAS6ak JdSgN+jsLsO+M7m/G9qoDIFP8qH9V6KP0m0BGuPRszLZlUZgaKTVKY+6O4pNzetH97w9rIoAD 9ugEDpjccUr6wYECB76ZMdz1oSDdEYN0AePLPptxXIN5Oxwu+fOJVZUDXngIPrOSqPRvY4VBU +8rcPB4kJUA1r+HMyJjBivMwSPNM3+lIvUXOt/pjpURU8Hb6wrbU90B3YN3NiWKvdsKpCalGo 7XVzyBzrmdDtDpJKubwKCqqB5Q03xmGDsnypK3l5VBB5Eukits= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 8, 2020 at 3:20 PM Russell King - ARM Linux admin wrote: > On Sun, Mar 08, 2020 at 11:58:52AM +0100, Arnd Bergmann wrote: > > On Fri, Mar 6, 2020 at 9:36 PM Nishanth Menon wrote: > > > On 13:11-20200226, santosh.shilimkar@oracle.com wrote: > > > - extend zswap to use all the available high memory for swap space > > when highmem is disabled. > > I don't think that's a good idea. Running debian stable kernels on my > 8GB laptop, I have problems when leaving firefox running long before > even half the 16GB of swap gets consumed - the entire machine slows > down very quickly when it starts swapping more than about 2 or so GB. > It seems either the kernel has become quite bad at selecting pages to > evict. > > It gets to the point where any git operation has a battle to fight > for RAM, despite not touching anything else other than git. > > The behaviour is much like firefox is locking memory into core, but > that doesn't seem to be what's actually going on. I've never really > got to the bottom of it though. > > This is with 64-bit kernel and userspace. I agree there is something going wrong on your machine, but I don't really see how that relates to my suggestion. > So, I'd suggest that trading off RAM available through highmem for VM > space available through zswap is likely a bad idea if you have a > workload that requires 4GB of RAM on a 32-bit machine. Aside from every workload being different, I was thinking of these general observations: - If we are looking at a future without highmem, then it's better to use the extra memory for something than not using it. zswap seems like a reasonable use. - A lot of embedded systems are configured to have no swap at all, which can be for good or not-so-good reasons. Having some swap space available often improves things, even if it comes out of RAM. - A particularly important case to optimize for is 2GB of RAM with LPAE enabled. With CONFIG_VMSPLIT_2G and highmem, this leads to the paradox -ENOMEM when 256MB of highmem are full while plenty of lowmem is available. With highmem disabled, you avoid that at the cost of losing 12% of RAM. - With 4GB+ of RAM and CONFIG_VMSPLIT_2G or CONFIG_VMSPLIT_3G, using gigabytes of RAM for swap space would usually be worse than highmem, but once we have VMSPLIT_4G_4G, it's the same situation as above with 6% of RAM used for zswap instead of highmem. Arnd