netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: binoy.jayan@linaro.org
Cc: ariel.elior@qlogic.com, arnd@arndb.de, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bnx2x: Replace semaphore stats_lock with mutex
Date: Thu, 20 Oct 2016 14:27:36 -0400 (EDT)	[thread overview]
Message-ID: <20161020.142736.708413496078305369.davem@davemloft.net> (raw)
In-Reply-To: <1476953532-2019-1-git-send-email-binoy.jayan@linaro.org>

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.

      parent reply	other threads:[~2016-10-20 18:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  8:52 [PATCH] bnx2x: Replace semaphore stats_lock with mutex Binoy Jayan
2016-10-20  9:16 ` Arnd Bergmann
2016-10-20 18:27 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161020.142736.708413496078305369.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ariel.elior@qlogic.com \
    --cc=arnd@arndb.de \
    --cc=binoy.jayan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).