Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1505171
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] bnx2x: Replace semaphore stats_lock with mutex |
| Date | 2016-10-20 20:30 +0200 |
| Message-ID | <suqgh-2Md-5@gated-at.bofh.it> (permalink) |
| References | <suhmG-5dC-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Binoy Jayan <binoy.jayan@linaro.org>
Date: Thu, 20 Oct 2016 14:22:12 +0530
> stats_lock is used as a simple mutex
No, it is not.
> @@ -1976,8 +1973,8 @@ int bnx2x_stats_safe_exec(struct bnx2x *bp,
> /* Wait for statistics to end [while blocking further requests],
> * then run supplied function 'safely'.
> */
> - rc = down_timeout(&bp->stats_lock, HZ / 10);
> - if (unlikely(rc)) {
> + rc = mutex_trylock(&bp->stats_lock);
> + if (unlikely(!rc)) {
It uses timeouts therefore this conversion is not 1 to 1.
You're losing functionality and potentially adding a regression.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] bnx2x: Replace semaphore stats_lock with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-10-20 11:00 +0200 Re: [PATCH] bnx2x: Replace semaphore stats_lock with mutex Arnd Bergmann <arnd@arndb.de> - 2016-10-20 11:20 +0200 Re: [PATCH] bnx2x: Replace semaphore stats_lock with mutex David Miller <davem@davemloft.net> - 2016-10-20 20:30 +0200
csiph-web