Skip to content

Commit

Permalink
connector/cn_proc: revert "connector: Fix proc_event_num_listeners co…
Browse files Browse the repository at this point in the history
…unt not cleared"

This reverts commit c46bfba ("connector: Fix proc_event_num_listeners
count not cleared").

It is not accurate to reset proc_event_num_listeners according to
cn_netlink_send_mult() return value -ESRCH.

In the case of stress-ng netlink-proc, -ESRCH will always be returned,
because netlink_broadcast_filtered will return -ESRCH,
which may cause stress-ng netlink-proc performance degradation.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-lkp/[email protected]
Fixes: c46bfba ("connector: Fix proc_event_num_listeners count not cleared")
Signed-off-by: Keqi Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
wangkeqichris authored and Paolo Abeni committed Feb 13, 2024
1 parent f1acf1a commit 8929f95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/connector/cn_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ static inline void send_msg(struct cn_msg *msg)
filter_data[1] = 0;
}

if (cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
cn_filter, (void *)filter_data) == -ESRCH)
atomic_set(&proc_event_num_listeners, 0);
cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
cn_filter, (void *)filter_data);

local_unlock(&local_event.lock);
}
Expand Down

0 comments on commit 8929f95

Please sign in to comment.