Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jun 2008 10:37:13 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Marcel Moolenaar <marcel@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
Message-ID:  <200806021037.13943.jhb@FreeBSD.org>
In-Reply-To: <200806011804.m51I4hl9069221@repoman.freebsd.org>
References:  <200806011804.m51I4hl9069221@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806021037.13943.jhb>