[CRIU] [PATCH 1/2] ipc/sysctl: c/r fs.mqueue.msg_default fs.mqueue.msgsize_default

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Jun 28 06:04:57 PDT 2016



On 06/28/2016 04:03 PM, Pavel Emelyanov wrote:
> On 06/24/2016 02:40 PM, Pavel Tikhomirov wrote:
>> we already have 3/5 fs.mqueue.xxx sysctls so why not have all:
>>
>> /proc/sys/fs/mqueue/msg_default is  a read/write  file for
>> setting/getting the default number of messages in a queue value
>> if attr parameter of mq_open(2) is NULL. If it exceed msg_max,
>> the default value is initialized msg_max.
>>
>> /proc/sys/fs/mqueue/msgsize_default is a read/write file for
>> setting/getting the default message size value if attr parameter
>> of mq_open(2) is NULL. If it exceed msgsize_max, the default
>> value is initialized msgsize_max.
>>
>> *We have these sysctls writable in VZ7 CT.
>
> How about the upstream kernel?

Same, it was just a note that we need in in VZ7 too.

>
>> @@ -322,7 +324,14 @@ static int ipc_sysctl_req(IpcVarEntry *e, int op)
>>  		return 0;
>>  	}
>>
>> -	return sysctl_op(req_mq, ARRAY_SIZE(req_mq), op, CLONE_NEWIPC);
>> +	if (access("/proc/sys/fs/mqueue/msg_default", F_OK)) {
>> +		/* In case the kernel is < v3.5 */
>
> CRIU is not supposed to work in kernels prior to 3.11. Do we really need this check?

It is not so hard to remove it, but these check can save time for custom 
kernel users.

>
>> +		pr_info("Mqueue msg_default and msgsize_default sysctls are missing\n");
>> +		e->has_mq_msg_default = e->has_mq_msgsize_default = false;
>> +	}
>> +
>> +	return sysctl_op(req_mq, ARRAY_SIZE(req_mq) - (e->has_mq_msg_default ? 0 : 2),
>> +	                 op, CLONE_NEWIPC);
>>  }
>>
>>  /*
>

-- 
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.


More information about the CRIU mailing list