Hi,

 I was looking for examples of taskq usage in the kernel code and
 see the following code in usr/src/uts/common/fs/zfs/zio.c

 ...
  1744          if ((1U << zio->io_stage) & zio->io_async_stages) {
  1745                  if (zio->io_stage < ZIO_STAGE_VDEV_IO_DONE)
  1746                          tq = 
zio->io_spa->spa_zio_issue_taskq[zio->io_type];
  1747                  else
  1748                          tq = 
zio->io_spa->spa_zio_intr_taskq[zio->io_type];
  1749                  (void) taskq_dispatch(tq,
  1750                      (task_func_t *)zio_pipeline[zio->io_stage], 
zio, TQ_SLEEP);

 It seems to me spa_zio_intr_taskq is used when we are in an interrupt 
context
 (I/O completion interrupt). If so, why is it safe to use TQ_SLEEP here?

 I plan to do some thing similar (notify a client of an I/O completion) 
in some KCF code
 and hence the interest.

Thanks,
-Krishna

Reply via email to