Re: [PATCH rdma-next v4 06/17] RDMA/counter: Add "auto" configuration mode support
From: Leon Romanovsky <leon@kernel.org>
Date: 2019-07-01 08:42:18
Also in:
linux-rdma
From: Leon Romanovsky <leon@kernel.org>
Date: 2019-07-01 08:42:18
Also in:
linux-rdma
On Sun, Jun 30, 2019 at 12:40:54AM +0000, Jason Gunthorpe wrote:
On Tue, Jun 18, 2019 at 08:26:14PM +0300, Leon Romanovsky wrote:quoted
+static void __rdma_counter_dealloc(struct rdma_counter *counter) +{ + mutex_lock(&counter->lock); + counter->device->ops.counter_dealloc(counter); + mutex_unlock(&counter->lock); +}Does this lock do anything? The kref is 0 at this point, so no other thread can have a pointer to this lock.
Yes, it is leftover from atomic_read implementation.
quoted
+ +static void rdma_counter_dealloc(struct rdma_counter *counter) +{ + if (!counter) + return;Counter is never NULL.
Ohh, right, I'll clean some code near rdma_counter_dealloc/__rdma_counter_dealloc. Thanks
Jason