Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1402211rdb; Tue, 30 Jan 2024 18:40:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEg6XY4/S92rmsUaU0I2E/Kjdsj0is4sgKAro+UBKIGk3p0p89dNqEhR/7v0bp2wUd8wXv X-Received: by 2002:a81:ae41:0:b0:5ff:7dd8:26cc with SMTP id g1-20020a81ae41000000b005ff7dd826ccmr172937ywk.22.1706668836649; Tue, 30 Jan 2024 18:40:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706668836; cv=pass; d=google.com; s=arc-20160816; b=C3w2WpQSv/sLTJ1BhIntDYAU6faUVcnHw8qP8m3ygHqXxRwYvPmJDgbdOVm+mjHOSx HjK1+54Tbnhtx4dIgJrQvLlvN5yQl53WZ2B6a5Rt+BoV4N0FKWrwt4x4D/vC5kPUSiEN El3iCy2UxTE8nK0kPNpf0W/MNVCrQ3hRXx26ccYJWihHo4L5ZdIBbJi0KoCfolxyga7a xPjKVb5yM9CsiHrgkrLZNqr35dCp4t+e2jb1dPQhzFCu/mRceB3saiz2B8FT1watOBtn kJd6ewDboFtsI+W88HcHvUTjKj8xTWZmK1wzEuoqorZsSESsl7ayNDQk9yffM6jSYxbG pJfg== 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=N09f6sJYKv0DgOi8MMLVMh039rU6+gfv4wN0Iyy6R6U=; fh=kJZMX1orc4s8vWDi3zXzIbV3zhL7ayyGdCkCkalwr4E=; b=kYP0L3BD/m0T//DIvKR0hs0uaCZV6vRScgF4loMMd3gU7btIUbaPQxEXkC84JC1VRO KrSbrPCpicYRx06k22PbfSaz5yr38AMIEe7CoukBYj+jMMlrcF3kWq12F2u6nbue32yf JqTmmH3VjBO6R+PZNkiMN44lbqn9UHmZALg8Gc4+ubl+5c+pJRGm6T3jmCqPZgXMKduv IQy6ryD2uWEBzgU6ifBvCxYsNj8fLvhrEpeUKckWD47bm2KVRERk4Og598EwvVaXVtPS mvJF412EcAGUrTTCb6KGBvs71AL85V4KkPxVbU4jRrrqlGU4lQayVQKvF8c9P03t9X+2 z+xg==; 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=T+7vMyUI; 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-45682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45682-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; AJvYcCXbAhwePs5hELjgOGQfIznFCipt1oCXzT+1jnhm+k2Ds83bgQQoACXrEnZmaiRKLOag7hkJZAv4z6cMlx978gu4c0d1Eojnfw4dHS8VBA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o25-20020a656159000000b005d8e2f778cesi2243870pgv.525.2024.01.30.18.40.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 18:40:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=T+7vMyUI; 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-45682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45682-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AD44728A4E4 for ; Wed, 31 Jan 2024 02:38:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C48B810793; Wed, 31 Jan 2024 02:38:15 +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="T+7vMyUI" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 16D59EAD7 for ; Wed, 31 Jan 2024 02:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706668694; cv=none; b=Czm9jR35m45KHHUskiYZv0rUClROqe7PfhS5aCn5eDwURPNjB5Hh5d/KAoIeqbxx8Hl3ua4F+wl+BtvhkPkIhy6BHJYidcilNOlakjOW6t9BcBJwyclrbM4kZodQny57XjI86DhtiHdVEjm5CyOhYsL86LOSMbCuRVuhknWw/P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706668694; c=relaxed/simple; bh=21EOOfDX3QJoscC3qTFj1I2tpuBsaPAwtHgQo7BYlrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LLPtD9uGBvjE5kdB9tFs4PzUZWbHO3iyEhe10nQzc3qZDKCSFuOf9IJ4ROXGVHFxjDiDYmjXkQfioZ0Nr53lKd/692zG4nmqTBC84vA+IGExclizJYHLHtrPrzYFwrKivJKgfxtOKaOtw9TAFoTlB9eqNqLMoFjRXLX13ddPWJQ= 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=T+7vMyUI; arc=none smtp.client-ip=209.85.215.177 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-pg1-f177.google.com with SMTP id 41be03b00d2f7-53fa455cd94so3062887a12.2 for ; Tue, 30 Jan 2024 18:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1706668692; x=1707273492; 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=N09f6sJYKv0DgOi8MMLVMh039rU6+gfv4wN0Iyy6R6U=; b=T+7vMyUIekK+cUz7XMlUFvbCCVjJleYNMUkn8aBSOLTx3BQ52R+7u9PwnmerOieDGU tPxAFx7w79H2e3MxtCGNNCVd2mQmuaYmyihYrWqZvri/5CtgQDUFP5lNjfE8gI/nfCrT 4GFdQTQLh8kKTQMJjmdXghWJYv1kbl5bdG0A81RKsiZZjwGrPyX73Ql3mguDw2b6SpNm LEwvJr28f1MoMWtbRklgbsJk7jwr9m/f56xPZ8ZK/+BSrEwWLrFudVef0E2zRBc2UQUV 0Gmacbrb7SFAqzZ/+2yANTbFb6oYTwk8Hmf5PFkXeCo+sy5ueNNc4COTjkF8OprEwf04 ESWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706668692; x=1707273492; 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=N09f6sJYKv0DgOi8MMLVMh039rU6+gfv4wN0Iyy6R6U=; b=Saip2o7eXrJvvGweOfsOnEtL0MVaHjZA1a1V+pxidReveG2Nkm0escg+/C5zoh4yz7 /T2H487dyHMnvVOzUPG3vPcpJmdZiJu92GoJD05Xiqfcxd2rB3UlVWu0StPRQVS0cQ0V I/YplGfWbufyDdF2shnoF1IgDcxo9RxhJi40yKOWTxOY8fMjLN17BztfRJIeITvNgnlC zLI43IWRPiYgULpgbHbtdHUD3TjV4Xk5WDuAuWp9ch190v1QHgkigg3MR3ERgP3TYW0W fgJDC94jPTpKyV5An439OhZGnHOXFqDvWwhvuEvo0x0AkmndDYoB7jYyDEFjZmov+vBa PAhQ== X-Gm-Message-State: AOJu0Yy6d7g5BIlcBMmjzJQ/frn4Vqho2tMAIwdYNXUGLi/6GgN+ZdNw YE6qLHfI2GZODtxzSW+Gb4+zeagfhpOQc17wGGlfCm1mS8IU0DtXxxLZg6GEE5E= X-Received: by 2002:a17:902:ea0a:b0:1d7:199:cfc5 with SMTP id s10-20020a170902ea0a00b001d70199cfc5mr484297plg.117.1706668692197; Tue, 30 Jan 2024 18:38:12 -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 b4-20020a170902d88400b001d706e373a9sm7935517plz.292.2024.01.30.18.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 18:38:11 -0800 (PST) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1rV0UL-00HZeK-17; Wed, 31 Jan 2024 13:38:09 +1100 Date: Wed, 31 Jan 2024 13:38:09 +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 1/8] dax: Introduce dax_is_supported() Message-ID: References: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> <20240130165255.212591-2-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-2-mathieu.desnoyers@efficios.com> On Tue, Jan 30, 2024 at 11:52:48AM -0500, Mathieu Desnoyers wrote: > Introduce a new dax_is_supported() static inline to check whether the > architecture supports DAX. > > This replaces the following fs/Kconfig:FS_DAX dependency: > > depends on !(ARM || MIPS || SPARC) > > This is done in preparation for its use by each filesystem supporting > the dax mount option to validate whether dax is indeed supported. > > This is done in preparation for using dcache_is_aliasing() in a > following change which will properly support architectures which detect > dcache aliasing at runtime. > > 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 > --- > fs/Kconfig | 1 - > include/linux/dax.h | 10 ++++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/fs/Kconfig b/fs/Kconfig > index 42837617a55b..e5efdb3b276b 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -56,7 +56,6 @@ endif # BLOCK > config FS_DAX > bool "File system based Direct Access (DAX) support" > depends on MMU > - depends on !(ARM || MIPS || SPARC) > depends on ZONE_DEVICE || FS_DAX_LIMITED > select FS_IOMAP > select DAX > diff --git a/include/linux/dax.h b/include/linux/dax.h > index b463502b16e1..cfc8cd4a3eae 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -78,6 +78,12 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > return false; > return dax_synchronous(dax_dev); > } > +static inline bool dax_is_supported(void) > +{ > + return !IS_ENABLED(CONFIG_ARM) && > + !IS_ENABLED(CONFIG_MIPS) && > + !IS_ENABLED(CONFIG_SPARC); > +} Uh, ok. Now I see what dax_is_supported() does. I think this should be folded into fs_dax_get_by_bdev(), which currently returns NULL if CONFIG_FS_DAX=n and so should be cahnged to return NULL if any of these platform configs is enabled. Then I don't think you need to change a single line of filesystem code - they'll all just do what they do now if the block device doesn't support DAX.... -Dave. -- Dave Chinner david@fromorbit.com