Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3177148pxj; Mon, 7 Jun 2021 04:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6iwBMjMS+yKrgmlNH2zeHWuNrab3nmzLc8Bs10NL/hhF0iYXhkgzLFRyzaAeOcAUWVXgk X-Received: by 2002:a05:6402:1648:: with SMTP id s8mr19736758edx.256.1623065182585; Mon, 07 Jun 2021 04:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623065182; cv=none; d=google.com; s=arc-20160816; b=OH/X64luUxRRfqYwIcrRyhsz7sLyq6DEiYcjWc30DPhLg4q/xkQVAuxA4Zyf3OSgKb BZROGZQZ7EZTsc3jcxstYNhzXo57hPN0gRmUxFzeHty8pb/F5X2Tw2qRpel7n8XYPcyr 0i3l6Ich3C76arK+ONE54p0FiUKQcNdhX4UfC7vLnREcjdy5YLBWJ5BO3BzvSTwHYy1w OcRYyhhPyalEK1OyMnO8lBR9fqzuf1Iow3r3dwM0fHQ7C4pvjZzBDAp3WBAB5qzNXTcu T4DFDnXeOPRBr0N3gOJYVyhoXa1hPeOZKWptIzBc11RrdcskX+rb7XKlm5FtwmexL5S5 QkIQ== 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=8V5LgJfWrDorVHOc6xC0uMt+rmPvuxBZh6r2HnXb5+I=; b=poCV8UCkrO6Thvm97mtG6tAMHiZ3AF9wSxTm5OFFnOii64WMrbTrf0pd0I0kPbf/Jk MruPDmHKKrMbnNRsS9iE+RmYbMEnE/uY85r/6kTw5neGaqR6N2U6SK0urKpg7epAIW3+ 76MrZLae42wu3NwIqllL8RvZd60HbJMLtYpMycXxFs/APNTvz4/fi3O3wLzHXSDogDj/ vHFVmnHmjn2o5N46CNJh2+CNFAb9trFpyw+MqUVbsSYxS7bGoeuayZNweehYe5Sugr87 2xAFnmTu2PVsbS+csIduFqrXBUYyF9AnovLqSeTCx1xMPZb4NKMWJPWICb/O7Vctquul M+kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FZ493wnR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si12371360edq.40.2021.06.07.04.26.00; Mon, 07 Jun 2021 04:26:22 -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=@linuxfoundation.org header.s=korg header.b=FZ493wnR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbhFGLY1 (ORCPT + 99 others); Mon, 7 Jun 2021 07:24:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:39678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhFGLY1 (ORCPT ); Mon, 7 Jun 2021 07:24:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0672E6101A; Mon, 7 Jun 2021 11:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623064948; bh=ju0IM5bV7VcbUBVbz7i9SyId2p/5YdRiN+GBRoDwlUQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FZ493wnRr+pR16QlfjU73Dmi5e13inbxknr5dZAkpEGSQ3YeFrrvTrnRnwXdeFr7T dARRejBOLt/e0F0eCAEkclhlY4x//YDFu9ZWW43VyN9SWDIXsYhBlRoW8eJkExrVBO PMUuGTD4KlUJ9Vl8svq075OhdAqgbq/INFp9jXcA= Date: Mon, 7 Jun 2021 13:22:26 +0200 From: Greg KH To: Leon Romanovsky Cc: Doug Ledford , Jason Gunthorpe , Kees Cook , Nathan Chancellor , Adit Ranadive , Ariel Elior , Christian Benvenuti , clang-built-linux@googlegroups.com, Dennis Dalessandro , Devesh Sharma , Gal Pressman , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Michal Kalderon , Mike Marciniszyn , Mustafa Ismail , Naresh Kumar PBS , Nelson Escobar , Nick Desaulniers , Potnuri Bharat Teja , Selvin Xavier , Shiraz Saleem , VMware PV-Drivers , Yishai Hadas , Zhu Yanjun Subject: Re: [PATCH rdma-next v1 10/15] RDMA/cm: Use an attribute_group on the ib_port_attribute intead of kobj's Message-ID: References: <00e578937f557954d240bc0856f45b3f752d6cba.1623053078.git.leonro@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 01:51:36PM +0300, Leon Romanovsky wrote: > On Mon, Jun 07, 2021 at 12:25:03PM +0200, Greg KH wrote: > > On Mon, Jun 07, 2021 at 11:17:35AM +0300, Leon Romanovsky wrote: > > > From: Jason Gunthorpe > > > > > > This code is trying to attach a list of counters grouped into 4 groups to > > > the ib_port sysfs. Instead of creating a bunch of kobjects simply express > > > everything naturally as an ib_port_attribute and add a single > > > attribute_groups list. > > > > > > Remove all the naked kobject manipulations. > > > > Much nicer. > > > > But why do you need your counters to be atomic in the first place? What > > are they counting that requires this? Given that they are just a > > statistic for userspace, making them be a u64 should work just the same, > > right? > > The statistic counters are per-port, while the cm.c flows run in > asynchronically in parallel for every CM connection. > > We need atomic variable to ensure that "write to u64" is not > interrupted. On what system is "write to u64" interruptable? As these are per-port, do multiple threads try to increment these at the same time? And even if they do, what happens if one is 'dropped' somehow because of this? It's just a userspace statistic counter, what relies on this being exact? thanks, greg k-h