[PATCH 3/6] struct page: add field for vm_struct

From
Igor Stoppa <hidden>
Date
2018-02-20 19:53:30
Also in
linux-mm, lkml
Reply to
Igor Stoppa, 2018-02-12

On 12/02/18 18:24, Igor Stoppa wrote:

On 11/02/18 23:16, Matthew Wilcox wrote:
quoted
On Sun, Feb 11, 2018 at 05:19:17AM +0200, Igor Stoppa wrote:
quoted
The struct page has a "mapping" field, which can be re-used, to store a
pointer to the parent area. This will avoid more expensive searches.

As example, the function find_vm_area is reimplemented, to take advantage
of the newly introduced field.
Umm.  Is it more efficient?  You're replacing an rb-tree search with a
page-table walk.  You eliminate a spinlock, which is great, but is the
page-table walk more efficient?  I suppose it'll depend on the depth of
the rb-tree, and (at least on x86), the page tables should already be
in cache.
I thought the tradeoff favorable.
It turns out that it's probably not so favorable.
The patch relies on the function vmalloc_to_page ... which will return
NULL when applied to huge mappings, while the original implementation
will still work.

It was found while testing on a configuration with framebuffer.

So it seems unlikely that there is any gain to be had, from this
perspective.

The use of the field still makes sense from the perspective of adding
pmalloc support to hardened usercopy, but there is no more need for the
field to exist as separate patch.

This patch can be simplified and merged with the pmalloc patch.

--
igor
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (30 messages) 30 messages, 6 authors, last reply 2018-02-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help