From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57E82C48BE8 for ; Fri, 18 Jun 2021 17:09:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD95A613E2 for ; Fri, 18 Jun 2021 17:09:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD95A613E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 842DC6B0071; Fri, 18 Jun 2021 13:09:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 819426B0072; Fri, 18 Jun 2021 13:09:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6932D6B0073; Fri, 18 Jun 2021 13:09:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id 33B7F6B0071 for ; Fri, 18 Jun 2021 13:09:34 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BCEBCE0AE for ; Fri, 18 Jun 2021 17:09:33 +0000 (UTC) X-FDA: 78267481026.36.BE25BB3 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf04.hostedemail.com (Postfix) with ESMTP id 2D08A9A0 for ; Fri, 18 Jun 2021 17:09:33 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id o20so8045315qtr.8 for ; Fri, 18 Jun 2021 10:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4NOrwzxRJlcGICPYrhUba54bgGdQ7/VU92/Q3ir7evY=; b=lTO79RcKMGPliGX8pcleoEMngI6k/CwfeVJMXEyzDQKx1czuTjHNBfJjSOyag22fbM cbC6ZH0lwWDpXS3Up2fYwjFAiVdo5tigdUb2bCpdbswuNYk6JtPaiqLk2VNPcOJTTjj3 G7GLJDz4zE1mXtTC2rna8924cjBkSJzQ3zM0C3+6T8hHEJu1j9l7KTlNC83+Muo58oqa yWw/SmkPqoWLN8ZWdppvgzxakOB3mx4zxog3eOHeq//GX39iOsZ23S6tcEoJI9GLJsDU pepSvQcBKH1en2jXZGO2E8bOodjc2BJrPUM9cMXAu4I783iWxxhKa0hmSISOzCC2GvF0 mOvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4NOrwzxRJlcGICPYrhUba54bgGdQ7/VU92/Q3ir7evY=; b=XBlm0ofp3qi6N5xAOnkgcV4CUvVBKqrbTQNOcQs6gV0OelK+BYgcDHeUAWinE9M0ZO lFWgmT4PcPH25lClRwVjpDauxGinxgSGbykXrEWp3tzcLKdlTqeI8OrqtGJGsGdCaLFh CtHrlMPfj6h1886JNo2qL1tTSwX2n1F83UaHvqXO3+JB31J6hx/KX1TTku4b6dsGNfYk vUfYJSybzmaYau8+zrh20MZxvKhYnI7jNBce6CbUuvQc4bhNFWP2tLajcJfo6fA4nqab HsdScgVpUoQmpEv2BTQIoPMZDcIokEu1dlUMA/AlrFNMORKfICRM3Rpyz3gDc/1r0Oyy EWIg== X-Gm-Message-State: AOAM530TDhSoVQQDrpHmBSPJj9MWaLLCKR9EH+gWrsEJ/MkS8xu8Py0u y5vdc/JoO0CnooqCrx/jl1CPhg== X-Google-Smtp-Source: ABdhPJw4e+jfpVDo37iUkRBB/jk3NpOfIkAm19e9INoUu3m8YmPekAemW3VXjAuhd7KzOj9bG/XkOw== X-Received: by 2002:ac8:6641:: with SMTP id j1mr11458339qtp.103.1624036172483; Fri, 18 Jun 2021 10:09:32 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id u18sm5521044qta.38.2021.06.18.10.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 10:09:31 -0700 (PDT) Date: Fri, 18 Jun 2021 13:09:30 -0400 From: Johannes Weiner To: Andrew Morton 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: References: <20210614211904.14420-1-hannes@cmpxchg.org> <20210614211904.14420-4-hannes@cmpxchg.org> <20210615062640.GD2419729@dread.disaster.area> <20210616012008.GE2419729@dread.disaster.area> <20210616183043.cdd36c5ca6bee8614c609a90@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210616183043.cdd36c5ca6bee8614c609a90@linux-foundation.org> Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=lTO79RcK; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf04.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.173 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspamd-Server: rspam02 X-Stat-Signature: rc3syqoo9ijex7m4b7j7qtrbshdnzo1g X-Rspamd-Queue-Id: 2D08A9A0 X-HE-Tag: 1624036173-590041 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 16, 2021 at 06:30:43PM -0700, Andrew Morton wrote: > 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? It seemed to me the complaint was more about vmscan propagating this state into the inode in general - effecting fs inode acquisitions and LRU manipulations from the page reclaim callstack - regardless of whether they are open-coded or indirect through API functions? Since I mentioned better encapsulation but received no response...