From: Yuval Mintz <Yuval.Mintz@qlogic.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Ariel Elior <Ariel.Elior@qlogic.com>
Subject: RE: [PATCH v2 net] bnx2x: Fix statistics locking scheme
Date: Thu, 19 Mar 2015 07:26:25 +0000 [thread overview]
Message-ID: <B5657A6538887040AD3A81F1008BEC63C1401F@avmb3.qlogic.org> (raw)
In-Reply-To: <20150318.151059.979411313448939306.davem@davemloft.net>
> > +int bnx2x_stats_safe_exec(struct bnx2x *bp,
> > + void (func_to_exec)(void *cookie),
> > + void *cookie)
> ...
> > + if (bp->stats_pending) {
> > + BNX2X_ERR("Failed to wait for stats pending to clear\n");
> > + return -EBUSY;
>
> Buggy, this returns with the stats_lock still held.
Ouch; You're right - I'll fix it.
>
> In my humble opinion, you are putting very little care and effort into this bug fix.
Well, we've put quite a bit in the logic behind it; But you're probably right
About the effort put into v2.
> Also I disagree with your timeout logic.
>
> I suspect that the real reason these timeouts are present, is that the locking
> hierarchy is uncertain.
>
> Nothing really should create the situation those trylocks seem to be dealing
> with.
Actually, you're probably right in the assumption - I have a feeling that due to
the races in the previous implementation, there was lack of confidence in the
general process.
According to my current analysis there shouldn't be any real need for the limit
on time, since there are no limitless loops taking place while the locks are being
held [at most, HW/FW is asserted and nothing happens; But it still should take
only a couple of mili-seconds].
The only reason I've left this was to leave the implementation close as I can to
original [which used that locking mechanism] given that it's intended to `net'.
Do you prefer I simply switch over into using a regular mutex?
next prev parent reply other threads:[~2015-03-19 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 14:14 [PATCH v2 net] bnx2x: Fix statistics locking scheme Yuval Mintz
2015-03-18 19:10 ` David Miller
2015-03-19 7:26 ` Yuval Mintz [this message]
2015-03-19 16:23 ` David Miller
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=B5657A6538887040AD3A81F1008BEC63C1401F@avmb3.qlogic.org \
--to=yuval.mintz@qlogic.com \
--cc=Ariel.Elior@qlogic.com \
--cc=davem@davemloft.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.