Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 14:09:32 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mike Makonnen <makonnen@pacbell.net>
Cc:        freebsd-smp@FreeBSD.ORG, Alfred Perlstein <bright@mu.org>
Subject:   Re: Getting resource limits out from under Giant
Message-ID:  <XFMail.20020712140932.jhb@FreeBSD.org>
In-Reply-To: <20020712020633.6a66f187.makonnen@pacbell.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On 12-Jul-2002 Mike Makonnen wrote:
> On Fri, 12 Jul 2002 01:16:32 -0700
> Alfred Perlstein <bright@mu.org> wrote:
> 
>> 
>> Cool!  Are you sure that no one can come in and mess with some other
>> process's p->p_limit structure?  If so you may need to protect
>> it via the proc lock.
>> 
> 
> Hmm... looks like I missed one. The vm system touches it. Other than
> that,
> it looks like all other references are just reading from it.
> 
> In the case where there's a chance I might switch plimits structures
> I do a proc lock in addition to locking the limits structure. Otherwise,
> if all I'm doing is changing the value of one of the limits I only lock
> the
> limits structure itself. Is that not enough?

You need to ensure you have a stable reference to the limits structure.
If you are dereferencing p_limit you need to use the proc lock to
protect reading that pointer.  The lock also ensure the value is up to
date.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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