Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1407095rdb; Tue, 30 Jan 2024 18:56:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0IFtC3vxk4wGaKbSWAdxhxlpS7Kk99PpRJnEP3qBRybvf+ZGxmBFIKvS3/xsyhRJWx1aA X-Received: by 2002:a05:6a20:861a:b0:19a:30d9:b0b4 with SMTP id l26-20020a056a20861a00b0019a30d9b0b4mr265314pze.32.1706669775683; Tue, 30 Jan 2024 18:56:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706669775; cv=pass; d=google.com; s=arc-20160816; b=bifaGeB/ws88Bp/70Wa2ylBCPX7TxXmyoxpclIx7wqmefAnuond1kmS9AieQQNqRQ2 mW1Bcm4h/3oQJzhFKpaX0aYfUIs9WheyK/3bQrisTSPtS1wP+dzSfsy4YZwyjlFhdrse W6gjypYpPzE+kXn6Cv2FjCw04iLHtwfZPHxd0IQLsoOESjdfSoXkY3wBqJWB0XvL/S7p quvlgfvprRtLuoVWEUpnIQNgLxbTPQpHItTJfUDODazmchO2Y1eZHfLnjUU9WRdv197w NRJZYvEonksCWbVKPpVKuwBJbh3lCq+zDGb9FuFAbilQJS3pgMESVkxcyY0NBfRBdis4 LYmQ== 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; bh=Hrfb/n6ZOTCIrooBWZCWqo5ZO6oBNst73LpENqxcGZ0=; fh=iYW45eF14IgrKBQyC+Bsj8AuAz+/6V/jHd153tMdcWU=; b=op0EIqMM9AgX9QDD7jNpgZvva0+sXGo/B7xhyGKNzzbOUgJzrWmwfmw3joqNapeXUx NbiEAfeWHp7Gxd0MoqL5TqRGmbWu9mDQYNE5PYTIzmS8qbHDXgWPLSk2geU6S/4+3sCE MaERAUzGwSDT6UbCNSzLN/+zb7PBQuYgAEsNDCESMlouZnI5rJdwc3RkugIKb1ficU6c mTQ0DElcblILEIG6c+uN/iW3+5hirZuHhuS9X5yq1FmGZfex7yUMYNvlaBXBWZHvPmgd MQxfweE2rxCG9AunqKrlssBh/jPN1bgaM2p3Ov25XBX7Kw5JTTVQmEfbN4PlZMkheuT6 ozqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=ycQyGxYx; arc=pass (i=1 spf=pass spfdomain=fromorbit.com dkim=pass dkdomain=fromorbit-com.20230601.gappssmtp.com dmarc=pass fromdomain=fromorbit.com); spf=pass (google.com: domain of linux-kernel+bounces-45696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com X-Forwarded-Encrypted: i=1; AJvYcCWOcppqxMipNpHLd26QJ8P6ifkFqGGHXZI8OQXHPjjbhIwckKFPLG0lGnQDI5Nao93WyxKM48vLz77IIisNs0jNPilxSsk6/ano40w+EA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x15-20020a170902820f00b001d5cfb42818si8312455pln.642.2024.01.30.18.56.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 18:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=ycQyGxYx; arc=pass (i=1 spf=pass spfdomain=fromorbit.com dkim=pass dkdomain=fromorbit-com.20230601.gappssmtp.com dmarc=pass fromdomain=fromorbit.com); spf=pass (google.com: domain of linux-kernel+bounces-45696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 62E50B223AE for ; Wed, 31 Jan 2024 02:55:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F401CEAE4; Wed, 31 Jan 2024 02:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="ycQyGxYx" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 7CA24F505 for ; Wed, 31 Jan 2024 02:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706669695; cv=none; b=nu8qQU9N/gPWU5Z9DbBLH0i3DQWEdU14SGAJUDmZPmEqK/TOhsskKrwE56uTxnZD6/jAemnMwYiq4V2IXX7gpQb/k33oTtZsNRU368p5mBtMBvLlDSFQCV4+NXi9DfuYlHmhmgrLiGdjDJux92aqBq4fEtBIL1/NsoT3bH9Fg80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706669695; c=relaxed/simple; bh=LJ3udZSHrDCtqPTHKXcSvvFa8cnl3Jy+15O/rE0H2q0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c6ofGr7zh4KTgLdm1r7ipZdWYQVr9TQJdjJAFjiMDWPG39q3KnQZUfoAyoiuGylkTw7OgfqHVVLVFeCFaHy6bH/OTAIMBPKDaoOZdcbO2iMIAb0QhgoqZxuSM05+egusTOckMKIkzqRFJUNhsBM78MdYsejyqHRcPmkFJXl6Lgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=ycQyGxYx; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d8dd580f3dso14220575ad.3 for ; Tue, 30 Jan 2024 18:54:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1706669693; x=1707274493; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Hrfb/n6ZOTCIrooBWZCWqo5ZO6oBNst73LpENqxcGZ0=; b=ycQyGxYx3azh6mivxtRzofSJmPXKKxHVTq7j7HZ6BcIn5DtwmadJu4FPGYxx7X0QE8 gqAPFO1AElS6XqTtTsBUTignTb8e9i1NcRJh0W34rGAl68I/2AOdd5CNXzg/XN3EICHC aQkOj7XiAShXUlUAbgJBsm4gt1oYRshOMR8Wu3wUeTfw1kDTAsdDtCQoFFXRadK1Edft lI1eH7ILNp2hWf7zgRbDwT1+WZxhW0cfrWo8OCc9bM9zOc3hbzI/iaOwVgPvLk6E5iDa robIq9ZohxhyGOVmga2wagi1FdrZlD/kOzmEWIFBpZoQCiO9EdOi37ojpgu3kvAzduZh KrRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706669693; x=1707274493; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Hrfb/n6ZOTCIrooBWZCWqo5ZO6oBNst73LpENqxcGZ0=; b=e4agFpLtDHVIi0wq7ddUKjBdlmo9o+n1ZPej8jbyBiqzNQdcOVHq3zDCeVWyKj5gOn xYL18PO2Q0tPAn7bElv85jGUqydrPnyrS3Kg7K45WXOqq3sWnnS98xJ/3sszZjw/GpxO eAZFWB8uO8SzO8G0Aw0/87X9v344C9ZcnPETSJ2ZpR+twk1p1IS9pwpSJ1/czilLShid tEIzNgIYGYLp/eDXxBiT4w5QiPBnyvxcn+gy4JiT4LCcdkADJ9YxL8aVpxVUt4IkavR/ p60cayCT455/CMtMzAwxfi6zF+MTRuFZr+2TVDoO5THqxITr2a/p7jQ3UhDPUr98i/ZE g32A== X-Gm-Message-State: AOJu0YyhDQsuOTUo9tgjk0rKvz+4YJLJ3ct/u/odwe1yckZcXFo3QE1H sSRhUc0c2vIUP9mJ6+ZuSrj5/dvcd4k2n8PJjw61YVAIau6+FrIp2hkTd9fv1IY= X-Received: by 2002:a17:902:e748:b0:1d8:e5f3:3b88 with SMTP id p8-20020a170902e74800b001d8e5f33b88mr661552plf.64.1706669692809; Tue, 30 Jan 2024 18:54:52 -0800 (PST) Received: from dread.disaster.area (pa49-181-38-249.pa.nsw.optusnet.com.au. [49.181.38.249]) by smtp.gmail.com with ESMTPSA id a21-20020a170902ee9500b001d8d0666312sm5067490pld.126.2024.01.30.18.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 18:54:52 -0800 (PST) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1rV0kT-00HZps-2X; Wed, 31 Jan 2024 13:54:49 +1100 Date: Wed, 31 Jan 2024 13:54:49 +1100 From: Dave Chinner To: Mathieu Desnoyers Cc: Dan Williams , Vishal Verma , Dave Jiang , linux-kernel@vger.kernel.org, Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox , Arnd Bergmann , Russell King , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH v2 8/8] dax: Fix incorrect list of dcache aliasing architectures Message-ID: References: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> <20240130165255.212591-9-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240130165255.212591-9-mathieu.desnoyers@efficios.com> On Tue, Jan 30, 2024 at 11:52:55AM -0500, Mathieu Desnoyers wrote: > commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") > prevents DAX from building on architectures with virtually aliased > dcache with: > > depends on !(ARM || MIPS || SPARC) > > This check is too broad (e.g. recent ARMv7 don't have virtually aliased > dcaches), and also misses many other architectures with virtually > aliased dcache. > > This is a regression introduced in the v5.13 Linux kernel where the > dax mount option is removed for 32-bit ARMv7 boards which have no dcache > aliasing, and therefore should work fine with FS_DAX. > > This was turned into the following implementation of dax_is_supported() > by a preparatory change: > > return !IS_ENABLED(CONFIG_ARM) && > !IS_ENABLED(CONFIG_MIPS) && > !IS_ENABLED(CONFIG_SPARC); > > Use dcache_is_aliasing() instead to figure out whether the environment > has aliasing dcaches. > > Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") > Signed-off-by: Mathieu Desnoyers > Cc: Andrew Morton > Cc: Linus Torvalds > Cc: linux-mm@kvack.org > Cc: linux-arch@vger.kernel.org > Cc: Dan Williams > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Matthew Wilcox > Cc: Arnd Bergmann > Cc: Russell King > Cc: nvdimm@lists.linux.dev > Cc: linux-cxl@vger.kernel.org > Cc: linux-fsdevel@vger.kernel.org > --- > include/linux/dax.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/linux/dax.h b/include/linux/dax.h > index cfc8cd4a3eae..f59e604662e4 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > > typedef unsigned long dax_entry_t; > > @@ -80,9 +81,7 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > } > static inline bool dax_is_supported(void) > { > - return !IS_ENABLED(CONFIG_ARM) && > - !IS_ENABLED(CONFIG_MIPS) && > - !IS_ENABLED(CONFIG_SPARC); > + return !dcache_is_aliasing(); Yeah, if this is just a one liner should go into fs_dax_get_by_bdev(), similar to the blk_queue_dax() check at the start of the function. I also noticed that device mapper uses fs_dax_get_by_bdev() to determine if it can support DAX, but this patch set does not address that case. Hence it really seems to me like fs_dax_get_by_bdev() is the right place to put this check. -Dave. -- Dave Chinner david@fromorbit.com