From owner-freebsd-stable@FreeBSD.ORG Sat Oct 21 07:16:05 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 5C34516A403; Sat, 21 Oct 2006 07:16:05 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-stable@freebsd.org Date: Sat, 21 Oct 2006 15:15:58 +0800 User-Agent: KMail/1.8.2 References: <17718.20457.799395.602805@gromit.timing.com> <200610210825.00228.davidxu@freebsd.org> <20061021035749.GY55428@deviant.kiev.zoral.com.ua> In-Reply-To: <20061021035749.GY55428@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610211515.58766.davidxu@freebsd.org> Cc: Kostik Belousov , John E Hein , jhb@freebsd.org Subject: Re: locked vnode / nfs... requires kill -9 in ddb X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2006 07:16:05 -0000 On Saturday 21 October 2006 11:57, Kostik Belousov wrote: > On Sat, Oct 21, 2006 at 08:25:00AM +0800, David Xu wrote: > > On Thursday 19 October 2006 18:04, Kostik Belousov wrote: > > > The nfs_reply is sleeping with the PCATCH set. The question is why > > > SIGTSTP does not cause msleep to return with EINTR. > > > > I have not been tracking the thread. but if the thread is sleeping with > > PCATCH, the SIGTSTP should cause the process to stop unless the signal > > is masked by sigprocmask or the signal has an action handler been set, > > this is a correct behavior. > > David, > as I understand the report, the following happens. The nfs mount point with > intr option issued the request and waits for the reply. Some vnode locks > are held while waiting. Code needs to catch the signals to abort the > operation on user request. It uses msleep with PCATCH. The thread in > question has td_locks > 0. > > The SIGTSTP is delivered, and thread is stopped, while holding vnode lock. > How this situation shall be handled ? Namely, how to sleep while having the > ability to safely clean up on attempt of stopping ? Masking SIGTSTP is not > the option, due to SIGSTOP having the same results and not being blockable. > > [Would it be right to stop the threads only on returning from kernel to > user mode ?] I know in the case, you want signal to interrupt the thread but don't want a job control signal to suspend the thread, but a PCATCH flag is not enough to tell the case. I think we are trying to fix the history problem of RELENG_4 or earlier. David Xu