]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
devlink: Rework devlink health reporter destructor
authorVladyslav Tarasiuk <vladyslavt@mellanox.com>
Fri, 10 Jul 2020 12:25:08 +0000 (15:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jul 2020 21:32:02 +0000 (14:32 -0700)
commit3c5584bf0a0493e8d232ade65f4b9c5e995f3a0c
tree0f400f9ec0b31b4f3a7d5f40d6da03159568ecee
parentc57544b3dec4480c1b455a43f18be5ec91ab3136
devlink: Rework devlink health reporter destructor

Devlink keeps its own reference to every reporter in a list and inits
refcount to 1 upon reporter's creation. Existing destructor waits to
free the memory indefinitely using msleep() until all references except
devlink's own are put.

Rework this mechanism by moving memory free routine to a separate
function, which is called when the last reporter reference is put.

Besides, it allows to call __devlink_health_reporter_destroy() while
locked on a reporters list mutex in symmetry to
__devlink_health_reporter_create(), which is required in follow-up
patch.

Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c