Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp766309pxb; Thu, 15 Apr 2021 06:12:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZvwYiG7q9DX1xMyaA/5Iomi1kCC/LQ5qS9B0e+PUe8q7W0WHJsHCRr2MZjr4xhOXXZCDA X-Received: by 2002:a7b:c0c4:: with SMTP id s4mr3189066wmh.184.1618492353720; Thu, 15 Apr 2021 06:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618492353; cv=none; d=google.com; s=arc-20160816; b=rFxwZFdeXvcW/c7R3KjMtbCpN4aDsH2l+Tda7sVUYoKaR8VgSBfV0bbegR5xnh0m2h e7TnaedP5dIAXJcsHN0ENZ0BsytKtqU57e1qWgiq7Cl5ucs2lvNLll+n2O1SJN4tgbZv pNuY0e8XsY1IjodjqZ3KoOZR+poV1BDGhh0bwJZBf0Wsxp0iQuX9OrUvHkTyfGyLTWrl OKab+21Yn5DieYiNXvT3GqCST7l6rA9tb+08BKBo5QC5cdIVesI24aWdpfIwlYUyODsA 0O0qMjbicPV33ijzfVF4i6bpYXRQyJadHQSz38DqkCjbA+l+X9uXqtgaR+XUYAB2C6xY JBRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Qsjv0go7Rx6Dv4blzLuzEwan+gwGID8UxjwL3XMFmNo=; b=MWoxBPh0yZmN/hAN0yhAgKn1HZK+Kn14UKYZxO9zB0pJwqzyuU17bO0xrrBMUN3ygI Kt6PnzWHG4hYIgHO3VOBx2MzsZrq8JDa5r6bYhe6z2wNtmgQiSeXGrI5aIuMr3trV3XH FKA44QDMBurxLTcmo3h96u3yA3OltXsHAftc1nxD7OJpeed0ApDVPOcwOqX9j/+4I0oT XjYVBGIrv329/VzN9dGh9Xrm+Ggikw5A/2CyGhtX7dxyhKvg0hStO92b+icLoAEXZ9cg MeuN3GG1iS/8am+jmlCaICrug2UL6GsBfjonZOa/r+zX9G7rdv2FKx41mI5S26d8m1ia cwrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 i26si2079200ejc.496.2021.04.15.06.12.07; Thu, 15 Apr 2021 06:12:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbhDONMY (ORCPT + 99 others); Thu, 15 Apr 2021 09:12:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:49510 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbhDONMX (ORCPT ); Thu, 15 Apr 2021 09:12:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5A1CCB062; Thu, 15 Apr 2021 13:11:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1E24F1F2B65; Thu, 15 Apr 2021 15:11:59 +0200 (CEST) Date: Thu, 15 Apr 2021 15:11:59 +0200 From: Jan Kara To: Dave Chinner Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, Ted Tso , Christoph Hellwig , Amir Goldstein Subject: Re: [PATCH 2/7] mm: Protect operations adding pages to page cache with i_mapping_lock Message-ID: <20210415131159.GA31418@quack2.suse.cz> References: <20210413105205.3093-1-jack@suse.cz> <20210413112859.32249-2-jack@suse.cz> <20210414000113.GG63242@dread.disaster.area> <20210414122319.GD31323@quack2.suse.cz> <20210414215739.GH63242@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210414215739.GH63242@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 15-04-21 07:57:39, Dave Chinner wrote: > On Wed, Apr 14, 2021 at 02:23:19PM +0200, Jan Kara wrote: > > Regarding the name: How about i_pages_rwsem? The lock is protecting > > invalidation of mapping->i_pages and needs to be held until insertion of > > pages into i_pages is safe again... > > I don't actually have a good name for this right now. :( > > The i_pages structure has it's own internal locking, so > i_pages_rwsem implies things that aren't necessarily true, and > taking a read lock for insertion for something that is named like a > structure protection lock creates cognitive dissonance... > > I keep wanting to say "lock for invalidation" and "lock to exclude > invalidation" because those are the two actions that we need for > coherency of operations. But they are way too verbose for an actual > API... > > So I want to call this an "invalidation lock" of some kind (no need > to encode the type in the name!), but haven't worked out a good > shorthand for "address space invalidation coherency mechanism"... So "invalidate_lock" was just next on my list of things to suggest so I'm fine with that name. Or maybe block_invalidate_lock, block_remove_lock, map_remove_lock, ... Dunno :). Honza -- Jan Kara SUSE Labs, CR