From owner-freebsd-hackers@freebsd.org Tue Mar 30 21:01:48 2021 Return-Path: Delivered-To: freebsd-hackers@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 026125AD972 for ; Tue, 30 Mar 2021 21:01:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4F921l4tBvz3LT3 for ; Tue, 30 Mar 2021 21:01:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mailman.nyi.freebsd.org (Postfix) id A756E5AD4C0; Tue, 30 Mar 2021 21:01:47 +0000 (UTC) Delivered-To: hackers@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 A719B5AD743 for ; Tue, 30 Mar 2021 21:01:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 4F921l494Fz3LV8 for ; Tue, 30 Mar 2021 21:01:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id f12so12998417qtq.4 for ; Tue, 30 Mar 2021 14:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q4UDaRFj+wpfmyI63IoIplA0ujhIRlxKndjUipLxijE=; b=NKFfnlpKrZZU40vOLZTwtoZEMk5yHUGY8P4In5XaX7/5GRoCB3Cdvper2bnln5CTkC +yFGVd4cUar9tfL5EUJJjPN70eCI5zvzEyWKTom+H1jcS6NKm2f1ffb+sxeDh/x3F6UG 0eWDPCIPrkgf6SUoEYqAS+f7e63VtMkY4jthL9HNo/H10BEgs22Gcz8gbP4Vt3/S3fH1 4OhKGl1EMqzoSMoBpW8w2OwaWwsj7RWS6ECZ83j03eqpvfXLZqGKAnT8kej5inyn6kjP MmaXBKm5BnsOrgsrM1FSw+SnkfIS7go7+JnWxlgbHPPABAnQdbkq1R9uB0lCfK1hV/rn mafg== 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=Q4UDaRFj+wpfmyI63IoIplA0ujhIRlxKndjUipLxijE=; b=e0YLcsxCu9dS+/Vc03DZTpAu+TkifizbFQ6hHlNSHJTQp/oPjacwGsuAsXgQuHjrCj Yhy3yGlPuaaqrHXKFYbDGZWoDYb1O3cJZBt+uGUDVaM91RxhaTlzv7gebtoRRTL5sp86 wMwPRo/sogMa3T4tW1Zttgf/mAUtXa4r+SI8O+ol+9o2sL56y71w2AYZ2E8BIbYP1AFO sD1sND/DyA9EC/0wbyCYXVvRm3jChr2Wl3ZHQO+q0T8+1Y/se9E2rWbX/Grf44JDeK6G U+XxBMWVG09HKPdJRqdcO6m3A7wixvV552ICZz1IJ61SaTK0Lp1HhBYHOSCziQFVSFwE uUKg== X-Gm-Message-State: AOAM5315XXu23+GZ/clQGdOUJ1JVBM/vR2kw6ffeHfZ7E3JWJR/Yl8Hu fsUzjuwPlozLz7O7Xa0J/QNF6++6SMLiIHEzBjndrg== X-Google-Smtp-Source: ABdhPJxqoatf9hEROtlgqF45I9V+7+IGSeFfrySCLUTUPCvMrjrQhWH7Rv4EyPJ4wFGgZx7p9Ep14YwUN9VuWsBrtvw= X-Received: by 2002:a05:622a:3c8:: with SMTP id k8mr29541325qtx.101.1617138106582; Tue, 30 Mar 2021 14:01:46 -0700 (PDT) MIME-Version: 1.0 References: <20210327131011.e16291cac86475e75a33812c@FreeBSD.org> <20210330181402.GM14975@funkthat.com> In-Reply-To: From: Warner Losh Date: Tue, 30 Mar 2021 15:01:35 -0600 Message-ID: Subject: Re: RFC: possible issue with kqueue To: Ian Lepore Cc: John-Mark Gurney , Emanuel Haupt , "freebsd-hackers@freebsd.org" X-Rspamd-Queue-Id: 4F921l494Fz3LV8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2021 21:01:48 -0000 On Tue, Mar 30, 2021 at 12:51 PM Ian Lepore wrote: > On Tue, 2021-03-30 at 11:14 -0700, John-Mark Gurney wrote: > > Emanuel Haupt wrote this message on Sat, Mar 27, 2021 at 13:10 +0100: > > > Can someone familiar with kqueue please comment on: > > > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254024 > > > > Done: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254024#c11 > > > > Looks like the user wasn't force unmounting the FS. There really > > isn't any problem w/ kqueue, as a normal unmount is expected to be > > refused while files are open. > > > > I guess there COULD be a new flag added to file descriptors that > > flag them as being able to be closed upon unmount. Then when an > > unmount happens and only these flagged files remain, they are closed > > allowing the fs to unmount. But this is a new feature and > > independent > > of kqueue. > > > > While it's not a kqueue bug per se, it is a weakness in freebsd that > there is no way to monitor a volume, or items within that volume, > without making it impossible to unmount the volume. I've been fighting > this with various implementations of desktop software for like 20 years > on freebsd. Usually I have to just disable all monitoring and live > with the reduced desktop functionality. > > I wonder if a reasonable fix might be to have some sort of pre-unmount > event that can be delivered via kqueue, so that a userland entity > monitoring on that volume has a chance to close related descriptors so > that the unmount can proceed? > That's not a bad idea. I've often thought we need a wider range of quiesce calls / events / whatever that would allow people with 'soft' references to drop them in advance of an attempted event. I've never been sure what to do if the attempted event failed, so I've not gotten off the mark... this is but one example... Warner