Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp224529lql; Fri, 12 Apr 2024 08:33:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqoYT28/OIypPiUdMXuS8CSyqc5BeTxi/4LkRE97wBp8ECnGxk7kABfwGP38CtXV5EIOh/U9sabhAEafjbegBm4MAROjSMnGsw0MIfHQ== X-Google-Smtp-Source: AGHT+IEcI31sWGFOYodcM4ehovEL+FAwWOVe98vRCKbaoyciNU7uijTe5ht4H0R0SIh5HQ+IKwhL X-Received: by 2002:a17:906:2c59:b0:a4e:768a:1445 with SMTP id f25-20020a1709062c5900b00a4e768a1445mr1742079ejh.16.1712935982925; Fri, 12 Apr 2024 08:33:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712935982; cv=pass; d=google.com; s=arc-20160816; b=eaRp4NAJTBgNcsVhDJC3BjHRfYxK/P+FCT5/f4WbC+5CRfPfhozq6Y85MV9UHVm+HV Xx3mTw2GQInDwVLZcH0fk/hHyKA0wHbicVXzQGeANmn7yVTrYNyviTRxsjTrrlbUBast TERhtV64bHZp4UyQpGOo/N3XpOZtUZT6KvqGlgZs8AuNVH0GIrj+pryxeSbePcTYrFId 3PdALhQ6FrzFYwdTsI86vmRYC4a0CmF7vBmInPwSRIN6tQ8P/a8JA1dkQXGMhXyl0qrL AR7dMiapVpCiWmfzAeIRemUwxZHdUVzqCmSIZuts3QM0pC60o0q8FVad/Ys8gAbPk5vA FlFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=IC6E9bO8ytOyXP9Gha3+QfcN0HdacgeeixK9ev2ZVE4=; fh=8ocBxFdkTFRK7HudFzz16wMcEnhqj/Bu6yBeLBwZxm0=; b=m6p3/rCySvAURKTNuiomD4dwhKjv0UufDiTxmxnh/pLXV4519shBFH+nfJ47KqNFEl RH84R1q7O2Ga9lqN4ncRPIA9xcE0fm227luCTPLp5ZwEo/mG6cc7EGrNuiGdVBb43kg+ Jm1XXXKYvpDFnYypmxJHhKoDA6QbSwr6R4vptosXAIFp8N4iE2HIoWnLNtXl0WUR+NDU kmcGcZ9fcTP1/ez5DfdNrflAK6whZwu+jG3OUgoJaQrLFYtlUebaASZjtBlRAtwtg9yo gI8XV6AZhkiUtbLn9DejfGce33P6ZthOq9rEyWDF5iAFPyL05WtUetOAcyFyfsSTqpuL CB7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dHfLhXt+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=7oESxyKH; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dHfLhXt+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-ext4+bounces-2064-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2064-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hd18-20020a170907969200b00a51930774a4si1914836ejc.615.2024.04.12.08.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 08:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2064-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dHfLhXt+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=7oESxyKH; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=dHfLhXt+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-ext4+bounces-2064-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2064-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0EEAB1F26E12 for ; Fri, 12 Apr 2024 15:23:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5D8F148FF4; Fri, 12 Apr 2024 15:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="dHfLhXt+"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="7oESxyKH"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="dHfLhXt+"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="7oESxyKH" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6120B14883A; Fri, 12 Apr 2024 15:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712935334; cv=none; b=UJ3dBWz4Q2h5SMhHurkq1GHW226fKui3NvZFDcdWwVfp+AreCfHgw5VLsuMJxlqhYczR6bxY0xr4JVkt3fzP1lD//pJluXFYkXEmY3Sq5iQW2rQ2j9UZ8VwRE5wK58SLiJ0zEt7hzeW6XnAq29DnIv1HcYL9sqEj+vPF9nT/rzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712935334; c=relaxed/simple; bh=BvHPHN8fOa7EW5Y5iMhwD3d+SLjl19jOc6gJ/tU9ku4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pE2zs4jRXS2eB3CS2HCp7s3TaBcs8SHFhLNynb5zFuDsChLU5eUARip+Ta2cnQI4Zw/KKUTi2ZWZCzTy9hT4BUygN2NNxJHdh7Z2c9FivhLHp5YTbEybapbkJp/bDQ6WW1V7SxTUTda+sfLuA5P10MbXnRQfEyivqtDACm5YPWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=dHfLhXt+; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=7oESxyKH; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=dHfLhXt+; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=7oESxyKH; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A8CE338405; Fri, 12 Apr 2024 15:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712935328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IC6E9bO8ytOyXP9Gha3+QfcN0HdacgeeixK9ev2ZVE4=; b=dHfLhXt+oafE8lHfYHjX6le7winvuajKwY05JhjjVbNfZCkhHc9ZKQ0RJvCbA+dWjvBNw3 LPvedgvHiGpR464a2sQUo7rILDyyOq95ZAFaYuJesGafOpuRDIM51OTUW8/mzTq365buJa P9IIQknnm088ShJgoRrO142ub13XIF4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712935328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IC6E9bO8ytOyXP9Gha3+QfcN0HdacgeeixK9ev2ZVE4=; b=7oESxyKH6MgNpHewLYE5ihQlUjAOKGGynQJ/OGqt3k0zupKvXDFBOmtcf185gBClkKbm4U P86WYmrj8CAfDoCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712935328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IC6E9bO8ytOyXP9Gha3+QfcN0HdacgeeixK9ev2ZVE4=; b=dHfLhXt+oafE8lHfYHjX6le7winvuajKwY05JhjjVbNfZCkhHc9ZKQ0RJvCbA+dWjvBNw3 LPvedgvHiGpR464a2sQUo7rILDyyOq95ZAFaYuJesGafOpuRDIM51OTUW8/mzTq365buJa P9IIQknnm088ShJgoRrO142ub13XIF4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712935328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IC6E9bO8ytOyXP9Gha3+QfcN0HdacgeeixK9ev2ZVE4=; b=7oESxyKH6MgNpHewLYE5ihQlUjAOKGGynQJ/OGqt3k0zupKvXDFBOmtcf185gBClkKbm4U P86WYmrj8CAfDoCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 977D01377F; Fri, 12 Apr 2024 15:22:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qVT4JKBRGWa1BAAAD6G6ig (envelope-from ); Fri, 12 Apr 2024 15:22:08 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2B0A8A071E; Fri, 12 Apr 2024 17:22:08 +0200 (CEST) Date: Fri, 12 Apr 2024 17:22:08 +0200 From: Jan Kara To: Alistair Popple Cc: linux-mm@kvack.org, david@fromorbit.com, dan.j.williams@intel.com, jhubbard@nvidia.com, rcampbell@nvidia.com, willy@infradead.org, jgg@nvidia.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, djwong@kernel.org, hch@lst.de, david@redhat.com, ruansy.fnst@fujitsu.com, nvdimm@lists.linux.dev, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, jglisse@redhat.com Subject: Re: [RFC 04/10] fs/dax: Don't track page mapping/index Message-ID: <20240412152208.m25mjo3xjfyawcaj@quack3> References: <322065d373bb6571b700dba4450f1759b304644a.1712796818.git-series.apopple@nvidia.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <322065d373bb6571b700dba4450f1759b304644a.1712796818.git-series.apopple@nvidia.com> X-Spam-Flag: NO X-Spam-Score: -3.80 X-Spam-Level: X-Spamd-Result: default: False [-3.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[18]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_LAST(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,nvidia.com:email] On Thu 11-04-24 10:57:25, Alistair Popple wrote: > The page->mapping and page->index fields are normally used by the > pagecache and rmap for looking up virtual mappings of pages. FS DAX > implements it's own kind of page cache and rmap look ups so these > fields are unnecessary. They are currently only used to detect > error/warning conditions which should never occur. > > A future change will change the way shared mappings are detected by > doing normal page reference counting instead, so remove the > unnecessary checks. > > Signed-off-by: Alistair Popple ... > -/* > - * When it is called in dax_insert_entry(), the shared flag will indicate that > - * whether this entry is shared by multiple files. If so, set the page->mapping > - * PAGE_MAPPING_DAX_SHARED, and use page->share as refcount. > - */ > -static void dax_associate_entry(void *entry, struct address_space *mapping, > - struct vm_area_struct *vma, unsigned long address, bool shared) > -{ > - unsigned long size = dax_entry_size(entry), pfn, index; > - int i = 0; > - > - if (IS_ENABLED(CONFIG_FS_DAX_LIMITED)) > - return; > - > - index = linear_page_index(vma, address & ~(size - 1)); > - for_each_mapped_pfn(entry, pfn) { > - struct page *page = pfn_to_page(pfn); > - > - if (shared) { > - dax_page_share_get(page); > - } else { > - WARN_ON_ONCE(page->mapping); > - page->mapping = mapping; > - page->index = index + i++; > - } > - } > -} Hum, but what about existing uses of folio->mapping and folio->index in fs/dax.c? AFAICT this patch breaks them. What am I missing? How can this ever work? Honza -- Jan Kara SUSE Labs, CR