Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA

From: Boaz Harrosh
Date: Thu Aug 13 2015 - 11:29:40 EST


On 08/13/2015 05:48 PM, Boaz Harrosh wrote:
<>
> There is already an object that holds a relationship of physical
> to Kernel-virtual. It is called a memory-section. Why not just
> widen its definition?
>

BTW: Regarding the "widen its definition"

I was thinking of two possible new models here:
[1-A page-less memory section]
- Keep the 64bit phisical-to-kernel_virtual hard coded relationship
- Allocate a section-object, but this section object does not have any
pages, its only the header. (You need it for the pmd/pmt thing)

Lots of things just work now if you make sure you do not go through
a page struct. This needs no extra work I have done this in the past
all you need is to do your ioremap through the map_kernel_range_noflush(__va(), ....)

[2- Small pages-struct]

- Like above, but each entry in the new section object is small one-ulong size
holding just flags.

Then if !(p->flags & PAGE_SPECIAL) page = container_of(p, struct page, flags)

This model is good because you actually have your pfn_to_page and page_to_pfn
and need not touch sg-list or bio. But only 8 bytes per frame instead of 64 bytes


But I still think that the best long-term model is the variable size pages
where a page* can be 2M or 1G. Again an extra flag and a widen section definition.
Is about time we move to bigger pages, throughout but still keep the 4k
page-cache-dirty granularity.

Thanks
Boaz

--
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/