From owner-freebsd-current@freebsd.org Tue Sep 29 13:32:07 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 118DB4231F2 for ; Tue, 29 Sep 2020 13:32:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 4C10fs6TRJz4n9k; Tue, 29 Sep 2020 13:32:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x831.google.com with SMTP id y11so3498579qtn.9; Tue, 29 Sep 2020 06:32:05 -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=GPyfonuuWwT+qIzCLryAx6GU5WPvx9+JgWOXINYO4ag=; b=Nf8GKT4Jevtlx/SsJiqYzTeBStrwC28swFMcyfkPm8aFQGyMtFBNLcpqfhNNbOH2tC oZ6p89dhxc3/bNINW1dISmLlZTUj8lm2eKk9agPaoKq5FO40W33r8ZYU38WItIDuCP35 GDX3iJZkOR29hbNHA4k2SsOuzkWQcqR5TUWtA7sO+Md/gv3IouZhRrOynuXOYfrJmj9P 43UOCi/KAVPziX7plV/B3S9RPn7bLlXb7RIPZ70ipeY1rjNgl48EN1OA3AMANP1ipd5t 0tMSU0TqrWU0kqQazr1rb5fTZ/ooSncXsifPUMDGADret5mX+swoeRoQ0MzEBhTGyKe0 g28A== X-Gm-Message-State: AOAM530vwEQQaqSi1lP6h0pNoGCGCjNhx4/I/oHtGxz6QVIsPmMQyoDl jxXkYJZElrnuOd78wDARMLA= X-Google-Smtp-Source: ABdhPJzIb7sze7hW2RC/T4ZERv3CqlTPxf09pUYvGd+E/REd65pWK4Oy5dhBVAKo5sycI4GTsC1sJg== X-Received: by 2002:ac8:544f:: with SMTP id d15mr3385293qtq.378.1601386324674; Tue, 29 Sep 2020 06:32:04 -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 i5sm4217263qko.86.2020.09.29.06.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 06:32:03 -0700 (PDT) Sender: Mark Johnston Date: Tue, 29 Sep 2020 09:31:59 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Michael Zhilin , freebsd-current@freebsd.org Subject: Re: Possible deadlock on IO / page fault Message-ID: <20200929133159.GA26914@raichu> References: <20200929132026.GS2643@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200929132026.GS2643@kib.kiev.ua> X-Rspamd-Queue-Id: 4C10fs6TRJz4n9k X-Spamd-Bar: - X-Spamd-Result: default: False [-1.94 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.02)[-1.022]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.21)[-0.205]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::831:from]; NEURAL_HAM_MEDIUM(-1.02)[-1.016]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; MAILMAN_DEST(0.00)[freebsd-current] 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:32:07 -0000 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 ---