From nobody Wed Jun 18 02:13:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMS2Z2fctz5q6W9; Wed, 18 Jun 2025 02:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMS2Y665fz41jM; Wed, 18 Jun 2025 02:13:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750212805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axzoLkl9mXq3o0Dl5VcXFu2g2ydTyC4LJ1IMS6d9pC0=; b=kfCDUJBlAe+hbjNyh6pgMqCZfI1DDtjw7Nd8teI8ARM1QssZ6CT5P15tAwj0e2E/Z/yAvj a7LHR4jYDC/u7bjjzhuIdKlMRQhkr11+U17PHKAw1gucCppzY1YpZmDJnI8wejiYR9swyg 10d+tvgP2vPYH8hhsDnip18exYov8VDY569H3YHC2i1zDLnj8lFc0NcXVrML9ANwGFOg5I stIm9mm8XowZj4xePSOOjE7qF13PlO3E2Kx0EmVT+LpyCYkzqylIgkRtkCuYvEe29UNOWq qdX+MYqeM35Qwt+/llveC8OxrUXoUDuWH7NjMFNTNybD+uTS/KE3CDJ26q3vOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750212805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axzoLkl9mXq3o0Dl5VcXFu2g2ydTyC4LJ1IMS6d9pC0=; b=IkCW/3FcDnZA0M95GWnWldAIO2GHFEX1cE5wSN2zwTprNLiSjeqh4kq5mHQOjDQKwJl1ng uEHBdxur07kO60ONKwuAws0ZpBaaijbz1PJgC3Z0SaTTUh7Ak72hRu1hzVdVWE3kCKRwKQ 8q6tL71gGLmAU9b+f5NZJZ9RohCeahD+PCtumnP1K/cdVt+OYF+T3nygZk+j6YheidkKW3 I2kU7MDDQNASqxkSI/rWYibVCV29Q6ryjPlhvK42Zx7SHe4/T5dO+2OGNEdYky02E83DeF yTCIiVgj9vQXkSyuSN5CD0KvVXK4sHw4e0t2qK0gBH2Hs+MXG5whGtBYvWbKVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750212805; a=rsa-sha256; cv=none; b=LjnfxRi6sWJbe2CcE/ep9XJT0k9x8ecRZ8I7H+q8LEnqtEGw1BodFtlCWy8CiOQ9AUkF6R W5E4bTMwKaH5IuUQipLnCPm/MI4mR2DY/uner8Th86ywiA36pc3Ufnasy4bwi8gQIvgBZN XLx4h395EmY0WNbXarPTh7VlQ139Vbgp2FzOMog66PdAH1DfVTnR+O7OrQpjjgnmkmTlKo UvnhHvOFpeSZS8nSKvBFURN1vZtlljxzLIZHz/W2jOfF29A5c/aELajZA5vlp3NYbK/e9G wtGEvhcC9zMuxhtZFZtKQDqYi2Tb//ppQgkWmgTX3veTZopUPotjOTsqW8Qf/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMS2Y5bR1z18fZ; Wed, 18 Jun 2025 02:13:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55I2DPTD024478; Wed, 18 Jun 2025 02:13:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I2DPrR024475; Wed, 18 Jun 2025 02:13:25 GMT (envelope-from git) Date: Wed, 18 Jun 2025 02:13:25 GMT Message-Id: <202506180213.55I2DPrR024475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: fd141584cf89 - main - zfs: spa: ZIO_TASKQ_ISSUE: Use symbolic priority List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd141584cf89d7d24543ef5be83c6927a5d67ffa Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fd141584cf89d7d24543ef5be83c6927a5d67ffa commit fd141584cf89d7d24543ef5be83c6927a5d67ffa Author: Olivier Certner AuthorDate: 2024-05-21 14:23:32 +0000 Commit: Olivier Certner CommitDate: 2025-06-18 02:08:02 +0000 zfs: spa: ZIO_TASKQ_ISSUE: Use symbolic priority This allows to change the meaning of priority differences in FreeBSD without requiring code changes in ZFS. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 --- .../openzfs/include/os/freebsd/spl/sys/proc.h | 4 +++- .../openzfs/include/os/linux/spl/sys/sysmacros.h | 4 +++- sys/contrib/openzfs/include/sys/zfs_context.h | 4 +++- sys/contrib/openzfs/module/zfs/spa.c | 21 +++------------------ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h index a03b815a22a6..c6bc10d6babe 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h @@ -45,7 +45,9 @@ #ifdef _KERNEL #define CPU curcpu #define minclsyspri PRIBIO -#define defclsyspri minclsyspri +#define defclsyspri minclsyspri +/* Write issue taskq priority. */ +#define wtqclsyspri ((PVM + PRIBIO) / 2) #define maxclsyspri PVM #define max_ncpus (mp_maxid + 1) #define boot_max_ncpus (mp_maxid + 1) diff --git a/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h b/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h index e932ea72f1be..db48222b712a 100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h @@ -92,8 +92,10 @@ * Treat shim tasks as SCHED_NORMAL tasks */ #define minclsyspri (MAX_PRIO-1) -#define maxclsyspri (MAX_RT_PRIO) #define defclsyspri (DEFAULT_PRIO) +/* Write issue taskq priority. */ +#define wtqclsyspri (MAX_RT_PRIO + 1) +#define maxclsyspri (MAX_RT_PRIO) #ifndef NICE_TO_PRIO #define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20) diff --git a/sys/contrib/openzfs/include/sys/zfs_context.h b/sys/contrib/openzfs/include/sys/zfs_context.h index b3d48e257538..256c9c2cc2d3 100644 --- a/sys/contrib/openzfs/include/sys/zfs_context.h +++ b/sys/contrib/openzfs/include/sys/zfs_context.h @@ -623,8 +623,10 @@ extern void delay(clock_t ticks); * Process priorities as defined by setpriority(2) and getpriority(2). */ #define minclsyspri 19 -#define maxclsyspri -20 #define defclsyspri 0 +/* Write issue taskq priority. */ +#define wtqclsyspri -19 +#define maxclsyspri -20 #define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1)) #define CPU_SEQID_UNSTABLE CPU_SEQID diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c index 29c1d4ddf47c..7bc659da6279 100644 --- a/sys/contrib/openzfs/module/zfs/spa.c +++ b/sys/contrib/openzfs/module/zfs/spa.c @@ -1231,29 +1231,14 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q) spa->spa_proc, zio_taskq_basedc, flags); } else { #endif - pri_t pri = maxclsyspri; /* * The write issue taskq can be extremely CPU * intensive. Run it at slightly less important * priority than the other taskqs. - * - * Under Linux and FreeBSD this means incrementing - * the priority value as opposed to platforms like - * illumos where it should be decremented. - * - * On FreeBSD, if priorities divided by four (RQ_PPQ) - * are equal then a difference between them is - * insignificant. */ - if (t == ZIO_TYPE_WRITE && q == ZIO_TASKQ_ISSUE) { -#if defined(__linux__) - pri++; -#elif defined(__FreeBSD__) - pri += 4; -#else -#error "unknown OS" -#endif - } + const pri_t pri = (t == ZIO_TYPE_WRITE && + q == ZIO_TASKQ_ISSUE) ? + wtqclsyspri : maxclsyspri; tq = taskq_create_proc(name, value, pri, 50, INT_MAX, spa->spa_proc, flags); #ifdef HAVE_SYSDC