Discussion:
Queue locking control in loadable modules
Gary Schumacher
2006-05-10 15:36:01 UTC
Permalink
We are making use of the lis_register_driver_qlock_option method to
remove the qlock protection on some of our drivers and have some
question on the correct way to use it. If the driver is a clone driver
I suspect that we would use the major number returned by the register
call. What is the queue locking state of the clone driver and do we
need to control this also?

Thanks
Gary Schumacher



SPECIAL NOTICE

All information transmitted hereby is intended only for the use of the
addressee(s) named above and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
of confidential and privileged information is prohibited. If the reader
of this message is not the intended recipient(s) or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that you must not read this transmission and that disclosure,
copying, printing, distribution or use of any of the information contained
in or attached to this transmission is STRICTLY PROHIBITED.

Anyone who receives confidential and privileged information in error should
notify us immediately by telephone and mail the original message to us at
the above address and destroy all copies. To the extent any portion of this
communication contains public information, no such restrictions apply to that
information. (gate01)
Steve Schefter
2006-05-10 16:34:17 UTC
Permalink
Hi Gary.
Post by Gary Schumacher
We are making use of the lis_register_driver_qlock_option method to
remove the qlock protection on some of our drivers
I trust you are not doing anything SMP. Realize that this probably
puts you on the bleeding edge, even on uP. Are you having some
difficulty with the default LIS_QLOCK_QUEUE? Or is it performance
related (not sure this change would help that)?
Post by Gary Schumacher
and have some
question on the correct way to use it. If the driver is a clone driver
I suspect that we would use the major number returned by the register
call.
Although I have not used this function, that's the way I read
the code.
Post by Gary Schumacher
What is the queue locking state of the clone driver and do we
need to control this also?
The stream head corresponding to the stream containing your
driver queues uses LIS_QLOCK_QUEUE (see the lis_set_q_sync() call
in lis_stropen()). You can't control that from the outside (ie,
you'd have to make code changes to LiS).

Regards,
Steve

------------------------------------------------------------------------
Steve Schefter phone: +1 705 725 9999 x26
The Software Group Limited fax: +1 705 725 9666
642 Welham Road, email: ***@wanware.com
Barrie, Ontario CANADA L4N 9A1 Web: www.wanware.com
Brian F. G. Bidulock
2006-05-10 18:12:36 UTC
Permalink
Gary,
Post by Gary Schumacher
We are making use of the lis_register_driver_qlock_option method to
remove the qlock protection on some of our drivers and have some
question on the correct way to use it. If the driver is a clone
driver
If you mean that you are using the option in an attempt to remove private
locks from your fully MP-safe drivers, that would be a bad idea from the
perspective of STREAMS design. Fully MP-safe drivers are always preferred
to using any STREAMS synchronization. Also, the synchronization added to
LiS 2.18.0 has never been tested and fails inspection in a number of places.

It is easy to crash or lock a kernel on LiS 2.18 on SMP kernels (does not
even have to be an SMP machine).

OpenSS7 project drivers lock up easinly on LiS 2.18 in this fashion and
use private locks and are MP-safe. The very same drivers run on Linux
Fast-STREAMS under full SMP without any locking problems.

If you are considering using LiS syncrhonization mechanisms because you
are experiencing kernel locks or crashes on SMP, the problem is most
likely LiS, not the locking in your driver.
Post by Gary Schumacher
I suspect that we would use the major number returned by the register
call. What is the queue locking state of the clone driver and do we
need to control this also?
Yes lis_register_driver_qlock_option uses the major number returned by the
register call and is applicable to all clone minors of the major device
number.

--brian
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Loading...