From owner-freebsd-fs@freebsd.org Tue Sep 5 08:48:45 2017 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A77FE2110D for ; Tue, 5 Sep 2017 08:48:45 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D17033784 for ; Tue, 5 Sep 2017 08:48:44 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd15.aul.t-online.de (fwd15.aul.t-online.de [172.20.27.63]) by mailout02.t-online.de (Postfix) with SMTP id B9D8D41A25DA; Tue, 5 Sep 2017 10:42:12 +0200 (CEST) Received: from Stefans-MBP-2.fritz.box (EBWrTrZ-oh18N0daKClnKNg22RfgboAQf7wYnzNXQuVJLUnFUnWshLWsVU7nTVRQIx@[84.154.110.22]) by fwd15.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1dp9Qt-04byrY0; Tue, 5 Sep 2017 10:42:07 +0200 Subject: Re: umount() taking minutes for FUSE filesystems To: Ben RUBSON , Freebsd fs References: <87bmn44ruu.fsf@vostro.rath.org> <87o9qyrbs8.fsf@vostro.rath.org> <2FAD66DE-031B-4B36-9E85-C7BC6B52B5E6@gmail.com> From: Stefan Esser Message-ID: <29de6425-9f92-3bd8-f446-1c9dded33b15@freebsd.org> Date: Tue, 5 Sep 2017 10:42:07 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <2FAD66DE-031B-4B36-9E85-C7BC6B52B5E6@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ID: EBWrTrZ-oh18N0daKClnKNg22RfgboAQf7wYnzNXQuVJLUnFUnWshLWsVU7nTVRQIx X-TOI-MSGID: a3cfa107-44e9-44cb-80fb-a3810c671637 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 08:48:45 -0000 Am 04.09.17 um 23:14 schrieb Ben RUBSON: > I managed to reproduce the issue. > unmount takes exactly 60 seconds, as if a timeout was running. > > # procstat -kk $! > COMM TDNAME KSTACK > printcap - mi_switch+0xd2 sleepq_catch_signals+0xb7 sleepq_timedwait_sig+0x10 _sleep+0x26f fdisp_wait_answ+0x171 fuse_vfsop_unmount+0xf5 dounmount+0x9b6 sys_unmount+0x41b amd64_syscall+0x4ce Xfast_syscall+0xfb > > # uname -sr > FreeBSD 11.0-RELEASE-p9 I have given the exact position of this 60 second msleep() in multiple mails before. It is in fuse_ipc.c, the particular msleep with "fu_ans" (line 333 in -CURRENT). I did not try to diagnose, why this particular umount() takes so long, while others are fast, but it is obvious that the kernel module does wait for a signal at the end of some IPC and the signal is either lost or never sent. There is a check for a dead connection, just before the msleep() and the connection is considered alive at that point (and should be, to support the umount() result being reported). I did not have time to look into this during the previous week and won't during this week, but it should not be too hard to see, what's going on. A starting point could be to compare this test with those that perform the unmount without delay. Regards, STefan