Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1740599rdb; Wed, 31 Jan 2024 07:46:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8TnTY4H5HtGoxAGsVQIpyg1q1P89fR8F9AKYasWJQfLARe+MxogsGfuovEqoToWEp9AxQ X-Received: by 2002:a17:902:8690:b0:1d5:36db:e8b0 with SMTP id g16-20020a170902869000b001d536dbe8b0mr1846134plo.63.1706715972180; Wed, 31 Jan 2024 07:46:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706715972; cv=pass; d=google.com; s=arc-20160816; b=ZIILiDg+/4WV4Hry843jSBuiJcnJl+xpEj7DXfBo67IFIdGId3F7J6kHjWkhsQ5QL+ pXgfR6JqfEQ1tUdBB7/VYNkmQLMCl30wmGh/xI63VldGVkYcw9Mp2AItm6OZmI+xC+Eh 58mtnsQX3aZw6Xo8Y7I99AcKY/A+oWrGkyy2N/yL2cB3sOm/0rqwOgqkAKBdfqszscEb eJNMw3/MS6HrVMx8upnesf1WgvxpsKYX6dcCz+tccsNG3ZlCC+jSREDxvbjc8+N/QMYW m52X3qpo9DcU3PhHSMQoXjiEGKk3eHu2bmuuf6jkgoVml+4ZNazTjTaOwOoQ2SYxPb2P m3RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ylNdS+3OQaqf1UGVCYgXPPh6NHjLF4GaarW924QO7RE=; fh=8lslSGZzKvZL+IZa8wAsTW8Gd9ZMnu9cga4BIbkSfhU=; b=Vsr5JDEsNgozz/I41RE0i/yk6+eM49df5DszLtHQorD5W/kawqnFCASfzqRbZl/h1f fqaD6Yr6pCB+NWGypXNbR6ux2gwZ4F2ZqjLDe7hUz7JkN29kTrYUadiDRUTPgZNSjg5+ PAdd2pFXMtQdDJrMxHwLJQ2cFVUg/GVwq46IO0yRbpEUgbkEonZqCdAroDHD4BOpsUON VImbC+z5Nm7O6SxSp2PmNzJbWMLubUo7AqWT3rU5ji6ZYY0EHnoHPg6PjUgh7bQr9QXy JlawOA/x49+KK1oCYY9O9s2Mcmp8Xe2bj9xlaAqcriB3wJBYxbVISRQ/42uD8ZSwKnyw AdmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=spdpNVJY; 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-46675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=1; AJvYcCWI1ZffdLrL2ik5IciYSvTWQvspCenOq83STeHjCHBctWYravSKxKGpno3ZhxSYHkRmbzvK6WLQEl6Jifa7FThWYNd4n8MF2ZXqWX+33Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bd10-20020a170902830a00b001d7758b8502si9770194plb.190.2024.01.31.07.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:46:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=spdpNVJY; 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-46675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46675-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 78D5BB33032 for ; Wed, 31 Jan 2024 15:04:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A342135A5C; Wed, 31 Jan 2024 14:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="spdpNVJY" 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 DDBF182867; Wed, 31 Jan 2024 14:58:22 +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=1706713105; cv=none; b=BGSosTHxLZp4tZonSzQQfQuuHNW1nG77EwIs7TR66xXSa8mHN+1B2O3z4zC0IlufSKMkl4HZiixTrmTj04Vfz30t7wT810yEQRjviKKn64jnFh09Hz3uR14JgJH5GdNpEwQ1ziweF19lYLKaxjKfgLs9IsUNF8ITNRbYcYUZIIU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706713105; c=relaxed/simple; bh=L5pJpQ5dE+OFLWNsblvXxIVZo1jX7Zp/Itn5Bx1Ke3Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mjERpk64LxZ9rSoS9nPdUe7VOnw1L8OLjqh12eQR4yQpow4n/Qv9tHgej5UQ1qI8jLYazsFQY7m62fcjhwhVW117xVff58Q+s25u90PQxP4DO+LHgiZfQsUeQamDGRl0sGygogIsenyC85LeuQ+x8+Zb+SZBybM0SnDdjFLbbjk= 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=spdpNVJY; 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=1706713101; bh=L5pJpQ5dE+OFLWNsblvXxIVZo1jX7Zp/Itn5Bx1Ke3Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=spdpNVJYLB/Vcpi2FIvZnu7EVWB4/kO/4rDcNA2wvudacQT/We/qyugueJ7Ca1Kci SY8L9mJYTSYWYc1wGpXhTI2UK6GcikePPY16a8v+Nzrmi74ZzUlC3DoB1avnIkjQtF TR+Yp+tT6s0xzO64pJ9E7FlIOoBOWUeiZCT6Hbl8N05ksoGZJfU8vFXpDfj5k556My 8EBMzBtWAdsmMFiakP9EeuR5f6Ve25VYI7mbnl0dVPWMdjZB6QWwpQ+nLL3pV7HaR5 YX28OXtDEzVik25xabjPMkt68wwozSeLQAJXiSbWZ6QIPhBo3K79Y/06/NDpRx0LMt S20GCkIrCleKg== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TQ4sn1wYGzVrS; Wed, 31 Jan 2024 09:58:21 -0500 (EST) Message-ID: Date: Wed, 31 Jan 2024 09:58:21 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 7/8] Introduce dcache_is_aliasing() across all architectures Content-Language: en-US To: Dave Chinner 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 , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-xfs@vger.kernel.org References: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> <20240130165255.212591-8-mathieu.desnoyers@efficios.com> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-01-30 21:48, Dave Chinner wrote: > On Tue, Jan 30, 2024 at 11:52:54AM -0500, Mathieu Desnoyers wrote: >> Introduce a generic way to query whether the dcache is virtually aliased >> on all architectures. Its purpose is to ensure that subsystems which >> are incompatible with virtually aliased data caches (e.g. FS_DAX) can >> reliably query this. >> >> For dcache aliasing, there are three scenarios dependending on the >> architecture. Here is a breakdown based on my understanding: >> >> A) The dcache is always aliasing: >> >> * arc >> * csky >> * m68k (note: shared memory mappings are incoherent ? SHMLBA is missing there.) >> * sh >> * parisc > > /me wonders why the dentry cache aliasing has problems on these > systems. > > Oh, dcache != fs/dcache.c (the VFS dentry cache). > > Can you please rename this function appropriately so us dumb > filesystem people don't confuse cpu data cache configurations with > the VFS dentry cache aliasing when we read this code? Something like > cpu_dcache_is_aliased(), perhaps? Good point, will do. I'm planning go rename as follows for v3 to eliminate confusion with dentry cache (and with "page cache" in general): ARCH_HAS_CACHE_ALIASING -> ARCH_HAS_CPU_CACHE_ALIASING dcache_is_aliasing() -> cpu_dcache_is_aliasing() I noticed that you suggested "aliased" rather than "aliasing", but I followed what arm64 did for icache_is_aliasing(). Do you have a strong preference one way or another ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com