Re: [RFC -mm 0/6] sysv ipc: scale msgmnb with the number of cpus

Nadia Derbey
2008-06-25T10:12:21Z

Manfred Spraul wrote:
> Solofo.Ramangalahy@bull.net wrote:
>
>> Humm... now this make me think that you did not change the MSGMNB
>> value when you changed MSGMNI and MSGMAX.
>> Maybe that was on purpose?
>>
>>
>
> I was afraid that it might break user space applications that queue a
> few kb of messages.
> That's also the reason for
>
>> if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
>> 1 + msq->q_qnum <= msq->q_qbytes) {
>> break;
>> }
>
> It's possible to send 0-byte messages even if the message queue is full
> [except that you can't send more than MSGMNB messages].
>

Manfred,

If I'm not missign anything when reading the code, sending up to MSGMNB
0-bytes messages would make us enqueue MSGMNB msg_msg structures (this
is in the worst case where no receiver is waiting for those messages).
==> MSGMNB * 24 bytes (or 48 bytes in 64-bit mode))
==> 384 KB with current MSGMNB value (16K).

But 1,5 MB with a MSGMNB=64K

Even if it is a worst case, it should be considered and may be we should
refine the formula Solofo has proposed if you think this is not a
reasonable value.
May be add a dependency on the memory size?

Regards,
Nadia