[CRIU] [PATCH 4/8] x86: Add 32bit variant of TASK_SIZE

Pavel Emelyanov xemul at parallels.com
Fri May 15 04:36:13 PDT 2015


On 05/15/2015 02:29 PM, Cyrill Gorcunov wrote:
> On Fri, May 15, 2015 at 02:22:22PM +0300, Pavel Emelyanov wrote:
>>>  
>>> -#define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
>>> +#ifdef CONFIG_X86_64
>>> +# define TASK_SIZE	((1UL << 47) - PAGE_SIZE)
>>> +#else
>>> +/*
>>> + * Task size may be limited to 3G but we need a
>>> + * higher limit, because it's backward compatible.
>>
>> Can you elaborate on this, please?
>>
>>> + */
>>> +# define TASK_SIZE	(0xffffe000)
>>> +#endif
> 
> There are two limits for user space, depending on kernel
> configuration: 0xc0000000 or 0xffffe000. 

O_o  Really??? Which config option controls this? I remember
the so called 4g-split patches, which extended the userspace
memory up to amost 4G, but AFAIK they never found their way
into the mainstream kernel.

> When the second
> is chosen the addresses provided by mmap gonna be bigger
> than hardcoded 3G so we should not fail in such case when
> testing mmap results.
> 
> Note if the kernel is configured to 3G limit the mmap
> return address won't be higher than our TASK_SIZE, that's
> what I meant when said "backward compatible".

This is true for any TASK_SIZE value, even if you say to be
\infty the kernel would (should) never report addresses higher
than some value. Why do we need it at all?

-- Pavel



More information about the CRIU mailing list