From owner-cvs-src@FreeBSD.ORG Mon Jun 2 14:58:27 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9C6106567C; Mon, 2 Jun 2008 14:58:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id DE6D28FC2B; Mon, 2 Jun 2008 14:58:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from zion.baldwin.cx (server.baldwin.cx [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 590AB1A4D81; Mon, 2 Jun 2008 07:58:27 -0700 (PDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 2 Jun 2008 10:37:13 -0400 User-Agent: KMail/1.9.7 References: <200806011804.m51I4hl9069221@repoman.freebsd.org> In-Reply-To: <200806011804.m51I4hl9069221@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806021037.13943.jhb@FreeBSD.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/ia64/ia64 machdep.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2008 14:58:28 -0000 On Sunday 01 June 2008 02:04:29 pm Marcel Moolenaar wrote: > marcel 2008-06-01 18:04:43 UTC > > FreeBSD src repository > > Modified files: (Branch: RELENG_7) > sys/ia64/ia64 machdep.c > Log: > SVN rev 179479 on 2008-06-01 18:04:29Z by marcel > > Merge rev 179173: > > We can call ia64_flush_dirty() when the corresponding process is > locked or not. As such, use PROC_LOCKED() to determine which case > it is and lock the process when not. > > This is a manual merge. No merge history is created. proc_rwmem() can sleep (if it has to fault a page back in from swap), so you can't call it with the process locked. I think the only place where you have to worry about this is during a core dump from ia64/elf_machdep.c? In that case it should be fine to just drop the lock. You do still need to do PHOLD/PRELE to avoid an assertion failure and to prevent the process from being swapped out while it is sleeping. So maybe something more like: locked = PROC_LOCKED(); if (!locked) PROC_LOCK(); _PHOLD(); PROC_UNLOCK(); ... (proc_rwmem()) PROC_LOCK(); _PRELE(); if (!locked) PROC_UNLOCK(); -- John Baldwin