]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86/mpx: Do not count MPX VMAs as neighbors when unmapping
authorDave Hansen <dave.hansen@linux.intel.com>
Sun, 7 Jun 2015 18:37:06 +0000 (11:37 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 9 Jun 2015 10:24:34 +0000 (12:24 +0200)
commitbea03c50b871a2fa922f31ad7c9993bb4fc7b192
tree40d7c92a6efb9849d6d552a3165f0b49d7d4e593
parent3ceaccdf92073d193f0bfbe24280dd736e3fed86
x86/mpx: Do not count MPX VMAs as neighbors when unmapping

The comment pretty much says it all.

I wrote a test program that does lots of random allocations
and forces bounds tables to be created.  It came up with a
layout like this:

  ....   | BOUNDS DIRECTORY ENTRY COVERS |  ....
         |    BOUNDS TABLE COVERS        |
|  BOUNDS TABLE |  REAL ALLOC | BOUNDS TABLE |

Unmapping "REAL ALLOC" should have been able to free the
bounds table "covering" the "REAL ALLOC" because it was the
last real user.  But, the neighboring VMA bounds tables were
found, considered as real neighbors, and we declined to free
the bounds table covering the area.

Doing this over and over left a small but significant number
of these orphans.  Handling them is fairly straighforward.
All we have to do is walk the VMAs and skip all of the MPX
ones when looking for neighbors.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150607183706.A6BD90BF@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/mm/mpx.c