Quoting Samuel Thibault (2014-09-13 01:39:05) > So it seems we need what is not actually documented, i.e. a vm_map > with anywhere=1, but which takes into account the suggested address. > I'm fine with officially supporting that, we just need to fix the > documentation,
I'm sorry, I'm lost. What other interpretation of 'anywhere' is there? And since you aligned the semantic of vm_maps 'anywhere' with 'vm_allocate', then it follows that the current interpretation is either wrong or right for both functions, no? I just looked at mmap(2). If one specifies a non-NULL address, Linux will use the address as hint. If it is NULL, and MAP_FIXED is not given, Linux choses a suitable address. It isn't explicitly stated, but I'm pretty sure the Linux kernel doesn't consider the zero page a suitable place. > and fix all places which weren't aware of this behavior (there are > very few). How would I chose a suitable address? E.g. ext2fs/dir.c initializes the address to 0, but then vm_map_enter would set it to map->min_offset anyway (or map->min_offset is 0), which is the same as vm_map_min(map). Justus