Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 17 Sep 2018 06:27:25 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Julian Stecklina <jsteckli@...zon.de>
Cc: Juerg Haefliger <juergh@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	David Woodhouse <dwmw@...zon.co.uk>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	deepa.srinivasan@...cle.com, Jim Mattson <jmattson@...gle.com>,
	Andrew Cooper <andrew.cooper3@...rix.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	linux-mm <linux-mm@...ck.org>, Thomas Gleixner <tglx@...utronix.de>,
	joao.m.martins@...cle.com, pradeep.vincent@...cle.com,
	Andi Kleen <ak@...ux.intel.com>,
	Khalid Aziz <khalid.aziz@...cle.com>, kanth.ghatraju@...cle.com,
	Liran Alon <liran.alon@...cle.com>, Kees Cook <keescook@...gle.com>,
	Kernel Hardening <kernel-hardening@...ts.openwall.com>,
	chris.hyser@...cle.com, Tyler Hicks <tyhicks@...onical.com>,
	John Haxby <john.haxby@...cle.com>, Jon Masters <jcm@...hat.com>
Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs
 in mind (for KVM to isolate its guests per CPU)

On Mon, Sep 17, 2018 at 12:01:02PM +0200, Julian Stecklina wrote:
> Juerg Haefliger <juergh@...il.com> writes:
> 
> >> I've updated my XPFO branch[1] to make some of the debugging optional
> >> and also integrated the XPFO bookkeeping with struct page, instead of
> >> requiring CONFIG_PAGE_EXTENSION, which removes some checks in the hot
> >> path.
> >
> > FWIW, that was my original design but there was some resistance to
> > adding more to the page struct and page extension was suggested
> > instead.
> 
> >From looking at both versions, I have to say that having the metadata in
> struct page makes the code easier to understand and removes some special
> cases and bookkeeping.

Btw, can xpfo_lock be replaced with a bit spinlock in the page?
Growing struct page too much might cause performance issues.  Then again
going beyong the 64 byte cache line might already cause that, and even
then it propbably is still way better than the page extensions.

OTOH if you keep the spinlock it might be worth to use
atomic_dec_and_lock on the count.  Maybe the answer is an hash of
spinlock, as we obviously can't take all that many of them at the same
time anyway.

Also for your trasitions froms zero it might be worth at looking at
atomic_inc_unless_zero.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.