From owner-freebsd-current@freebsd.org Mon Oct 16 23:20:00 2017 Return-Path: Delivered-To: freebsd-current@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 C86B9E4826C for ; Mon, 16 Oct 2017 23:20:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDB571B20 for ; Mon, 16 Oct 2017 23:19:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 81f256a7-b2c8-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 81f256a7-b2c8-11e7-a893-25625093991c; Mon, 16 Oct 2017 23:19:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9GNJkDJ002113; Mon, 16 Oct 2017 17:19:46 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1508195986.74236.6.camel@freebsd.org> Subject: Re: pfind_locked(pid) fails when in a jail? From: Ian Lepore To: Mateusz Guzik , Rick Macklem Cc: "freebsd-current@freebsd.org" , "fabian.freyer@physik.tu-berlin.de" Date: Mon, 16 Oct 2017 17:19:46 -0600 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 16 Oct 2017 23:20:00 -0000 On Tue, 2017-10-17 at 00:38 +0200, Mateusz Guzik wrote: > On Tue, Oct 17, 2017 at 12:24 AM, Rick Macklem wrote: > > > > > Hi, > > > > A problem w.r.t. the NFSv4 client's renew thread (nfscl) running up a lot > > of CPU > > when the NFSv4 mount is in a jail has been reported to the freebsd-stable@ > > mailing list. > > > > I know nothing about jails, but when looking at the code, the most obvious > > cause of this would be "pfind_locked(pid)" failing to find a process. > > - Will a jail affect how pfind_locked() behaves? > > - If the answer is "yes", then I need to know how to either... > >    1 - Make pfind_locked() work the same as when no jail exists. > >    OR > >    2 - A way for the Renew thread can determine that a jail will affect > > pfind_locked() > >      behaviour, so it can avoid this problem. > > #1 is preferred, since #2 may not be 100% correct, although #2 would allow > > the > > code to behave well for most cases. (The exception is a case where a file > > remains > > open for a long period of time, with different processes doing byte range > > locks on > > the file.) > > > pfind* does not do any filtering. > > The real question though is why are you calling it in the first place. The > calls > I grepped in nfscl_procdoesntexist are highly suspicious - there is no > guarantee > the process you found here is the same you had at the time you were saving > the pid. > > There is no usable process exit notification right now, but it can be added > if necessary. > Does that mean there is something wrong with the existing eventhandler notifications related to proc fork/exec/exit? -- Ian