MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zio_taskq_dispatch

Function zio_taskq_dispatch

freebsd/contrib/openzfs/module/zfs/zio.c:1862–1902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860 */
1861
1862static void
1863zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boolean_t cutinline)
1864{
1865 spa_t *spa = zio->io_spa;
1866 zio_type_t t = zio->io_type;
1867 int flags = (cutinline ? TQ_FRONT : 0);
1868
1869 /*
1870 * If we're a config writer or a probe, the normal issue and
1871 * interrupt threads may all be blocked waiting for the config lock.
1872 * In this case, select the otherwise-unused taskq for ZIO_TYPE_NULL.
1873 */
1874 if (zio->io_flags & (ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_PROBE))
1875 t = ZIO_TYPE_NULL;
1876
1877 /*
1878 * A similar issue exists for the L2ARC write thread until L2ARC 2.0.
1879 */
1880 if (t == ZIO_TYPE_WRITE && zio->io_vd && zio->io_vd->vdev_aux)
1881 t = ZIO_TYPE_NULL;
1882
1883 /*
1884 * If this is a high priority I/O, then use the high priority taskq if
1885 * available.
1886 */
1887 if ((zio->io_priority == ZIO_PRIORITY_NOW ||
1888 zio->io_priority == ZIO_PRIORITY_SYNC_WRITE) &&
1889 spa->spa_zio_taskq[t][q + 1].stqs_count != 0)
1890 q++;
1891
1892 ASSERT3U(q, <, ZIO_TASKQ_TYPES);
1893
1894 /*
1895 * NB: We are assuming that the zio can only be dispatched
1896 * to a single taskq at a time. It would be a grievous error
1897 * to dispatch the zio to another taskq at the same time.
1898 */
1899 ASSERT(taskq_empty_ent(&zio->io_tqent));
1900 spa_taskq_dispatch_ent(spa, t, q, (task_func_t *)zio_execute, zio,
1901 flags, &zio->io_tqent);
1902}
1903
1904static boolean_t
1905zio_taskq_member(zio_t *zio, zio_taskq_type_t q)

Callers 7

zio_notify_parentFunction · 0.85
zio_issue_asyncFunction · 0.85
zio_interruptFunction · 0.85
__zio_executeFunction · 0.85
zio_ddt_read_doneFunction · 0.85
zio_allocate_dispatchFunction · 0.85
zio_vdev_io_assessFunction · 0.85

Calls 2

spa_taskq_dispatch_entFunction · 0.85
taskq_empty_entFunction · 0.50

Tested by

no test coverage detected