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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25265C2BD09 for ; Thu, 27 Jun 2024 05:33:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A21CA6B0089; Thu, 27 Jun 2024 01:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D23E6B008A; Thu, 27 Jun 2024 01:33:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 899D16B008C; Thu, 27 Jun 2024 01:33:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6BC4D6B0089 for ; Thu, 27 Jun 2024 01:33:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF9A5161A7C for ; Thu, 27 Jun 2024 05:33:49 +0000 (UTC) X-FDA: 82275551778.30.8E8C7F7 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf22.hostedemail.com (Postfix) with ESMTP id 43CE9C000D for ; Thu, 27 Jun 2024 05:33:48 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719466409; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=17J4myQawGFHRs4H4O+jzAZnomyGV0XkhBIdKFzfeqY=; b=XoTRDn0hGHMpw5CyIXIe3HnJ7swtoJwc5zs6hzffymbagHSoMW+inZ7bxTCUfLL/5ncn9X A9T1irGQ7r/R6tzF1U/tZPXqjkCKPLyMyDbnOkP808SN9sFt1C8XU6LPK8iWGk1UevzbLL UsJtIp2aJxqvB0wn8G7X9SzDk2/h5o8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719466409; a=rsa-sha256; cv=none; b=oyiU8XSuxDIiceB5YSjjyCcd9DnRzH9Pw6ddUCzlD8+Z1vU6wtwwfRk1dHd6o3ibwl3Tcb nI1Anlh7wypHEoeJOCRfPql5IDUJafaArlcLo1Ndu6XZsbDYUFm4UDaXi5iJZMBeOqc17J JhroudV4VR3uobF1WyHQeQ5VwG9jkG4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 1840168C4E; Thu, 27 Jun 2024 07:33:44 +0200 (CEST) Date: Thu, 27 Jun 2024 07:33:43 +0200 From: Christoph Hellwig To: Alistair Popple Cc: dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com Subject: Re: [PATCH 04/13] fs/dax: Add dax_page_free callback Message-ID: <20240627053343.GD14837@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 43CE9C000D X-Stat-Signature: bn8jtzdbwosxc653fsj3tsc8q4s9ntzs X-Rspam-User: X-HE-Tag: 1719466428-688964 X-HE-Meta: U2FsdGVkX1/IhMmSj5wVreJbJ+CUda5KnZC0fcVjh8lm01VMp3AgxsOfCQL1N1KboaBNMN0czTMhcYqJfoGzOetjO4gb+LdFq0B9v1Q/ehECdFHO03nSqUcgh8p4ezITp+EmfvX9BNHbQa7dqFIsZRRsbcG7+5DG891AQAZ88PbDjLO8f+8FrQ+razI+ehvFiXqvq36Z8iPI2vP0FU7rA0CJLFk5vKuTao2rWNWkzoF4DA1kIHkIdxq/lHCM1/EBKCWn8vXwtmra0Qc7kfqXYlslekAVZlNjj6+9zrQsZ+IRx1C/XyO5R4aJ5cTixjrmUU7mp49weoiUyL4PYOEHP+EFimyr8EJjZK4njum0JxBNf2DlJB4Oo8LWEgUR1SIa9cM3ulgI+9whtFugCA1x27qERHUD5gsT39lPVpVmkALaCgvUUWCpVynuFRuAhvic+JPKVYmMppzcL9nzVn6C8+u6DT8bQAxBFkqLiR0awbRnW8wcLdUCx012PossEfNXCLVp0K+OFdF71X7RRxzJgjuveVsEPKCEv7yI/J4aXxJRbmZz+e5ui2vkFVSIyM+UOwKiMrKWjxs9BRit7mDC8rp+V00S9DMeMZGNLzYGWx55xQKdvxBWpU5M5yLl2eJMeUqsGi/z+ygoAMd+bicnAVixo4P77eOlfw5mKjrK+T/fux4Fxzp9E81s+KMu944nddEMWxUiFsQ6hbpR77PIwxuXgEjMJlBXZuHm6L1pj7y7dntXFiBZGmwFLGhNMtMakbPeApuwooBCnbSJskdl++O7HsGsnJJCMJBTaHBk/7ep3SGWFZMlJzRcE+PF1NECD2NRE8p6qXDTmuTyDJUtFifePTqZqtS/mV1F/zhnN1m/fPaFvZo4rAuyoGchSV/gbhqCxl5kTqKOfP4oChAtISBoVqkNiBXO4X5Adk1goGv3nDjxOnMjYC/X3dCAgCXHO9uFlioqai3kJUR7ymy 1RIB0kCH 0ndMjLhf85o0R1LvikTcvhmskIJTbmGNXxcv3iW+oGO6hDVlXI1gyTuPn/bjn7c57wifp9Z7mStTJwKFxA/66wssqiv3GCHEiet2YMoSKqMSt3obsdfutSQqH1w== 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: List-Subscribe: List-Unsubscribe: On Thu, Jun 27, 2024 at 10:54:19AM +1000, Alistair Popple wrote: > When a fs dax page is freed it has to notify filesystems that the page > has been unpinned/unmapped and is free. Currently this involves > special code in the page free paths to detect a transition of refcount > from 2 to 1 and to call some fs dax specific code. > > A future change will require this to happen when the page refcount > drops to zero. In this case we can use the existing > pgmap->ops->page_free() callback so wire that up for all devices that > support FS DAX (nvdimm and virtio). Given that ->page_ffree is only called from free_zone_device_folio and right next to a switch on the the type, can't we just do the wake_up_var there without the somewhat confusing indirect call that just back in common code without any driver logic?