Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5329696ybv; Tue, 11 Feb 2020 13:38:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxs+HG/EYhO2n/st13o6UH57S1XM9/Oysur6Q0DJQ53HbY23HcFSNhc9Xa+gWItDCSlJFq1 X-Received: by 2002:a54:4085:: with SMTP id i5mr4215511oii.17.1581457096453; Tue, 11 Feb 2020 13:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457096; cv=none; d=google.com; s=arc-20160816; b=ca51fee5JR/YcIRY5DXx5Yh9CIoKKKlsJyf7LFKCyavLxFkmfPkhAhItuh5IZeJEBu +6e0fKIvRMUU5NpkUohIHP6b5T+MLDe5LXfrjC1IH5tQkfhB+0X41Rh1y+zmJbzFDx2d 4nlAQygXNJxiX5MFAa++hxldwnhDEEfBsWXuvsjKGd+2H2HHKGWjlUup3T37MXvIIi6A p6Qbo38A8vjoXDWLS2Gq278q1cOS3l0ANnVcBf0Zyhd0m+htcxvPzeuSHwT/FXsw67MV 8DGBQc9gQSKLR2YC6DAuRwu3ciUuwwjTEgaK2cJErr/l81dnfubXUqMjrGgpWEIO3Nv+ WtvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=+KR5fbMkWBjRGjTqZqYzognn32rouKmiIWHV+65qLC4=; b=FE8v4u5+EENon0KFCCL777vonLQy9i80vyY7cL5cnw1ejwtm+7hEaPcU9Nj8OZcLRl Aw5F00wr8kVl2yjs8782v8hqObtbwaSnJ14+i4EfrufMVqfiQzku0KavEPUWqqNLeQwm ycSq5Gi6tQZtiNi8qT6PduXHSo1Z0AVZQKbEa14DIB9846xa7g4NRtIVeZCDUOezhy6p 65LuL+PksiyHpBGwwjMLjdQTSmv6AbbPtOzvnmhdjnL4l6Bjl+CZYwR/D2kd2bBZZQD6 RxkZU2pd/7WjG0fgiMxJ3kgMrrluK8MBmGkjditzLdyix//82xF6fWeRu3GYDonBnEM+ DO+w== 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 h18si2449422otj.114.2020.02.11.13.38.05; Tue, 11 Feb 2020 13:38:16 -0800 (PST) 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 S1729992AbgBKTGE (ORCPT + 99 others); Tue, 11 Feb 2020 14:06:04 -0500 Received: from shelob.surriel.com ([96.67.55.147]:58556 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728503AbgBKTGD (ORCPT ); Tue, 11 Feb 2020 14:06:03 -0500 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1j1ar4-0001St-CT; Tue, 11 Feb 2020 14:05:54 -0500 Message-ID: <29b6e848ff4ad69b55201751c9880921266ec7f4.camel@surriel.com> Subject: Re: [PATCH] vfs: keep inodes with page cache off the inode shrinker LRU From: Rik van Riel To: Johannes Weiner , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Dave Chinner , Yafang Shao , Michal Hocko , Roman Gushchin , Andrew Morton , Linus Torvalds , Al Viro , kernel-team@fb.com Date: Tue, 11 Feb 2020 14:05:38 -0500 In-Reply-To: <20200211175507.178100-1-hannes@cmpxchg.org> References: <20200211175507.178100-1-hannes@cmpxchg.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-be8J/gfsysm0dy6l7psF" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-be8J/gfsysm0dy6l7psF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-02-11 at 12:55 -0500, Johannes Weiner wrote: > The VFS inode shrinker is currently allowed to reclaim inodes with > populated page cache. As a result it can drop gigabytes of hot and > active page cache on the floor without consulting the VM (recorded as > "inodesteal" events in /proc/vmstat). >=20 > This causes real problems in practice. Consider for example how the > VM > would cache a source tree, such as the Linux git tree. As large parts > of the checked out files and the object database are accessed > repeatedly, the page cache holding this data gets moved to the active > list, where it's fully (and indefinitely) insulated from one-off > cache > moving through the inactive list. > This behavior of invalidating page cache from the inode shrinker goes > back to even before the git import of the kernel tree. It may have > been less noticeable when the VM itself didn't have real workingset > protection, and floods of one-off cache would push out any active > cache over time anyway. But the VM has come a long way since then and > the inode shrinker is now actively subverting its caching strategy. Two things come to mind when looking at this: - highmem - NUMA IIRC one of the reasons reclaim is done in this way is because a page cache page in one area of memory (highmem, or a NUMA node) can end up pinning inode slab memory in another memory area (normal zone, other NUMA node). I do not know how much of a concern that still is nowadays, but it seemed something worth bringing up. --=20 All Rights Reversed. --=-be8J/gfsysm0dy6l7psF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl5C+wIACgkQznnekoTE 3oO/IQgAl8ZKBW1n3o9BCqwLSqcu66jPS/q2dziIacDoXS3zW7ME3LAqluQa3Qen cN2+lPymRfObV9cUMHBd5Q8lZSPu4ABn/Vgp5I37pyA9WOgfC3yLVWvgbWIXn40u Rnl9TQn6TIsvZTY/3VD3MYrbry3Q87wrOrrUyRzeL7kZQ3s6njARKXrN44yN+ABf DirTGAH3PeBMd+JZNVT3yAGcp3EW1Oe2Fda99orpAh/kD7dKK1Gat/s2k0AwHvZz o3zhYqLbIi+4cNGj/g234KsMJpEfRwjZxVcsYaenm3qaWR4arNYV/5+M0lYsRNYK 8YRHaOQR5GDctvip88bDvdThWfDplw== =XJG5 -----END PGP SIGNATURE----- --=-be8J/gfsysm0dy6l7psF--