From owner-freebsd-fs@FreeBSD.ORG Tue Nov 23 05:13:47 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CD0106564A for ; Tue, 23 Nov 2010 05:13:47 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta04.emeryville.ca.mail.comcast.net (qmta04.emeryville.ca.mail.comcast.net [76.96.30.40]) by mx1.freebsd.org (Postfix) with ESMTP id 566C68FC0A for ; Tue, 23 Nov 2010 05:13:47 +0000 (UTC) Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta04.emeryville.ca.mail.comcast.net with comcast id aTvj1f0021HpZEsA4VDm7S; Tue, 23 Nov 2010 05:13:46 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta14.emeryville.ca.mail.comcast.net with comcast id aVDl1f0013LrwQ28aVDlXj; Tue, 23 Nov 2010 05:13:45 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id E290E9B427; Mon, 22 Nov 2010 21:13:44 -0800 (PST) Date: Mon, 22 Nov 2010 21:13:44 -0800 From: Jeremy Chadwick To: Rick Macklem Message-ID: <20101123051344.GA67909@icarus.home.lan> References: <201011221629.27166.jhb@freebsd.org> <1793929802.495869.1290477665351.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1793929802.495869.1290477665351.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org, Ivan Voras Subject: Re: preferred kernel upcall method to master nfsd X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 05:13:47 -0000 On Mon, Nov 22, 2010 at 09:01:05PM -0500, Rick Macklem wrote: > > > > nfsd is a user process. I suspect that when it receives a signal it > > falls out of > > nfssvc() with EINTR and handles saving the restart file in userland. > > Is that close > > to the process Rick or does you need to send a signal between threads > > that are > > exclusively within the kernel? > > > Yep, the kernel nfsd thread needs to tell the userland master nfsd to > make a backup copy of the stable restart file now. > > Doing it with signals, the kernel code would post a signal (SIGUSR2 ?) > to the master nfsd (which is normally in userland). > > The master nfsd would simply have a signal handler for SIGUSR2 that would > copy the file (it's pretty small) to a backup copy. > > At least that's how I would think I could code it. I haven't actually > tried it? > > My question was mostly if there was a preferred/better way for the > kernel code to tell the userland master nfsd to copy the file? Could kqueue(2) be used for this? -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |