Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp699092lqj; Sun, 2 Jun 2024 18:59:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuEr8GeilkSu1J8ZGHUiwp6YdYIc11Ld4VG0M14Hgf6B76DIlFGGi8UDMr6yXVljIAORhmfxoqU9tu9QKokMzuqgTMTatQfegnaqukhg== X-Google-Smtp-Source: AGHT+IFn3XKpg8VpHZYsVgkJRAXu2Njc2THAaBaYJP5BeBm14KqLQTOat0Xb1LLImup4qOyUaEyC X-Received: by 2002:a0d:e504:0:b0:61a:dc61:25e2 with SMTP id 00721157ae682-62c7982ba3cmr80701987b3.49.1717379966236; Sun, 02 Jun 2024 18:59:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717379966; cv=pass; d=google.com; s=arc-20160816; b=Ey3lL10fB0u7s2Ky0Xno5LeuD4W8pdm8JeFQZcSRvrm9GmLG0+MDvdGErQoC5SPMwi rfvo5Aw8mq/0Ler1jkDBgFyyUN6IXmEZZnFH06gzS5FQ4KXqm7avjCUH3b2rUR7wQQeC m+hel6Q0q6xHlydAxT2InHccnlPoZGaaSP2RcqVMh1vz2Q4Zszk0ghOgP8mCAUga8Mnk OQkXTZUWhqE4TH+rAy4kJ6Snl9gR2oAypmZBljzTG+Moy3XzcVcM3lP8qBO5OO31i/YJ O+7+vkGNN5PO7rjxBkYYWyzVcmI4ZPX+4bM2VASZmoAlyzVMpVwJBbnusLzmdWM7Qts8 YK3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:cc:to:subject; bh=0tB+38ovB6AouFuMWfCi//QRGcsyS5Gf1Zx70HFv0AI=; fh=3SDFeYnjQvbaSZvzHJQbaM1YQk9sZj1qi5nspBoLD8Q=; b=TnTM53K8UzI9vAxQatVPugokw1Zx1S/Y6VQVekQBl1F/R1/U6Yx8MPTI+lJgowFvby 0qnhYNcusc7yGxVQHoq0xfAyeehFNd4xvXMoaS7pryd1jG+oybk++/Xzn/XhsrSR8b+0 If7wNL4hksjvXt6SCgzHt71LmPs+rRC+ZFVOzVWC37/DmPubS0HK6CsCP1RhY9nucK5D 1ciyq19/T6wdMoRtsc2nA6KfquuknbzV6UQbloWghjFuSkn4gwgz+DQ7S8IlRkNqiBm1 nBW7Whti63Nd7xZbuldW3qjCOfUmL98SjyhKug64Edy4q1KYhc23mp6vwc3E0WL3Kr5E 4zgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-198540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198540-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=easystack.cn Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f32a596fsi734204485a.643.2024.06.02.18.59.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 18:59:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-198540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198540-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=easystack.cn 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE4891C20A2C for ; Mon, 3 Jun 2024 01:59:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C90975664; Mon, 3 Jun 2024 01:59:18 +0000 (UTC) Received: from mail-m1040.netease.com (mail-m1040.netease.com [154.81.10.40]) (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 10D794A08; Mon, 3 Jun 2024 01:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=154.81.10.40 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717379958; cv=none; b=nQReflqet7LPHqTxUD8gE9OM/iociwY6XukkIUynuoUm7822qJKxZn5d/NmjOjUWp/YHrJ/dlgrWdDgk/cPweRpd1kbKjG6jnvl7AG3Yl83Tu+bpaDlfXK4rg7G5/zaEAPeIiaFNv28NuqYxJe56ofkrgC5WfsZ5EAzRMAJSIbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717379958; c=relaxed/simple; bh=GZVCi5VbbjTDmXB32ysDacElGhSOcP5bQWWnQ1WtVSU=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=gMcODAeawgcdfr5WKuCSns5yfi9+KF8Bcmxiz8m3SWP95zLc7+3jlSTKNhLDJVrsRkgSC0+QAdzd7vx2Xs59eXPybw0lngJGTylgO3Nvrpk+JhpD2JDYMe1D1ykS44xYAl9PoTlUI4AOq7nZWFWbaI8RBz9cKQ1UU0mQvXn11tI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=easystack.cn; spf=none smtp.mailfrom=easystack.cn; arc=none smtp.client-ip=154.81.10.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=easystack.cn Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=easystack.cn Received: from [192.168.122.189] (unknown [218.94.118.90]) by smtp.qiye.163.com (Hmail) with ESMTPA id 5363886017F; Mon, 3 Jun 2024 09:33:29 +0800 (CST) Subject: Re: [PATCH RFC 0/7] block: Introduce CBD (CXL Block Device) To: Gregory Price Cc: Dan Williams , Jonathan Cameron , John Groves , axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev References: <20240508131125.00003d2b@Huawei.com> <20240508164417.00006c69@Huawei.com> <3d547577-e8f2-8765-0f63-07d1700fcefc@easystack.cn> <20240509132134.00000ae9@Huawei.com> <664cead8eb0b6_add32947d@dwillia2-mobl3.amr.corp.intel.com.notmuch> <8f161b2d-eacd-ad35-8959-0f44c8d132b3@easystack.cn> <5db870de-ecb3-f127-f31c-b59443b4fbb4@easystack.cn> From: Dongsheng Yang Message-ID: Date: Mon, 3 Jun 2024 09:33:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFJQjdXWS1ZQUlXWQ8JGhUIEh9ZQVkZT0geVh0dTxoYSEhOHx1NQlUZERMWGhIXJBQOD1 lXWRgSC1lBWUlKQ1VCT1VKSkNVQktZV1kWGg8SFR0UWUFZT0tIVUpNT0lMTlVKS0tVSkJLS1kG X-HM-Tid: 0a8fdbbae4da023ckunm5363886017f X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Pi46ASo4IjcsCCwyChcyPww# EA4KChlVSlVKTEpMSExDT0pLS01OVTMWGhIXVR8UFRwIEx4VHFUCGhUcOx4aCAIIDxoYEFUYFUVZ V1kSC1lBWUlKQ1VCT1VKSkNVQktZV1kIAVlBT0JNSzcG 在 2024/5/31 星期五 下午 10:23, Gregory Price 写道: > On Thu, May 30, 2024 at 02:59:38PM +0800, Dongsheng Yang wrote: >> >> >> 在 2024/5/29 星期三 下午 11:25, Gregory Price 写道: >>> >>> There are some (FAMFS, for example). The coherence state of these >>> systems tend to be less volatile (e.g. mappings are read-only), or >>> they have inherent design limitations (cacheline-sized message passing >>> via write-ahead logging only). >> >> Can you explain more about this? I understand that if the reader in the >> writer-reader model is using a readonly mapping, the interaction will be >> much simpler. However, after the writer writes data, if we don't have a >> mechanism to flush and invalidate puncturing all caches, how can the >> readonly reader access the new data? > > This is exactly right, so the coherence/correctness of the data needs to > be enforced in some other way. > > Generally speaking, the WPQs will *eventually* get flushed. As such, > the memory will *eventually* become coherent. So if you set up the > following pattern, you will end up with an "eventually coherent" system Yes, it is "eventually coherent" if "NO CLEAN WRITEBACK" bit in both CSDS and DVSEC is set. > > 1) Writer instantiates the memory to be used > 2) Writer calculates and records a checksum of that data into memory > 3) Writer invalidates everything > 4) Reader maps the memory > 5) Reader reads the checksum and calculates the checksum of the data > a) if the checksums match, the data is coherent > b) if they don't, we must wait longer for the queues to flush Yes, the checksum was mentioned by John, it is used in FAMFS/pcq_lib.c, pcq use sequence and checksum in consumer to make sure data consistency. I think it's a good idea and was planning to introduce it into cbd, of coures it should be optional for cbd, as cbd current only supports hardware-consistency usage. it can be an option to do data verification. Thanx > > This is just one example of a system design which enforces coherence by > placing the limitation on the system that the data will never change > once it becomes coherent. > > Whatever the case, regardless of the scheme you come up with, you will > end up with a system where the data must be inspected and validated > before it can be used. This has the limiting factor of performance: > throughput will be limited by how fast you can validate the data. > > ~Gregory > . >