[LTP] [PATCH 4/4] mmapstress03: Fix 32bit test on 64bit kernel

Cyril Hrubis chrubis@suse.cz
Thu Jan 12 16:05:51 CET 2017


Hi!
> >  	/* Ask for a ridiculously large mmap region at a high address */
> > -	if (mmap((void*) (1UL << (POINTER_SIZE - 1)) - pagesize,
> > -		 (size_t) ((1UL << (POINTER_SIZE - 1)) - pagesize),
> > +	if (mmap((void*) (1UL << (kernel_bits - 1)) - pagesize,
> 
> Since this has same range as below, shouldn't it be also 1ULL?
> Entire series looks OK to me.

Hmm, that produces warnings in case that sizeof(void) == 4 and with
64bit kernel since the value is truncated. I guess that the addres
should be generated accordingly to the binary and not kernel after all
because of address space limitations.

Something as (((uintptr_t)1) << ((sizeof(void*)<<3) - 1) - pagesize)

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list