Paul Durrant wrote:
Garrett D'Amore wrote:
While this would make some drivers simpler (the lookup of the dev_t would be simpler), it isn't strictly necessary.

I think you could achieve the same basic result by just offering a new set of utility routines:

   * ddi_set_devt_private(dev_t, void *ctx);
   * void *ddi_get_devt_private(dev_t);

This would eliminate the trouble drivers have to go thru to come up with their own storage and retrieval logic, while not requiring a change to the entry points.

From an architectural standpoint I agree that common dev_t-to-context mapping would be nicer, but one can't discount the cost of going to a hash table (bearing in mind that dev_t space may be sparse, so array lookup may not be the best implementation). If the cb_op rate is high then the per-call hash lookup may be significant; which is possibly why implementation of such context lookup is best left in the hands of the driver (since it 'knows' its dev_t space and possibly its usage profile). Having a context pointer in the vnode (or snode) OTOH is simple and cheap, but does require an interface change.

I'm unconvinced that it is any cheaper. The question is ... how is the kernel DDI going to track these by dev_t. dev_ts don't point to structures. So the DDI implementation would either need to use a hash table itself, or would need to manage to track the state elsewhere, and I'm just not sure where it would be tracked. We need more information about the proposed underlying implementation, I think.

   -- Garrett



  Paul


_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to