Re: remap_file_pages() use

From: Kirill A. Shutemov
Date: Mon May 26 2014 - 10:17:27 EST


Jeff Smith wrote:
> I've got no real issues at this point, but could you perhaps elaborate
> a bit on the rough order of magnitude of "long" time

We have never-break-ABI policy in kernel. In practice it means we don't
remove an interface if somebody could notice that it disappears.

Most likely it will go though intermediate step with separate kernel
config option, like uselib(2) recently.

Don't worry. Just convert your code to avoid remap_file_pages() where it's
possible.

> and what cases would be slower?

With emulation each remap_file_pages() will usually create one or two
additional kernel structure which represents part of virtual address space
of the process. Kernel often needs to lookup that structure by virtual
address and this operation can be slower with high number of structures.

I've tried to test how bad it would be in near-worst case: 4G mapped in
reverse page order. It creates 1 million structures. On my machine, fault
in of all this memory is ~1.9 times slower with emulation comparing to
original remap_file_pages(2). In practice, nobody will notice, I believe.

--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/