From owner-freebsd-current@freebsd.org Tue Sep 29 13:42:48 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F084424191 for ; Tue, 29 Sep 2020 13:42:48 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C10vD0p4gz4p7b; Tue, 29 Sep 2020 13:42:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x82f.google.com with SMTP id 19so3542946qtp.1; Tue, 29 Sep 2020 06:42:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=T8ADC5HZfx5BEKxWsA5f0ozV174bMAve6fIJsWs3xRE=; b=in2bdwRIUTNIkMMfE3MFNaxzDhagjwFZa81G/jvNZrTopZapDJfQRq18E4CDgUMdXK cvnPEDdbiV6EnwvIwpVhH5zKt7z5IuYSQJ1QEmDff6kxAkbXrw8GrII9/OHQqpKO6C15 0DFa1R/jBhjlo8ReGZMCrrBUilXTMkHpU+rRk5Qz0cALI4/IHYzfOAJv0l/adi1Lnwzz 60OHM6jxPuWX5GVCWaD7DSglZOH9KU7fNas/+MW73un5tKk/P2LkIgzzHi1iPM2HG3c8 MjLIAYvJW9Rn/B6xJM+bU31NXL0uATtiv2wVFVRekJM8cl5WiP504oybbcFNA0u8eE2v is2g== X-Gm-Message-State: AOAM533IUcETDH9A5pnbLDZc6WqShAPP2vHYtrxFMlOHR0ZQ2bEc9bPj DwyJJVicXKvInxsA2J7BtWNLsvR0cn09XQ== X-Google-Smtp-Source: ABdhPJxGAz+3UAvoUmguCrUXb7fv5OZj03pCpyilIjszlm+1g2TWSa6+GZIyZzFVR64RxIpaBZ6RBA== X-Received: by 2002:ac8:3261:: with SMTP id y30mr3419039qta.242.1601386966895; Tue, 29 Sep 2020 06:42:46 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-77-103.dsl.bell.ca. [174.88.77.103]) by smtp.gmail.com with ESMTPSA id f3sm5238133qtg.71.2020.09.29.06.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 06:42:46 -0700 (PDT) Sender: Mark Johnston Date: Tue, 29 Sep 2020 09:42:44 -0400 From: Mark Johnston To: Michael Zhilin Cc: Konstantin Belousov , freebsd-current@freebsd.org Subject: Re: Possible deadlock on IO / page fault Message-ID: <20200929134244.GB26914@raichu> References: <20200929132026.GS2643@kib.kiev.ua> <20200929133159.GA26914@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4C10vD0p4gz4p7b X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 13:42:48 -0000 On Tue, Sep 29, 2020 at 04:35:47PM +0300, Michael Zhilin wrote: > Thank you, Kostya and Mark! > I will update to head. :) Be sure to pick up r366252 or later: there is a related bug in the initial OpenZFS import that is fixed by that revision. > On Tue, Sep 29, 2020 at 4:32 PM Mark Johnston wrote: > > > On Tue, Sep 29, 2020 at 04:20:26PM +0300, Konstantin Belousov wrote: > > > On Tue, Sep 29, 2020 at 02:59:43PM +0300, Michael Zhilin wrote: > > > > Hi, > > > > > > > > I'm using FreeBSD 13-CURRENT (pre-ZoF, r359724) on my laptop with > > installed > > > > Gnome. Sometimes > > > > (once a week/month) gnome hangs and the system may be still responsible > > > > (may be not). > > > > This week it happened again and I've gathered information via > > ddb/textdump > > > > and rebooted laptop. > > > > > > > > gnome-shell is trying to get exclusive lock on some directory > > according to > > > > information > > > > from "show alllocks" and "bt": > > > > > > > > [...] > > > > Tracing command evolution pid 4536 tid 101436 td 0xfffffe00bf484c00 > > > > sched_switch() at sched_switch+0x5b2/frame 0xfffffe00bfd446e0 > > > > mi_switch() at mi_switch+0x155/frame 0xfffffe00bfd44700 > > > > sleepq_switch() at sleepq_switch+0x11a/frame 0xfffffe00bfd44740 > > > > _cv_wait() at _cv_wait+0x15a/frame 0xfffffe00bfd447a0 > > > > rangelock_enter() at rangelock_enter+0x306/frame 0xfffffe00bfd447f0 > > > This call to rangelock_enter() looks suspicious. This is a call to ZFS > > > own rangelocks, not our rangelocks. Still, if write took rangelock on > > the > > > same range, we get a deadlock due to LoR between rangelock and page busy. > > > > This was fixed by r361287. In particular zfs_getpages() will no longer > > block on the ZFS range lock, exactly because of this deadlock. So I > > would suggest updating to that revision or later. > > > > > > zfs_freebsd_getpages() at zfs_freebsd_getpages+0x14f/frame > > > > 0xfffffe00bfd448a0 > > > > vnode_pager_getpages() at vnode_pager_getpages+0x37/frame > > > > 0xfffffe00bfd448e0 > > > > vm_pager_get_pages() at vm_pager_get_pages+0x4f/frame > > 0xfffffe00bfd44930 > > > > vm_fault() at vm_fault+0x780/frame 0xfffffe00bfd44a40 > > > > vm_fault_trap() at vm_fault_trap+0x6e/frame 0xfffffe00bfd44a80 > > > > trap_pfault() at trap_pfault+0x1ee/frame 0xfffffe00bfd44ae0 > > > > trap() at trap+0x44c/frame 0xfffffe00bfd44bf0 > > > > calltrap() at calltrap+0x8/frame 0xfffffe00bfd44bf0 > > > > --- trap 0xc, rip = 0x80a55de3f, rsp = 0x7fffffffcc60, rbp = > > > > 0x7fffffffcc60 --- > >