Re: [PATCH v3 for-next 02/33] IB/core: Add kref to IB devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/28/2015 2:51 PM, Or Gerlitz wrote:
On Mon, Apr 27, 2015 at 11:25 AM, Matan Barak <matanb@xxxxxxxxxxxx> wrote:
On 4/26/2015 11:10 PM, Or Gerlitz wrote:
On Thu, Mar 26, 2015 at 12:19 AM, Somnath Kotur
<somnath.kotur@xxxxxxxxxx> wrote:

From: Matan Barak <matanb@xxxxxxxxxxxx>

Previously. we used device_mutex lock in order to protect
the device's list. That means that in order to guarantee a
device isn't freed while we use it, we had to lock all
devices.


Matan, looking on the cover letter, it says: "[...] Patch 0002 adds a
reference count mechanism to IB devices. This mechanism is similar to
dev_hold and dev_put available for net devices. This is mandatory for
later patches [...]"

Correct, I'll change that into:
Currently we use device_mutex lock for protecting the device's list. In the
current approach, in order to guarantee a device isn't freed we have to lock
all devices.
Adding a kref per IB device. Before an IB device is unregistered, we wait
until it's not held anymore.

Why is this change mandatory for the proposed design?


The cleanup of roce_gid_cache is done in a different context, so we need to make sure the device is still alive while doing so. In addition, we don't want that the unregistration process of ib_core will free our context data.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux