Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp42634pxj; Wed, 16 Jun 2021 19:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6foB07GRPne24Ur42wFn/E1ejAsv0PvOTXeZPMsnIkN8IqsxCagEZgi4N3X95dounQSgI X-Received: by 2002:a05:6402:1bd1:: with SMTP id ch17mr3471904edb.357.1623898009423; Wed, 16 Jun 2021 19:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623898009; cv=none; d=google.com; s=arc-20160816; b=Um0ykfVNLh/G5DbA6YKvPRD5TgEGRslaFVV1oa3FB33Im29/7mxVG7yGKohHFfYpD2 ekVKhAotLfyeMzFx/OqSjjf+afdlEnnEqF+9WTuajkzqeppNSWGDDdJJ8I5F/5BsTFfm fJwnc/kckGL96a6mPzYDC4yzQp63k/C2M2gFTIPIu82fFSIlnko5HC2mcNvsrRgQY+FS GFflZXlBBkiZ2rPUbzmCQUYMLF4JcVrK5pQHEONE2HcjgP6NHXmhVwCkO+fXnazWZyHk BX76oAWpwGbSzZOnDgCEs9od1end0Yr2La4QRg5OSWu+FxVb/bvkdURcDZvkBIX52QOa vMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=hxNjFhhyHs4169ktK8Qmq9obxiHmM9f6ZU6EUPzt+SU=; b=LHsDCmF8HN+WrtVRQ0kiVVN8kBzA55UPRp03XR62VP7GeJD9rVKqZKvOq2wG/5jnyC I3cay7N/SyUW8LnUCyWYrHkYAF7PwEUBr0rBrCD6UGaM+0f0fYpM0OpmvhnPXI0ev2Qh 8QPpvJIeCBx98oev7KeaEmq9tsr1pH5WrYtJJn43AfqkFrcQzerF0uYiryKkU/wHvoZv FkzjQL5qp2hr4xOnU4rWxm7fS0yfnmZxQK+I8HAlstCjUWcuNTQRit4dhvlv6LI0T2et oUK9YXprN3sAT5XlEN0odA4u4bqdEcMYKliwhT5QNLARxFp3hb4NeGsQ6wunfwdbaL2O Qb5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=w6VhJc4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si3981145ejd.372.2021.06.16.19.46.26; Wed, 16 Jun 2021 19:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=w6VhJc4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232090AbhFQBcx (ORCPT + 99 others); Wed, 16 Jun 2021 21:32:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:37468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbhFQBcw (ORCPT ); Wed, 16 Jun 2021 21:32:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E114613DE; Thu, 17 Jun 2021 01:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1623893444; bh=W0OF5R3t53yx4zub1670pkWGrC9nfpb1vIKuqiJaCh4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=w6VhJc4sSRYSgeu7Evu4pcjgqmgza4fFFpEAocIgswoG/i8H03pH+4tUPcm1QA6zY TUqV4M4q0XnpDTXsL3EEumxGeqMPeY40D7SQdUVHkuhZrzR3Ztoo0JosUiL+N5YCJW wbaJJwVAMhkcLHeBqab6NfnoBqK1quFSsuEycK4s= Date: Wed, 16 Jun 2021 18:30:43 -0700 From: Andrew Morton To: Johannes Weiner Cc: Dave Chinner , Roman Gushchin , Tejun Heo , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 4/4] vfs: keep inodes with page cache off the inode shrinker LRU Message-Id: <20210616183043.cdd36c5ca6bee8614c609a90@linux-foundation.org> In-Reply-To: References: <20210614211904.14420-1-hannes@cmpxchg.org> <20210614211904.14420-4-hannes@cmpxchg.org> <20210615062640.GD2419729@dread.disaster.area> <20210616012008.GE2419729@dread.disaster.area> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Jun 2021 00:54:15 -0400 Johannes Weiner wrote: > On Wed, Jun 16, 2021 at 11:20:08AM +1000, Dave Chinner wrote: > > On Tue, Jun 15, 2021 at 02:50:09PM -0400, Johannes Weiner wrote: > > > On Tue, Jun 15, 2021 at 04:26:40PM +1000, Dave Chinner wrote: > > > > On Mon, Jun 14, 2021 at 05:19:04PM -0400, Johannes Weiner wrote: > > > > > @@ -1123,6 +1125,9 @@ static int __remove_mapping(struct address_space *mapping, struct page *page, > > > > > shadow = workingset_eviction(page, target_memcg); > > > > > __delete_from_page_cache(page, shadow); > > > > > xa_unlock_irq(&mapping->i_pages); > > > > > + if (mapping_shrinkable(mapping)) > > > > > + inode_add_lru(mapping->host); > > > > > + spin_unlock(&mapping->host->i_lock); > > > > > > > > > > > > > No. Inode locks have absolutely no place serialising core vmscan > > > > algorithms. > > > > > > What if, and hear me out on this one, core vmscan algorithms change > > > the state of the inode? > > > > Then the core vmscan algorithm has a layering violation. > > You're just playing a word game here. Don't think so. David is quite correct in saying that vmscan shouldn't mess with inode state unless it's via address_space_operations?