Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp80256lqg; Fri, 26 Apr 2024 09:15:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPCV+nBIdplV4Ady/+cqmfDrySIDIludwZhAjU6mN1W1t1ioIR07+5httHge/hXsAaO9wGVlsbp1NRChiwirDW17N2hdYBaOKeUlqPhA== X-Google-Smtp-Source: AGHT+IFqs/qNrRaZihWkyCG5BqT/OjEGhxqrzSqVDtTlOxJu72Vm3pAOdYylEN2PISWkT1bLeTua X-Received: by 2002:a19:9106:0:b0:51b:1e76:4ea9 with SMTP id t6-20020a199106000000b0051b1e764ea9mr2748360lfd.4.1714148104228; Fri, 26 Apr 2024 09:15:04 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id be8-20020a0564021a2800b005722f241144si3722040edb.276.2024.04.26.09.15.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 09:15:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@memverge.com header.s=selector2 header.b=h3+Ia5vB; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-160365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=memverge.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 B56101F23E40 for ; Fri, 26 Apr 2024 16:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0A8C15380E; Fri, 26 Apr 2024 16:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b="h3+Ia5vB" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2137.outbound.protection.outlook.com [40.107.101.137]) (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 12177145358; Fri, 26 Apr 2024 16:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.137 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714148090; cv=fail; b=QkbunrirekAjPgKeBD+E9LerpTu8ZL8Zl8uTs3UToX6vt73DgnjHtf5/KvdHfZxVvsDOTHpUrA9Z3VimtJhdueRK0vBUfRPMFHa539xEX+/az8P4uFA+nTy/3bpW54H6L7EtTsj7LnfP/aVYv/T071pbjhaN78l/52kWqMgEAM4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714148090; c=relaxed/simple; bh=fqF+ekf66S9kT2wSdfasWgDbpYNNgWyfSwY7ymY05Rg=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=DMzVXJ6ZKVssbtaskZG4344eptXYoIkzMn5Fabof83XK8h8TnBPrX9OlSIi4VGl/XgQExlMWq7F/ZOZx9huaGmOJfHd7uNvrn5gsdCNkQ3qpHNGlTPVKvS9NE4bbCx2rdcKBjR2SOLaozAWhcWE9wf8gUIMNj1NaMdpKhGrgSvs= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com; spf=pass smtp.mailfrom=memverge.com; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b=h3+Ia5vB; arc=fail smtp.client-ip=40.107.101.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=memverge.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WM3jL3QHx7EcnEDDHMMtp7W2qSREJqSZ72UbthZ5QJ0bIofeDsHw5ShZGB50IhPcEG2M4ayviNVC7/r4TeV/hUs7ZoqupgNH1kWOffUSDL0N7O2zsMZV2fj7MKn/2HEK/FnY/yUWW/bxWWp8Ysh/h2FvcukI20Ohj6zLeLvV0D4LfAvPYMtXjxxTIWL+wU6aqHkSsYz/6Buu9SExlcqtlEkPmK4GaCctaYygX3f/j95/ZehjqWpUzB8dEYNW6dJ180X56o4+9V2Vkecqpsf1zKz4kPb4V9wUAkKCeYBzUfeGHTtvK43SiT5JSO2Vfdg2TNDMgiHBqmwE8i8s5BiVzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=khrC5PDuMZrhIuPNX8ijenDKE7eqeYTZlr0jH6LFcyI=; b=dAPizjWeOmMvJcm6rsWRniIFPWkTljzO9KN2GJCk0BszdRGH9iXBGFEO8HnlDEWJyJ7lm4fscsvO3cQ0ms+cTIV6ptnxGqYEoun/AkjCaVQ060HAVBYnLn/i7ehZTW6x+W6uzxyfeG4YyJ6evdqEAtn7iWuN9/cHQ1GXYt6LKML3H21RhXvNbpdTNN6auxGS7fx+vtrXZAu1ecC6Nnwjw93JjsQ01/lO+OWeIGbwmC1s/H5JHuDowLsAVCs194RJqwFHDDopbL4j8Ktu9IoLmZeUI//0YsfjB4dGJxYKKpjK1F8h3YhASHSzv21pU1B81UHrec0fcfqB7TgNq370nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=memverge.com; dmarc=pass action=none header.from=memverge.com; dkim=pass header.d=memverge.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=memverge.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=khrC5PDuMZrhIuPNX8ijenDKE7eqeYTZlr0jH6LFcyI=; b=h3+Ia5vBVMz9yWDLzZV/YF1KLZQ+O2QSaxJ6pcy/JBubd8nfIQ60fGZJlaCXu93euYYQyt6tlBkQjgWmWeWkYq6+nSKkB8H7UDiDHscuxM87oUsK3ywEL/l7qKEvJjE2Ns02KJpx8HzehY1c5Iv0AS0jZjEwFCoHhiWXX9o9U5w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=memverge.com; Received: from SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) by MW5PR17MB6009.namprd17.prod.outlook.com (2603:10b6:303:1a9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.31; Fri, 26 Apr 2024 16:14:47 +0000 Received: from SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::5d53:b947:4cab:2cc8]) by SJ0PR17MB5512.namprd17.prod.outlook.com ([fe80::5d53:b947:4cab:2cc8%4]) with mapi id 15.20.7472.044; Fri, 26 Apr 2024 16:14:47 +0000 Date: Fri, 26 Apr 2024 12:14:43 -0400 From: Gregory Price To: Dongsheng Yang Cc: Dan Williams , axboe@kernel.dk, John Groves , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: Re: [PATCH RFC 0/7] block: Introduce CBD (CXL Block Device) Message-ID: References: <20240422071606.52637-1-dongsheng.yang@easystack.cn> <66288ac38b770_a96f294c6@dwillia2-mobl3.amr.corp.intel.com.notmuch> <98ae27ff-b01a-761d-c1c6-39911a000268@easystack.cn> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98ae27ff-b01a-761d-c1c6-39911a000268@easystack.cn> X-ClientProxiedBy: BYAPR07CA0028.namprd07.prod.outlook.com (2603:10b6:a02:bc::41) To SJ0PR17MB5512.namprd17.prod.outlook.com (2603:10b6:a03:394::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR17MB5512:EE_|MW5PR17MB6009:EE_ X-MS-Office365-Filtering-Correlation-Id: dff0d860-f073-4b58-18a9-08dc660bfde5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bmtDaitQbEJpYmpMRG1yY25sb2EwTlFJSGw1Y0Nac2FSK2RVWjNHRmRTb2VM?= =?utf-8?B?dHdvMFBFOEUwNkhPRHNjZzFQOUU3eDBtNzhUNFdMYnJKQ2hYN0d5THIwUUNx?= =?utf-8?B?VmNveTFNaEwvMGwyN3hIVERvSS9WOUJMRGFrT1hnNGJFS3JLM0dxN0xLWEJj?= =?utf-8?B?SEE3QUdqQ2ZKeDVyYTJINkVmb05xb296aGp6N09KYWZVSm9LNjBqN2o0U2ZU?= =?utf-8?B?cFk5UGtsRFd4Rkhhc2luejNheWJOdVBqdjh5Q2dadUdhMFBxTEtDRlVpR0ky?= =?utf-8?B?cktyMzduQU9rUHovZFowQjlXRTFvOERqWHh6dnVDVDYzSmFJaktkRHlGUC9E?= =?utf-8?B?SVU5VTVDVmNEb1NsSHh4T0Viam42SEZzOU5uYzM3S3NnY3hxa000YTNwQ1or?= =?utf-8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-8?B?VTZzbzJtVnpvVFVQWGhmUWZsbzVKMk0vNnU3bFlaQnMwOUorZW8xVk5hbnND?= =?utf-8?B?cWV2SU1MaTJYWk5VdTRNUlBPQ1VIYmhySVhkZVZxamhGeVBKbFExNHFvNDNq?= =?utf-8?B?RGd1NEV4Vk85SVBDbThiL3pJVklsc1V0N1U4b0k4OXFEeGZyMGltYjR5SjND?= =?utf-8?B?c3pZWm5lRUdoYzNCWndJUXp5N1k3TVZMOHZ2eXJHWXFIb3Fzb0xaREZQbGlp?= =?utf-8?B?anhtSktESkdGV2J1bTdrQlBXWW04MFJkYWpXOHhCd2hsb2lTN3NMd1NObnNO?= =?utf-8?B?VW9EbGdNQVRoejhwUXllU1NxSTh4NnlqaUFhMTUvOUVFUWhMVGxzN2dwamd4?= =?utf-8?B?Qy9mUDk3bWVDTmhhQVpCZHF5b0tuZ1ZyaWQxUlRSaGgxSkpSWVZNVi9nPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR17MB5512.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SlZwTzRlNnNHQWt0WnpmRkNGQ3oyMmQ4YmJnWFlzVFFhV1EyQm85dEVmMWdy?= =?utf-8?B?cm5MVENXa0dHcHFmSm9lV2s5YzFDTmI2VjUrd2xzNU5NVzB2ZENsME53WW9x?= =?utf-8?B?VUNRZDE2QTFEZENHSFZpUkt2ZDA4ZnlBZGNvUGQyWGsyM0RtaTVWV1dsbGUw?= =?utf-8?B?SXFBWU5vUFlzVldqYlYzdWlsd2IyWUdUU1M3Sk1nNFJMUWRzRFJBWUo1b2NG?= =?utf-8?B?T2h2bFpTYVpQd29ZbXpCR0M3SHp3RFdzNXJFdmt6SjhnSGw5c1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5Rb1g5VFFkc0JKUWRscUxBcnIr?= =?utf-8?B?Zm1WaUdHMk9RRVJ5YXVSa2hvZkdzbDN3Z09EVXFSUWt0T3kvTEVZMlZWbWVH?= =?utf-8?B?WXc9PQ==?= X-OriginatorOrg: memverge.com X-MS-Exchange-CrossTenant-Network-Message-Id: dff0d860-f073-4b58-18a9-08dc660bfde5 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR17MB5512.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2024 16:14:47.2017 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5c90cb59-37e7-4c81-9c07-00473d5fb682 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H5pxphtB5vs5yo1TPRZyWCBtIEndtLPBnKaEtcWTwSsSqR7wazqbbjmSg+PfujttWy1GLvn6EZ4MrkK0azKHm9wvFoS8sf7CJzoiSa223Mg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR17MB6009 On Fri, Apr 26, 2024 at 10:53:43PM +0800, Dongsheng Yang wrote: > > > 在 2024/4/26 星期五 下午 9:48, Gregory Price 写道: > > > > Also, on a tangential note, you're using pmem/qemu to emulate the > > behavior of shared CXL memory. You should probably explain the > > coherence implications of the system more explicitly. > > > > The emulated system implements what amounts to hardware-coherent > > memory (i.e. the two QEMU machines run on the same physical machine, > > so coherency is managed within the same coherence domain). > > > > If there is no explicit coherence control in software, then it is > > important to state that this system relies on hardware that implements > > snoop back-invalidate (which is not a requirement of a CXL 3.x device, > > just a feature described by the spec that may be implemented). > > In (5) of the cover letter, I mentioned that cbd addresses cache coherence > at the software level: > > (5) How do blkdev and backend interact through the channel? > a) For reader side, before reading the data, if the data in this channel > may be modified by the other party, then I need to flush the cache before > reading to ensure that I get the latest data. For example, the blkdev needs > to flush the cache before obtaining compr_head because compr_head will be > updated by the backend handler. > b) For writter side, if the written information will be read by others, > then after writing, I need to flush the cache to let the other party see it > immediately. For example, after blkdev submits cbd_se, it needs to update > cmd_head to let the handler have a new cbd_se. Therefore, after updating > cmd_head, I need to flush the cache to let the backend see it. > Flushing the cache is insufficient. All that cache flushing guarantees is that the memory has left the writer's CPU cache. There are potentially many write buffers between the CPU and the actual backing media that the CPU has no visibility of and cannot pierce through to force a full guaranteed flush back to the media. for example: memcpy(some_cacheline, data, 64); mfence(); Will not guarantee that after mfence() completes that the remote host will have visibility of the data. mfence() does not guarantee a full flush back down to the device, it only guarantees it has been pushed out of the CPU's cache. similarly: memcpy(some_cacheline, data, 64); mfence(); memcpy(some_other_cacheline, data, 64); mfence() Will not guarantee that some_cacheline reaches the backing media prior to some_other_cacheline, as there is no guarantee of write-ordering in CXL controllers (with the exception of writes to the same cacheline). So this statement: > I need to flush the cache to let the other party see it immediately. Is misleading. They will not see is "immediately", they will see it "eventually at some completely unknowable time in the future". ~Gregory