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

Cyrill Gorcunov gorcunov at gmail.com
Fri May 15 04:29:59 PDT 2015


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. 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".


More information about the CRIU mailing list