On Thu, Jan 8, 2015 at 9:44 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote: >> Are there any up-to-date libc implementations for which the >> optimization *does* work? It appears that at least glibc and musl use >> mmap and thereby defeat the optimization. > > It works with MAP_32BIT. That was one of the reasons it was added > originally. Or just passing a low search hint. > Does any reasonably modern implementation do this? >> I don't think it's worth keeping around somewhat fragile code to >> optimize a use case that no longer exists and for which removing the >> extra code wouldn't break anything. > > ABIs are ABIs and are not up to removal. > Also not everything you don't understand is up to removal. I understand the kernel code, and removing it wouldn't break any ABI, unless there's some program out there that assumes that, if you call arch_prctl(ARCH_SET_FS, something less than 2^32), then you'll have fs != 0 afterwards. It would make code that uses MAP_32BIT on a modern kernel a tiny bit slower. --Andy -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html