> Our driver using the following flags in its cb_ops structure:
 > ( D_NEW | D_MP | D_MTOUTEPERIM | D_MTOCEXCL ).
 > I understand that this set of flags will make the open & close routines
 > synchronous.

The open and close routines are *always* synchronous.  D_MTOCEXCL makes
sure there's only one thread in open or close at a time across all the
instances of the driver in the system (basically, it forces the outer
perimeter to be entered exclusively for those entrypoints).  BTW, the
D_NEW flag above does nothing (it expands to 0x0) and should be removed.

 > My question is - do I need to add the D_MTPUTHSARED, D_MTPERQ, and
 > _D_MTSVCSHARED flags to make sure read and write queue put & service
 > routines can run concurrently ?

No -- D_MP does that already.  For an inner perimeter, you have four
basic choices:

        * D_MP: effectively no inner perimeter.
        * D_MTPERQ: inner perimeter around each queue.
        * D_MTQPAIR: inner perimeter around each queuepair.
        * D_MTPERMOD: inner perimeter around all queuepairs.

Since the inner perimeter is always exclusively by default, D_MP is the
highest level of concurrency, and flags like D_MTPUTSHARED make no sense
with it.  You can approximate D_MP to some degree by combining coarser
perimeters with e.g. D_MTPUTSHARED and the like, but there's no reason to
do that unless you have a specific reason to not be D_MP.  As an aside:
_D_MTSVCSHARED is not a public interface (hence the leading underscore).
Do not use it.

Hope this helps,
--
meem
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to