From nobody Thu Aug 17 18:57:31 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 4RRZ5P01KKz4q1nL for ; Thu, 17 Aug 2023 18:58:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RRZ5M1xRwz3WGG; Thu, 17 Aug 2023 18:57:59 +0000 (UTC) (envelope-from mavbsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=AimYHsDc; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::b32 as permitted sender) smtp.mailfrom=mavbsd@gmail.com; dmarc=none Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-d66f105634eso166328276.1; Thu, 17 Aug 2023 11:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692298678; x=1692903478; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=Ro6sCefiCQUu/12q5Ri7oUSpPLgBhdMYdIPWQwjtctA=; b=AimYHsDcmd30rCZ8QzMFdQheWglJ/3NSJ3uxHiVC7fpzKUaEpS0hd4sAwNGAoW1xQO aOwEX5y46mmVxnskxF60kQ2R4H2TPP9i/ibSZaE1tDVvzdMAPi92i071HY1O6WvX6Bew y9puOyLnATaeG5VGAJWmlDSfaOn27EKrySZjjQcwfOluzu5AcZt6V0IvQHWejJlD5k+a 3jxT1ldKysxMWQbenXpm6zF5I4ty9/rmOQI1TXaSZcgsEG7z3OGirNLDXtU/t4A/mGAl R4cwI09kZJiaVeygT7f1+19AZcCjkxaaMPWXeHrgjliCY9CWqzSWupbwlOvZX/DiOQfO GwEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692298678; x=1692903478; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ro6sCefiCQUu/12q5Ri7oUSpPLgBhdMYdIPWQwjtctA=; b=lE8qxJDD4+1lSIZPUsI4Xw+doPATxNaPi5mUr4rpvCVtYjDzXhOhD5LupsM8H8SHiU 7pS5uozUtavxObxh5wS3myj7sqAxTdCwvBa5YXU0xpiTrNRplerLxtyjgL5j4q4C6m1W 1xm/eqRU5aiIH1rfEz1uPl4fIrcqnNRoDiZ/VIefl2Dj+QFtCxujHKx70X2k1fO0knDb DYRe3sACjvgYocgxJYotTq0iwaSb+8GRz7ogLIHyoqdBjyll+J4HdZ1dQeaCvoLUbNHo 50G7KutzTVXQJLaJHy996qE5yG7wB3r6qEYLvbxVzL/rKPAncWnT9RlLYti+o/p0llNh oypw== X-Gm-Message-State: AOJu0YyEiylXmOBnfTzUL35Lx5G7LoNcHGyAOlTeQjwts9lOikh9Yfd+ 7bj1VJc7IuPuhR+/vdQhpCg+JW28T+s= X-Google-Smtp-Source: AGHT+IFKRQhbHx5VuGyhZ+lBB8gcfy+KSteNUMK24s3d6TSTIsJd+GATWEceqWNDmIqNSeCKUPvL8g== X-Received: by 2002:a25:3615:0:b0:d32:cd49:2469 with SMTP id d21-20020a253615000000b00d32cd492469mr459811yba.24.1692298677912; Thu, 17 Aug 2023 11:57:57 -0700 (PDT) Received: from [10.230.45.5] ([38.32.73.2]) by smtp.gmail.com with ESMTPSA id 193-20020a2502ca000000b00d71def6d29fsm25195ybc.12.2023.08.17.11.57.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Aug 2023 11:57:57 -0700 (PDT) Message-ID: <197ead1e-210a-6be6-7e24-5c56b14bb777@FreeBSD.org> Date: Thu, 17 Aug 2023 14:57:31 -0400 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: current@freebsd.org, Mateusz Guzik , Martin Matuska References: <86leeltqcb.fsf@ltc.des.no> <86h6p4s64h.fsf@ltc.des.no> <86a5utrafp.fsf@ltc.des.no> <86350kqokl.fsf@ltc.des.no> <86y1icp95t.fsf@ltc.des.no> <86ttt0p8wv.fsf@ltc.des.no> Content-Language: en-US From: Alexander Motin Subject: Re: ZFS deadlock in 14 In-Reply-To: <86ttt0p8wv.fsf@ltc.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b32:from]; DMARC_NA(0.00)[freebsd.org]; MLMMJ_DEST(0.00)[current@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; FREEMAIL_CC(0.00)[freebsd.org,gmail.com,FreeBSD.org]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4RRZ5M1xRwz3WGG On 15.08.2023 12:28, Dag-Erling Smørgrav wrote: > Mateusz Guzik writes: >> Going through the list may or may not reveal other threads doing >> something in the area and it very well may be they are deadlocked, >> which then results in other processes hanging on them. >> >> Just like in your case the process reported as hung is a random victim >> and whatever the real culprit is deeper. > > We already know the real culprit, see upthread. Dag, I looked through the thread once more, and, while thank you for tracing it, but you never went beyond txg_wait_synced() in `zfs revert` thread. If you are saying that thread is holding the lock, then the question is why transaction commit is stuck. I need to see stacks for ZFS sync threads, or better all kernel stacks, just in case. Without that information I can only speculate. Trying to run your test (so far without reproduction) I see it producing a substantial amount of ZIL writes. The range of commits you reduced the scope to so far includes my ZIL locking refactoring, where I know for sure are some deadlocks. I am already waiting for 3 weeks now for reviews and tests for PR that should fix it: https://github.com/openzfs/zfs/pull/15122 . It would be good if you could test it, though it seems to depend on few more earlier patches not merged to FreeBSD yet. -- Alexander Motin