linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Mark Zhang <markzhang@nvidia.com>,
	Ira Weiny <ira.weiny@intel.com>,
	John Fleck <john.fleck@intel.com>,
	Kaike Wan <kaike.wan@intel.com>,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Maor Gottlieb <maorg@nvidia.com>, Mark Bloch <markb@mellanox.com>,
	Mark Bloch <mbloch@nvidia.com>
Subject: Re: [PATCH rdma-rc 2/2] RDMA/core: Initialize lock when allocate a rdma_hw_stats structure
Date: Tue, 26 Oct 2021 09:05:54 -0300	[thread overview]
Message-ID: <20211026120554.GO2744544@nvidia.com> (raw)
In-Reply-To: <YXe8DaH6gSFvbEyu@unreal>

On Tue, Oct 26, 2021 at 11:27:57AM +0300, Leon Romanovsky wrote:
> On Mon, Oct 25, 2021 at 11:50:43AM -0300, Jason Gunthorpe wrote:
> > On Sun, Oct 24, 2021 at 09:08:21AM +0300, Leon Romanovsky wrote:
> > > From: Mark Zhang <markzhang@nvidia.com>
> > > 
> > > Initialize the rdma_hw_stats "lock" field when do allocation, to fix the
> > > warning below. Then we don't need to initialize it in sysfs, remove it.
> > 
> > This is a fine cleanup, but this does not describe the bug properly,
> > or have the right fixes line..
> 
> I think that this Fixes line should be instead.
> Fixes: 0a0800ce2a6a ("RDMA/core: Add a helper API rdma_free_hw_stats_struct")

No, I don't think so, it should be the commit that added
alloc_and_bind()

> > The issue is here:
> > 
> > static struct rdma_counter *alloc_and_bind(struct ib_device *dev, u32 port,
> > 					   struct ib_qp *qp,
> > 					   enum rdma_nl_counter_mode mode)
> > {
> > 	counter->stats = dev->ops.counter_alloc_stats(counter);
> > 	if (!counter->stats)
> > 		goto err_stats;
> > 
> > Which does not init counter->stat's mutex.
> 
> This is exactly what Mark is doing here.
> 
> alloc_and_bind()
>  -> dev->ops.counter_alloc_stats
>   -> mlx5_ib_counter_alloc_stats
>    -> do_alloc_stats()
>     -> rdma_alloc_hw_stats_struct()
>      -> mutex_init(&stats->lock); <- Mark's change.

Yes, I know, the patch is fine, the commit message just needs to be
accurate
 
> > And trim the oops reports, don't include the usless ? fns, timestamps
> > or other junk.
> 
> I don't like when people "beatify" kernel reports, many times whey are
> removing too much information.

There is too much junk in the raw oops messages

Jason

  reply	other threads:[~2021-10-26 12:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24  6:08 [PATCH rdma-rc 0/2] Two IB/core fixes Leon Romanovsky
2021-10-24  6:08 ` [PATCH rdma-rc 1/2] RDMA/sa_query: Use strscpy_pad instead of memcpy to copy a string Leon Romanovsky
2021-10-25 17:02   ` Jason Gunthorpe
2021-10-24  6:08 ` [PATCH rdma-rc 2/2] RDMA/core: Initialize lock when allocate a rdma_hw_stats structure Leon Romanovsky
2021-10-25 14:50   ` Jason Gunthorpe
2021-10-26  8:27     ` Leon Romanovsky
2021-10-26 12:05       ` Jason Gunthorpe [this message]
2021-10-26 12:21         ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211026120554.GO2744544@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=ira.weiny@intel.com \
    --cc=john.fleck@intel.com \
    --cc=kaike.wan@intel.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=markb@mellanox.com \
    --cc=markzhang@nvidia.com \
    --cc=mbloch@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).