> -----Original Message----- > From: fio-owner@xxxxxxxxxxxxxxx [mailto:fio-owner@xxxxxxxxxxxxxxx] On > Behalf Of Jens Axboe > Sent: Saturday, November 18, 2017 7:00 AM ... > +/* > + * Limits us to 1GiB of mapped files in total to model after > + * libpmem engine behavior > + */ > +#define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL) > + ... > +#define MEGABYTE ((uintptr_t)1 << 20) > +#define GIGABYTE ((uintptr_t)1 << 30) > +#define PROCMAXLEN 2048 /* maximum expected line length in /proc > files */ > +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) ... > +/* > + * util_map_hint_align -- choose the desired mapping alignment > + * > + * Use 2MB/1GB page alignment only if the mapping length is at least > + * twice as big as the page size. > + */ ... > + * Except for Windows Environment: > + * ALSR in 64-bit Linux kernel uses 28-bit of randomness for mmap > + * (bit positions 12-39), which means the base mapping address is > randomized > + * within [0..1024GB] range, with 4KB granularity. Assuming > additional > + * 1GB alignment, it results in 1024 possible locations. Please use the IEC prefixes for binary units in new code: MEBIBYTE, GIBIBYTE, MiB, GiB, etc. --- Robert Elliott, HPE Persistent Memory -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html