From owner-freebsd-current@freebsd.org Tue Sep 29 13:36:03 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 EDA904239C1 for ; Tue, 29 Sep 2020 13:36:03 +0000 (UTC) (envelope-from zhilin.ms@phystech.edu) Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (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 4C10lQ2nr8z4nhY for ; Tue, 29 Sep 2020 13:36:02 +0000 (UTC) (envelope-from zhilin.ms@phystech.edu) Received: by mail-vk1-f172.google.com with SMTP id a16so2430724vke.3 for ; Tue, 29 Sep 2020 06:36:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fMC+lN/ygxaqTTMETLH21qNyhaSrZ+KCDFu9LPrvD1A=; b=sjtl+UBCM5Vp/XPGfhOZI76k0N0BoLxpDdzbj1OnG3OhMQ115EZbrzF4QpAczKoI2N euGSQdZN5DH/e166eBTokStyNF7m7IoFmY8ngsrTHMEjCZKlOIGnh7RkCX2iRP5i7pik Gl55UJOJbKITWegJc42cNKFsNH020RjbWwR58Sw8tr9FhH1ZpbPT6nVuDG6HatLLMmhe dbLyLyDRQ52nKA8cayA0laoLvrjqa6FxT+5zatZAahJmys9EEzQYOQCBv3AMNjtFLtBn +kdhk6RrOee2rrk2FZ9nHcHFLPkdfGuRMC8cf3VDKQ/7UA+C3voXNWSJeuXNEfs8XSgi TLNQ== X-Gm-Message-State: AOAM5318IYYm3az1Fqlebwkt0qiWPhfMVUMVK8Qd0hDOQRqcruKyMWkX anaMwarZYdaqsB/vhaIBdIzxJcGIFdUTdokf8XGJ/Q== X-Google-Smtp-Source: ABdhPJyyr9sbyRJKg4Hdn+q1dS8S7pkpvXX8eQJmq9Rfo5qz2Q/ylzub2Ol5+tihtuvZGPGE3h004Q== X-Received: by 2002:a1f:6ec4:: with SMTP id j187mr2516115vkc.15.1601386560934; Tue, 29 Sep 2020 06:36:00 -0700 (PDT) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com. [209.85.222.42]) by smtp.gmail.com with ESMTPSA id l5sm1008745vkl.1.2020.09.29.06.36.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Sep 2020 06:36:00 -0700 (PDT) Received: by mail-ua1-f42.google.com with SMTP id n2so3428905uaw.11 for ; Tue, 29 Sep 2020 06:36:00 -0700 (PDT) X-Received: by 2002:ab0:441:: with SMTP id 59mr882401uav.50.1601386560195; Tue, 29 Sep 2020 06:36:00 -0700 (PDT) MIME-Version: 1.0 References: <20200929132026.GS2643@kib.kiev.ua> <20200929133159.GA26914@raichu> In-Reply-To: <20200929133159.GA26914@raichu> From: Michael Zhilin Date: Tue, 29 Sep 2020 16:35:47 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Possible deadlock on IO / page fault To: Mark Johnston Cc: Konstantin Belousov , freebsd-current@freebsd.org X-Rspamd-Queue-Id: 4C10lQ2nr8z4nhY X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.61 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.02)[-1.020]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.56)[-0.560]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.172:from]; NEURAL_HAM_MEDIUM(-1.03)[-1.028]; FORGED_SENDER(0.30)[mizhka@freebsd.org,zhilin.ms@phystech.edu]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.172:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[mizhka@freebsd.org,zhilin.ms@phystech.edu]; MAILMAN_DEST(0.00)[freebsd-current]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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:36:04 -0000 Thank you, Kostya and Mark! I will update to head. :) 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 --- >