Message ID | 20240129210631.193493-5-mathieu.desnoyers@efficios.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp832919dyb; Mon, 29 Jan 2024 13:08:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEn7rIdqFfhBbrZIuV07f7oysSO+6rbtB48rAKI0m/hGwZpvwiCJ8Ezs9ACZ65KV4hPdpkv X-Received: by 2002:a50:a6d9:0:b0:55f:3c6c:61ce with SMTP id f25-20020a50a6d9000000b0055f3c6c61cemr14144edc.37.1706562488982; Mon, 29 Jan 2024 13:08:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706562488; cv=pass; d=google.com; s=arc-20160816; b=g6hd03z31RDuF9XhCLD34RGGWyF7isP7a3pA40EdTUdHpC1nA7H8SJZ9HqNCKL3EIB 42A8ouswWw0W0wLqaAlUBsHDYSPHxWEzmBnroc14Ylt3I6pETcRDlAIGeQYojIGcmClz 8c20oy/k8OWVWqYlAptspeVM6bqDcF4ufv4bBio7H+noAzdzSwbtJykAPDd/BRBnmcdM CWrpJNm2xlhp9EA9e5dDM+u9ag6ja8fwm3hbeH8oA5pVSn+bTp0o0w6HZd10EYuv4hvM yRjQSblRYQnBKV1o9j/3FvPe23R0yLYFKIjbXVz1DEqaf1qIdPCx+LnauetaPMUaHHbz qs7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dypInAl1n7QK+131yjCz8IF0LXkByyP7w+CtsaKfsNo=; fh=zuGQkOnDZxSqtiyoxGAQvPjLn1yWOr6hcW+FgiTiIlM=; b=Ykbd7wAGr1/X+IHbX+JJhseedAyptyo5LeueMPEIu5jQo0g9Xk0xiHwZZ/G/g7jMuY pJt1xkMNgZTD/C/L/hifRMUU7M8sEr/ZturuuZuor9WOpJvB0mhpLWUAmbAP3rwJO2SZ ynlb2ciNe7jIRSLxZqNnd+muJz+DdrkqSmyqkUZXHp5Ne25D7X6LnT5DI4OlohPUcDCv zFkfuEOFTtTMzQKjCXsE5V+ZzHHaTjFr+j9YqlLUUDJCa+yYVFfHYvhhqgmK96kPe8ra +37Ic18VtxKTi4pXry4kWPfOeJyZaNha5lPJRev68vbKg2WS5/sYKrRfho4EiqcWD5D/ aBPw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=ZWoyjvOU; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fe3-20020a056402390300b0055c54f69cddsi3788600edb.540.2024.01.29.13.08.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 13:08:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=ZWoyjvOU; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43501-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 989771F25A40 for <ouuuleilei@gmail.com>; Mon, 29 Jan 2024 21:08:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF36B15AAA9; Mon, 29 Jan 2024 21:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="ZWoyjvOU" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 741DA157E72; Mon, 29 Jan 2024 21:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706562413; cv=none; b=YirjOv4koDJYCbaNhyahLl5OyNVwpE0JxG59e/nGE7NYIspQdxR5pPCMbGhf7BLpeEXxNSWgQ2uJ2SF4GvkrX3sq7s9fkaLl3XxToDEAz0Jrbau0Aquyrc2ulSPspWo4MKLC9rcqY//skr9db9ccrjIrgXhaJ8xSRAJypwW0t9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706562413; c=relaxed/simple; bh=huTRzi08F0C7MipcdwWe4Ussu/u99HDe6usjofLClk8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pdH8ZxBjF459CKT+NL7owV6R+YPjRHYFgdT8WO2mtfqEfDccKE36H44qqCmfxDtCyCmZA+Y5UjJ2FL1hsm9yKYG+IVnnSPtZkv3Exlb0L/xEzIfxfHihj+xNUgc1YqDbNYc9hGvIJiG8GBezDnHSNIG3zkB5IdgvhOa0mmccfBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=ZWoyjvOU; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706562410; bh=huTRzi08F0C7MipcdwWe4Ussu/u99HDe6usjofLClk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWoyjvOUAKRorOkBf1VRCuUe3muZT9Jazkxz9NgPX6vA5tHzdv9fZAMvOwYQUQFS/ ykyGlVWSZVdQ0AmTeMSrDjJkEHWdN1z2Rkg+mdr/4zNt3mUu8G59Y1UA3dQ176ZmpR XNnmvuPAdpd+gxgklREaTW4KM1V+5TYa9+K78amLQzWaxBqWfXKQpPUZi200cIw2Ld Z3msxyPrO6jmtz8APzkLg3rQ9tiibW5MVa2+hL9owNVSrTbGjPvM2VkNg7OI3Jte1b FXwljb10nWNnW/XdQvOwCcgvrIynWSjuNs5CGDe0uL9fagDqdafBZW/LVhSU2RA7Ha tXwBGOdG23nsA== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TP17t2bfzzVJ6; Mon, 29 Jan 2024 16:06:50 -0500 (EST) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Dan Williams <dan.j.williams@intel.com>, Vishal Verma <vishal.l.verma@intel.com>, Dave Jiang <dave.jiang@intel.com> Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Jan Kara <jack@suse.com>, linux-ext4@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox <willy@infradead.org>, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org Subject: [RFC PATCH 4/7] ext2: Use dax_is_supported() Date: Mon, 29 Jan 2024 16:06:28 -0500 Message-Id: <20240129210631.193493-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129210631.193493-1-mathieu.desnoyers@efficios.com> References: <20240129210631.193493-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789460468631955478 X-GMAIL-MSGID: 1789460468631955478 |
Series |
Introduce cache_is_aliasing() to fix DAX regression
|
|
Commit Message
Mathieu Desnoyers
Jan. 29, 2024, 9:06 p.m. UTC
Use dax_is_supported() to validate whether the architecture has
virtually aliased caches at mount time.
This is relevant for architectures which require a dynamic check
to validate whether they have virtually aliased data caches
(ARCH_HAS_CACHE_ALIASING_DYNAMIC=y).
Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Jan Kara <jack@suse.com>
Cc: linux-ext4@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-mm@kvack.org
Cc: linux-arch@vger.kernel.org
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: nvdimm@lists.linux.dev
Cc: linux-cxl@vger.kernel.org
---
fs/ext2/super.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Comments
On Mon 29-01-24 16:06:28, Mathieu Desnoyers wrote: > Use dax_is_supported() to validate whether the architecture has > virtually aliased caches at mount time. > > This is relevant for architectures which require a dynamic check > to validate whether they have virtually aliased data caches > (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). > > Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") > Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > Cc: Jan Kara <jack@suse.com> > Cc: linux-ext4@vger.kernel.org > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: Linus Torvalds <torvalds@linux-foundation.org> > Cc: linux-mm@kvack.org > Cc: linux-arch@vger.kernel.org > Cc: Dan Williams <dan.j.williams@intel.com> > Cc: Vishal Verma <vishal.l.verma@intel.com> > Cc: Dave Jiang <dave.jiang@intel.com> > Cc: Matthew Wilcox <willy@infradead.org> > Cc: nvdimm@lists.linux.dev > Cc: linux-cxl@vger.kernel.org Looks good to me (although I share Dave's opinion it would be nice to CC the whole series to fsdevel - luckily we have lore these days so it is not that tedious to find the whole series :)). Feel free to add: Acked-by: Jan Kara <jack@suse.cz> Honza > --- > fs/ext2/super.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/fs/ext2/super.c b/fs/ext2/super.c > index 01f9addc8b1f..0398e7a90eb6 100644 > --- a/fs/ext2/super.c > +++ b/fs/ext2/super.c > @@ -585,13 +585,13 @@ static int parse_options(char *options, struct super_block *sb, > set_opt(opts->s_mount_opt, XIP); > fallthrough; > case Opt_dax: > -#ifdef CONFIG_FS_DAX > - ext2_msg(sb, KERN_WARNING, > - "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); > - set_opt(opts->s_mount_opt, DAX); > -#else > - ext2_msg(sb, KERN_INFO, "dax option not supported"); > -#endif > + if (dax_is_supported()) { > + ext2_msg(sb, KERN_WARNING, > + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); > + set_opt(opts->s_mount_opt, DAX); > + } else { > + ext2_msg(sb, KERN_INFO, "dax option not supported"); > + } > break; > > #if defined(CONFIG_QUOTA) > -- > 2.39.2 >
On 2024-01-30 06:33, Jan Kara wrote: > On Mon 29-01-24 16:06:28, Mathieu Desnoyers wrote: >> Use dax_is_supported() to validate whether the architecture has >> virtually aliased caches at mount time. >> >> This is relevant for architectures which require a dynamic check >> to validate whether they have virtually aliased data caches >> (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). >> >> Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") >> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> >> Cc: Jan Kara <jack@suse.com> >> Cc: linux-ext4@vger.kernel.org >> Cc: Andrew Morton <akpm@linux-foundation.org> >> Cc: Linus Torvalds <torvalds@linux-foundation.org> >> Cc: linux-mm@kvack.org >> Cc: linux-arch@vger.kernel.org >> Cc: Dan Williams <dan.j.williams@intel.com> >> Cc: Vishal Verma <vishal.l.verma@intel.com> >> Cc: Dave Jiang <dave.jiang@intel.com> >> Cc: Matthew Wilcox <willy@infradead.org> >> Cc: nvdimm@lists.linux.dev >> Cc: linux-cxl@vger.kernel.org > > Looks good to me (although I share Dave's opinion it would be nice to CC > the whole series to fsdevel - luckily we have lore these days so it is not > that tedious to find the whole series :)). Feel free to add: > > Acked-by: Jan Kara <jack@suse.cz> Hi Jan, Thanks for looking at it! I will do significant changes for v2, so I will hold on before integrating your acked-by if it's OK with you. Thanks! Mathieu > > Honza > >> --- >> fs/ext2/super.c | 14 +++++++------- >> 1 file changed, 7 insertions(+), 7 deletions(-) >> >> diff --git a/fs/ext2/super.c b/fs/ext2/super.c >> index 01f9addc8b1f..0398e7a90eb6 100644 >> --- a/fs/ext2/super.c >> +++ b/fs/ext2/super.c >> @@ -585,13 +585,13 @@ static int parse_options(char *options, struct super_block *sb, >> set_opt(opts->s_mount_opt, XIP); >> fallthrough; >> case Opt_dax: >> -#ifdef CONFIG_FS_DAX >> - ext2_msg(sb, KERN_WARNING, >> - "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); >> - set_opt(opts->s_mount_opt, DAX); >> -#else >> - ext2_msg(sb, KERN_INFO, "dax option not supported"); >> -#endif >> + if (dax_is_supported()) { >> + ext2_msg(sb, KERN_WARNING, >> + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); >> + set_opt(opts->s_mount_opt, DAX); >> + } else { >> + ext2_msg(sb, KERN_INFO, "dax option not supported"); >> + } >> break; >> >> #if defined(CONFIG_QUOTA) >> -- >> 2.39.2 >>
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 01f9addc8b1f..0398e7a90eb6 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -585,13 +585,13 @@ static int parse_options(char *options, struct super_block *sb, set_opt(opts->s_mount_opt, XIP); fallthrough; case Opt_dax: -#ifdef CONFIG_FS_DAX - ext2_msg(sb, KERN_WARNING, - "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); - set_opt(opts->s_mount_opt, DAX); -#else - ext2_msg(sb, KERN_INFO, "dax option not supported"); -#endif + if (dax_is_supported()) { + ext2_msg(sb, KERN_WARNING, + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); + set_opt(opts->s_mount_opt, DAX); + } else { + ext2_msg(sb, KERN_INFO, "dax option not supported"); + } break; #if defined(CONFIG_QUOTA)