From nobody Tue Aug 15 17:37:45 2023 X-Original-To: current@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 4RQJPm2Bq6z4qC4X for ; Tue, 15 Aug 2023 17:37:48 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RQJPm1gqjz4fFD for ; Tue, 15 Aug 2023 17:37:48 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692121068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QHegJcAr2ziZ2AQnStzY+ZlioBqBsjbYRT52c4bpuPc=; b=AckrAoV2vnPCecmzIpGHulyzRlf/3Vl3UhVs/4RkRVxWsZXYrTlWUy23MnaRSmCj0Ju6JD YhyKIu+w0VXQPrpZ7x+k8uIt3TP9hE8oyrVT+4+5Of5bDdm9CYf0sMwwMBRrPA7O4gJbNm rDTSFbVgYdLEBKp9LqJNytECiJGdXFEJzJ3F2Myk9/3X1NNy7/b2w1gtsX3AHkh0Jvvxri Bam4LBr0w/V1jPKNa0cDhByq3UWaMnpBgXFtbYkvs7wwEWdHlznWzyi6dF+Di7C9/SKdzN PewbwBtHSmbu/7D2nkrOrXfOs7NrdPSIvtk1RAschecc4im7waVNtLdx0JI9mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692121068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QHegJcAr2ziZ2AQnStzY+ZlioBqBsjbYRT52c4bpuPc=; b=nUSictF3uLjSZSGfVlWIMFKsMli/e9wrm1bUIrqSAlIKgdJ/0xFre2vG4rvUzjo959ICL6 3XoXsfDQkz85NgZIWaAhjvWNHgch5790fUuQylbWRxqgkVpfm9PEBM/FGFztMLappuz5W+ Ov7euxLRRHEn6TnpVQigorJq7NGOCaHlJu/qdd+omoR6HbPXXx8xtkb5QUrGcVMNKpY/1/ GIM05eABJgsxAEVVkbBuJm2YRKTtyFeprfBMrS66i/rqhFFe1+AjQtUCyZRMHSrxfUWeK0 jfBnkXEgV+IVmz9I3mg7bZ/QdguXxPJuX44zK8DOf9MONvQCyZzw2Up8yahBnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692121068; a=rsa-sha256; cv=none; b=Mnndu0FYXQUzljS/QETOdSNJ9BKJuBB9sw4dar73/noCfBhEc4hpXUZnr0KOn4Xn8sOTlU 8iRdtolkTemVtIefZQt3/G5gcqHLb94lRVhtTknmcBS+iLCvJtyN9ugf1edZmuCHvJJ7p6 AxF+Tam7cDYRPR1FNdSxuPbkRK14PC8GhMUxRg0HgHcVrt2IRKM1XWjrCqVfaZDqPq1CP0 T+5dC19obOOI0rJOFp9RnpPdgcw6zWsz+bdEbmRRyhBACMjW31ZWSMh1OqHJARsIyw3Jlh AidIuVmz4+qhT8zynImq2wMR13etZRS986EBVFsQMizMhLB+3KUDyb9advyL5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from ltc.des.no (ti0187a400-1976.bb.online.no [85.166.95.197]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RQJPl6vwgzw4R for ; Tue, 15 Aug 2023 17:37:47 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.no (Postfix, from userid 1001) id 3616318DC7; Tue, 15 Aug 2023 19:37:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: current@freebsd.org Subject: Re: ZFS deadlock in 14 In-Reply-To: <86350kqokl.fsf@ltc.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Tue, 15 Aug 2023 18:04:42 +0200") References: <86leeltqcb.fsf@ltc.des.no> <86h6p4s64h.fsf@ltc.des.no> <86a5utrafp.fsf@ltc.des.no> <86350kqokl.fsf@ltc.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix) Date: Tue, 15 Aug 2023 19:37:45 +0200 Message-ID: <86pm3op5p2.fsf@ltc.des.no> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The attached script successfully deadlocks 9228ac3a69c4. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=zfs-deadlock.sh #!/bin/sh : ${n:=$(nproc)} : ${pool:=zroot} basefs="${pool}/zfsdl" set -eu zfs destroy -r "${basefs}" >/dev/null 2>&1 || true zfs create -o com.sun:auto-snapshot=false "${basefs}" basedir="$(zfs get -H -o value mountpoint "${basefs}")" echo "preparing tarball..." >&2 tarball="${basedir}/zfsdl.tar" mkdir "${basedir}/src" (cd /usr/src ; find * -type d) | (cd "${basedir}/src" ; xargs mkdir -p) (cd /usr/src ; find * -type f) | (cd "${basedir}/src" ; xargs touch) tar cf "${tarball}" -C "${basedir}" src zfs_deadlock() { local fs=$1 dir zfs create "${fs}" dir="$(zfs get -H -o value mountpoint "${fs}")" zfs snapshot "${fs}@empty" while ! [ -f "${basedir}/stop" ] ; do echo "fill ${fs}..." >&2 tar xf "${tarball}" -C "${dir}" echo "rollback ${fs}..." >&2 zfs rollback -rR "${fs}@empty" done } for i in $(seq -w "${n}") ; do zfs_deadlock "${basefs}/${i}" & sleep 1 done wait echo "stop" >&2 zfs destroy -r "${basefs}" --=-=-=--