Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3155653pxj; Mon, 7 Jun 2021 03:54:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb+cCAcHkVDATufM/cZ8sRer53bAzRCB95Mwp5XaLZFu00mici5xw5giywNnyB1FzfsneG X-Received: by 2002:aa7:d555:: with SMTP id u21mr11102633edr.84.1623063273984; Mon, 07 Jun 2021 03:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623063273; cv=none; d=google.com; s=arc-20160816; b=Wp+AcQHfE7lJRA1hjjcrtSMCyCjkWK7Bs8efb6MpztjPrKG7FZyQk/hFLen/HkqwC/ lPshxrLcqD8zZmy6fyLRAFrPDRzC4O7N93m560Ov5yzF4Aj/le3NosI5m7kRMV2bpRFT G1NIfGFWqGTBNj/yF6SZHOKmGfijdAKVSeSd1qR+u/zHlpEzMHzf3GnRhdsEZaZbNO6o ZS4c1VN+9yV60wD/DpJHJV5mcHAowEqZTDjdjMxKcWjHE3/aJU2azhLOrXARLMeMTxnb 2P5fqnv7o8sBR5cp3slayOIUQ1TJSe5E3uynDhQ750BARqJYFWj5CAnd8lXil+w/38fD 0ssg== 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=eD0bk5f53n9uLo+gAYHtQzewYA+P20EM9sXTboHIMJ4=; b=sp65vuzchte3CNHdiC1CL9qeib18FU4P8xAxyJ2pR/gV4KQT4Sn6m8aN1Jb+MoZwgh eDzqNugtmT2+xD8Xu2M1qyYRCE2wB4P83CmYN87qav6XVLT68C/NA8I6aUHYuOBO8se5 44VDMn/2x+KZYu4h2lzk0e2CZmy2WHvpo3USH/z4nX0sd1M3vpEXvAA9hJhT4/CwnzAX eY8ZIWglOjlkQkbMc/j8nwBhJvCLAv/Zngf71qv0FTXOypThvKgHjpRfs4X6fcsbP9iU 0Q9pwFhANMkGSUSoEgLX1IKvbsAeIsf5iDY+HmcGcjYG7YQIq/PKI/cBIMZgCD35Lx/i EWtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bHrnrbfd; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si13828120edz.65.2021.06.07.03.54.11; Mon, 07 Jun 2021 03:54:33 -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=@kernel.org header.s=k20201202 header.b=bHrnrbfd; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbhFGKxd (ORCPT + 99 others); Mon, 7 Jun 2021 06:53:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:42784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbhFGKxa (ORCPT ); Mon, 7 Jun 2021 06:53:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4C7C60FDA; Mon, 7 Jun 2021 10:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623063099; bh=i0XQNJYxQaqmmDQoZDk8J9PTxBJKV9BhW0RKaQP+lP0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bHrnrbfddswK+S1j4C42LhenrJnyZz8UOTxrgN3YF3wyeoVCG6OQWsgTr/IjKhoJn ERbu8T9RJahz6h/t91glP9JYPjgNjDYX4V25Um/a25NEcNoG3TV4vhSQk3IYZCBCX0 K8veW/Sk2qjS5tAv586p2y63jVNOcVh8IOw4ttuW16ZJALshA+J/thRn7+2vy0JV3m yJlbI82t4IJ/JYWqnhKC6nefiGfB4TlUuLkrDFd5AFuv/JRPZfrh4YV6Qx9cyJR96/ ai+OgIGQyppbYEsFX2PBppGU7A3bxONEKc3ZFo3zrpaNz21ZhHi31JM2TY24Ni0UY1 Xc8ejs8iyrAvw== Date: Mon, 7 Jun 2021 13:51:36 +0300 From: Leon Romanovsky To: Greg KH 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 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. Thanks