Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2943109pxb; Fri, 12 Feb 2021 05:39:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNdsWwXilWtV3kxnEo7mm7YUKeS13mzLUqG9pYXQ5LpveFfIT2tqCdKJIQ9cxoQxH9XssZ X-Received: by 2002:a17:906:17c3:: with SMTP id u3mr3042230eje.304.1613137154664; Fri, 12 Feb 2021 05:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613137154; cv=none; d=google.com; s=arc-20160816; b=t0kHUH6xvbubk9bqrQ7efQ5mhtC3M/jRfHs8QNiSi4e7+HyiLtWyeniLzrXzoj9LGJ ZbTzVlGQkhV/e1hHIr2ORbNj6QZYHk7vZEWfXbYalSAECx1T2RBkrJU1KeCH4TpIxhal 1rm4jQzgLJqG8OHvZCKCrMm8sREopKH3FdQRv5bpGFc08DyzLlL8D8vD8afIseoCQd/X FygESw5F4vZ06SXLB3OJR7siKDtOKskzMFk06G/zYCREgx8/E9KDHJsLMLInrFdJ5Ntu DNtQv0z16B7dPfqyWQZyQGWbm1PD51iO/4690AwD0s0oRUpm7zuirpY4UEZ7ENiWoIoP iMXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=XyujQIchH8rNkfpmv7xYIgmm9JjYaFhczNV4bWMhjz0=; b=H7uJYURPFLhFbPcNEbBXdeAfKYC6SvxTxYLb0WstVjfa30CAWsY3zEUbfqFib7Ji50 5b3w6fX4KBvEYSW4Y1xcCAUe5P2yTkIXvR0wr18k8kZZtD9DwVa180XcGxhgRhi6F/Ta t6OVG6wn5SAjS8KUM6FuiT4OeN6Vx8XzVXhFw6ksyL54rshyAl5puCB7WY5P10koZk5j ba0wQzoQLf7frANyYW21ePA7Zp0VSrkBvE3a8+8iq9l1/q0dzf8cjRRraSbHksf8T5fA VBhMkgI7xymdRwfi+EuNqc6hDz7uJ1SR+L4NUcWNr84lItwxOCuEQOFCUCDucb6EYQ+u gVyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb8si8096847edb.6.2021.02.12.05.38.51; Fri, 12 Feb 2021 05:39:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231422AbhBLNgK (ORCPT + 99 others); Fri, 12 Feb 2021 08:36:10 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2561 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbhBLNeu (ORCPT ); Fri, 12 Feb 2021 08:34:50 -0500 Received: from fraeml711-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DcZB80s6bz67mLJ; Fri, 12 Feb 2021 21:30:24 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml711-chm.china.huawei.com (10.206.15.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 12 Feb 2021 14:34:07 +0100 Received: from localhost (10.47.28.230) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 12 Feb 2021 13:34:06 +0000 Date: Fri, 12 Feb 2021 13:33:04 +0000 From: Jonathan Cameron To: Dan Williams CC: Ben Widawsky , , "Linux ACPI" , Linux Kernel Mailing List , linux-nvdimm , Linux PCI , Bjorn Helgaas , Chris Browy , Christoph Hellwig , David Hildenbrand , David Rientjes , Ira Weiny , Jon Masters , "Rafael Wysocki" , Randy Dunlap , Vishal Verma , "John Groves (jgroves)" , "Kelley, Sean V" Subject: Re: [PATCH v2 3/8] cxl/mem: Register CXL memX devices Message-ID: <20210212133304.00001f28@Huawei.com> In-Reply-To: References: <20210210000259.635748-1-ben.widawsky@intel.com> <20210210000259.635748-4-ben.widawsky@intel.com> <20210210181725.00007865@Huawei.com> <20210211101746.00005e8c@Huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.28.230] X-ClientProxiedBy: lhreml721-chm.china.huawei.com (10.201.108.72) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Feb 2021 12:40:45 -0800 Dan Williams wrote: > On Thu, Feb 11, 2021 at 2:19 AM Jonathan Cameron > wrote: > > > > On Wed, 10 Feb 2021 18:17:25 +0000 > > Jonathan Cameron wrote: > > > > > On Tue, 9 Feb 2021 16:02:54 -0800 > > > Ben Widawsky wrote: > > > > > > > From: Dan Williams > > > > > > > > Create the /sys/bus/cxl hierarchy to enumerate: > > > > > > > > * Memory Devices (per-endpoint control devices) > > > > > > > > * Memory Address Space Devices (platform address ranges with > > > > interleaving, performance, and persistence attributes) > > > > > > > > * Memory Regions (active provisioned memory from an address space device > > > > that is in use as System RAM or delegated to libnvdimm as Persistent > > > > Memory regions). > > > > > > > > For now, only the per-endpoint control devices are registered on the > > > > 'cxl' bus. However, going forward it will provide a mechanism to > > > > coordinate cross-device interleave. > > > > > > > > Signed-off-by: Dan Williams > > > > Signed-off-by: Ben Widawsky > > > > > > One stray header, and a request for a tiny bit of reordering to > > > make it easier to chase through creation and destruction. > > > > > > Either way with the header move to earlier patch I'm fine with this one. > > > > > > Reviewed-by: Jonathan Cameron > > > > Actually thinking more on this, what is the justification for the > > complexity + overhead of a percpu_refcount vs a refcount > > A typical refcount does not have the block and drain semantics of a > percpu_ref. I'm planning to circle back and make this a first class > facility of the cdev interface borrowing the debugfs approach [1], but > for now percpu_ref fits the bill locally. > > > I don't think this is a high enough performance path for it to matter. > > Perhaps I'm missing a usecase where it does? > > It's less about percpu_ref performance and more about the > percpu_ref_tryget_live() facility. > > [1]: http://lore.kernel.org/r/CAPcyv4jEYPsyh0bhbtKGRbK3bgp=_+=2rjx4X0gLi5-25VvDyg@mail.gmail.com Thanks for the reference. Definitely a nasty corner to clean up so I'll keep an eye open for a new version of that series. Jonathan