Subject: Re: SysV SHM locking and reallocating support
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 09/24/2006 23:24:46
In article <20060924232315.0ac7b085.unex@linija.org>,
Mindaugas  <unex@linija.org> wrote:
>Thanks for the answer.
>I finished all mentioned things, a patch will be soon :)
>
>> The realloc should return an error if there is an invalid argument
>> or could not allocate memory. This would be an indication to the user
>> that something failed at sysctl time (and the sysctl value should not
>> be changed on failure).
>Yes, in this case it is strucutrally wrong, that sysctl does not return
>any error. The sysctl value changing can be made only after the real
>value changing.
>The problem is that we cannot reallocate if we set lesser memory size
>than we are using. Checking for shmrealloc() in segment allocation
>"waits" for acting with memory (in fact, checking should also be in
>segment deallocation). Otherwise, user must delete segments manually
>with ipcrm(1) or close applications which is using shared memory. I
>think it is less comfortable.
>Should we go considering that new_size < currently_used_size -> fault?
>Any other solution?

Just fail decreasing the size if you cannot do it.

christos