Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp601359pxj; Fri, 14 May 2021 10:50:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxs7zMXpUx/SIaS54eot91s000bogydRjpSECCVcnzfoyJi2lu3/5MXXsqYAeB65cJD2W+S X-Received: by 2002:a17:906:3b10:: with SMTP id g16mr50871216ejf.232.1621014659198; Fri, 14 May 2021 10:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621014659; cv=none; d=google.com; s=arc-20160816; b=F2CANIhAIC9sqw9MDURu08Zi21YuVsw+LeeNAqM8GDDFatxeG9Tct9Hap3GNpxO0hI kc/xagSeWMvZWJ2Vi0Gomq+dIP/wsl7wW6XGXHoY1wgxjZt/+UngzP75j2SqS+/6iNDM sBI1gPUhx55LisbpBygtH8wR9MPbWLRdKg8l61ApRE6IlzcfuKiDjsj2wNxtB+5jwSKG VuXWbPidiqffTXjDHn3FxO4DKqCzteAY91B/9aHMZ5eg3Zs1FwKvGzKbvzzR9eu+3WTi Iii7sjhsM6JeZAZJ68Q62GqigOjmGF6vubDJ6qoaU41+nqPjFNp/R4sBIPXy7TC08YpI y3Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9+rh5toy6w7tSZKTYyXb9xGpei7fnwqJwkaQ76SHrhM=; b=dhZTUdIOCwBn+JqXsiRp4z2XIJJWKdodzpNd5iShrJVodrFJ8OjPWz0yVkke2uSDge 2y3M2Mt5DOjugIRiXELWoyrn8UriJKUnO2wbVFr6Kh7CzMyX9IEC17KobV0G0zlwo39Q PndOmi8NdV0hTFnY7XuQqlZuwu1cP/gEJVey8ghlbtFa4E/+Ae2jLb86u3gwilOO8wiK ReIpS4xTg3G2JZGEhHpIUoxItlqlzy8q0ruFUaXl+eRJZcezpQdB7MIyE5WARA5jy7ix P8qIPBOHz0U7fmTrD25WnrbxHzoW1h6zDvV9OdS0gE0DTHz0qxvt7TABZWTF/T1y5VmE qZTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=RhZRKiZs; 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 f20si6601184edd.12.2021.05.14.10.50.27; Fri, 14 May 2021 10:50:59 -0700 (PDT) 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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=RhZRKiZs; 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 S232196AbhENLsk (ORCPT + 99 others); Fri, 14 May 2021 07:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbhENLsk (ORCPT ); Fri, 14 May 2021 07:48:40 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4148EC061574 for ; Fri, 14 May 2021 04:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9+rh5toy6w7tSZKTYyXb9xGpei7fnwqJwkaQ76SHrhM=; b=RhZRKiZs8yRPgN+DkBxlK/W39E EDrXRZzdDv4sK9rr+ahPrxlAV+O+mOfCQmwpX30btZfKLkkMtmEb66RPvTy2aFcP/bzCXYi5nsIsE w4jZwGTiMbqPww8VUZ24dl81dUO2Ij8JPHS4SWrftGxqE6DHHzvWk6vQZcvpj7lA8MajQPM3rp8ct meAaSN+khRlZ4XBBwGOSKFYwL8nnffi+vJtZFR3r8tF7ae39CFt2qOhWF9LAz9hGsV4K+Ll5ru3oi yIJ+MIrrmIJXIj6RBIWTUxMkLwWq713CONMFpeLKEDzildtr4YQxa6vuoE/0WUDdC+bR8Gi8+WNAw DMHgGQzw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lhWHl-007xqp-1z; Fri, 14 May 2021 11:47:17 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E2F7A30001C; Fri, 14 May 2021 13:47:15 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5B67B20829F97; Fri, 14 May 2021 13:47:15 +0200 (CEST) Date: Fri, 14 May 2021 13:47:15 +0200 From: Peter Zijlstra To: kajoljain Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, maddy@linux.vnet.ibm.com, santosh@fossix.org, aneesh.kumar@linux.ibm.com, vaibhav@linux.ibm.com, dan.j.williams@intel.com, ira.weiny@intel.com, atrajeev@linux.vnet.ibm.com, tglx@linutronix.de Subject: Re: [RFC 1/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats Message-ID: References: <20210512163824.255370-1-kjain@linux.ibm.com> <20210512163824.255370-2-kjain@linux.ibm.com> <37015d53-050a-acef-2958-b1ff5d02800b@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37015d53-050a-acef-2958-b1ff5d02800b@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 05:56:14PM +0530, kajoljain wrote: > But yes the current read/add/del functions are not adding value. We > could add an arch/platform specific function which could handle the > capturing of the counter data and do the rest of the operation here, > is this approach better? Right; have your register_nvdimm_pmu() set pmu->{add,del,read} to nd_pmu->{add,del,read} directly, don't bother with these intermediates. Also you can WARN_ON_ONCE() if any of them are NULL and fail registration at that point.