]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r354333,r354359: zfs: enable SPA_PROCESS on the kernel side
authorAndriy Gapon <avg@FreeBSD.org>
Fri, 22 May 2020 12:25:57 +0000 (12:25 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Fri, 22 May 2020 12:25:57 +0000 (12:25 +0000)
commit37561d535a4227758c20ec4933deb6460db6951c
treea6a1bef99c50b433834244127835703421a77294
parent2bebdf93b2af3e39c9b5f6de1918608bd4ac91c0
MFC r354333,r354359: zfs: enable SPA_PROCESS on the kernel side

The purpose of this change is to group kernel threads specific to a
particular ZFS pool under a kernel process.  There can be many dozens of
threads per pool.  This change improves observability of those threads.

This change consists of several subchanges:
1. illumos taskq_create_proc can now pass its process parameter to
taskqueue.  Also, use zfsproc instead of NULL for taskq_create.  Caveat:
zfsproc might not be initialized yet.  But in that case it is still NULL,
so not worse than before.

2. illumos sys/proc.h: kthread id is stored in t_did field, not t_tid.

3. zfs: enable SPA_PROCESS on the kernel side.  The change is a bit hairy
as newproc() is implemented privately to spa.c.  I couldn't think of a
better way to populate process name than to poke inside the argument for
the process routine.

4. illumos thread_create: allow assigning thread to process other than
zfsproc.

5. zfs: expose spa_proc to other users, assign sync and quiesce threads
to it.

Pool-specific threads created using (relatively new) zthr mechanism are
still assigned to the zfskern process rather than to a respective
zpool-xxx process.  I am going to address this a bit later.
sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
sys/cddl/compat/opensolaris/sys/proc.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c