[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130813105719.09222122@nehalam.linuxnetplumber.net>
Date: Tue, 13 Aug 2013 10:57:19 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: David Miller <davem@...emloft.net>
Cc: dmitry@...adcom.com, netdev@...r.kernel.org, eilong@...adcom.com,
ariele@...adcom.com
Subject: Re: [PATCH net v5 1/5] bnx2x: protect different statistics flows
On Mon, 12 Aug 2013 21:24:02 -0700 (PDT)
David Miller <davem@...emloft.net> wrote:
> From: Stephen Hemminger <stephen@...workplumber.org>
> Date: Mon, 12 Aug 2013 17:12:08 -0700
>
> > On Tue, 13 Aug 2013 02:24:59 +0300
> > "Dmitry Kravkov" <dmitry@...adcom.com> wrote:
> >
> >> + bool stats_started;
> >> + struct semaphore stats_sema;
> >
> > Is there a reason to use a counting semaphore? Do you expect it to
> > be held across user process boundary? or want count > 1?
> >
> > Use of semaphores as a locking primitive is discouraged,
> > instead us a mutex.
>
> Would you please look at the feedback I gave these guys to the
> previous iteration of these changes?
>
> They were using custom locking primitives and semaphores gave
> the best approximation to the semantics they were looking for.
Your right in this case sempahore makes sense because it is
used to hold off process while hardware responds.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists