Re: [RFC PATCH 3/3] mm/map_contig: Add mmap(MAP_CONTIG) support

From: Michal Nazarewicz
Date: Mon Oct 16 2017 - 06:33:19 EST


On Sun, Oct 15 2017, Guy Shattah wrote:
> Why have several driver specific implementation if you can generalize
> the idea and implement an already existing POSIX standard?

Why is there a need for contiguous allocation?

CPU cares only to the point of huge pages and thereâs already an effort
in the kernel to allocate huge pages transparently without user space
being aware of it.

If not CPU than various devices all of which may have very different
needs. Some may be behind an IO MMU. Some may support DMA. Some may
indeed require physically continuous memory. How is user space to know?

Furthermore, user space does not care whether allocation is physically
contiguous or not. What it cares about is whether given allocation can
be passed as a buffer to a particular device.

If generalisation is the issue, then the solution is to define a common
API where user-space can allocate memory *in the context of* a device.
This provides a âgive me memory I can use for this deviceâ request which
is what user space really wants.

So yeah, like others in this thread, the reason for this change alludes
me. On the other hand, I donât care much so Iâll limit myself to this
one message.

--
Best regards
ããã âðððð86â ãããããã
ÂIf at first you donât succeed, give up skydivingÂ