[Ksummit-2008-discuss] topic proposal

Roland Dreier rdreier at cisco.com
Tue Aug 26 18:32:05 PDT 2008


 > I've seen loads semaphores used as mutexes, and loads used as regular
 > signaling completions. What remains outside of those two is the wild
 > un-maintainable stuff that , I think, we really don't want..

Take a look at, say, drivers/net/mlx4/cmd.c.  That uses a semaphore to
count how many firmware commands are outstanding, and block until a
command completes when the maximum number of commands are already
queued.  Which of your cases does that fall into?  It's not a mutex,
it's not a completion, and I really don't think it's anything that's
wild or un-maintainable.

I think it would be fine if we wanted to introduce a new primitive for
cases such as this (queue up to N of some operation, and allow another
operation to start when one completes), and I believe there were some
ideas about that floating around.  But I'm not sure I buy the assertion
that there are no legitimate uses for semaphores other than for
implementing mutexes and completions.

 - R.


More information about the Ksummit-2008-discuss mailing list