mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andy Lutomirski <luto@kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Juergen Gross <jgross@suse.com>
Cc: X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: xen_exit_mmap() questions
Date: Wed, 26 Apr 2017 18:45:18 -0400	[thread overview]
Message-ID: <f1c1b2e0-e377-2998-51cd-96d93995e868@oracle.com> (raw)
In-Reply-To: <CALCETrUPa9xvugPNcTmShJFfgSesa31dD-wy0hY3XnH1Knjn6g@mail.gmail.com>

On 04/26/2017 04:52 PM, Andy Lutomirski wrote:
> I was trying to understand xen_drop_mm_ref() to update it for some
> changes I'm working on, and I'm wondering whether we need
> xen_exit_mmap() at all.
>
> AFAICS the intent is to force all CPUs to drop their lazy uses of the
> mm being destroyed so it can be unpinned before tearing down the page
> tables, thus making it faster to tear down the page tables.  This
> seems like it'll speed up xen_set_pud() and xen_set_pmd(), but this
> seems like it may be of rather limited value. 

Why do you think it's of limited value? Without it we will end up with a
hypercall for each update.

Or is your point that the number of those update is relatively small
when we are tearing down?


>  Could we get away with
> deleting it?
>
> Also, this code in drop_other_mm_ref() looks dubious to me:
>
>     /* If this cpu still has a stale cr3 reference, then make sure
>        it has been flushed. */
>     if (this_cpu_read(xen_current_cr3) == __pa(mm->pgd))
>         load_cr3(swapper_pg_dir);
>
> If cr3 hasn't been flushed to the hypervisor because we're in a lazy
> mode, why would load_cr3() help?  Shouldn't this be xen_mc_flush()
> instead?

load_cr3() actually ends with xen_mc_flush() by way of xen_write_cr3()
-> xen_mc_issue().

-boris

  reply	other threads:[~2017-04-26 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 20:52 Andy Lutomirski
2017-04-26 22:45 ` Boris Ostrovsky [this message]
2017-04-26 22:49   ` Andy Lutomirski
2017-04-27  0:55     ` Boris Ostrovsky
2017-04-27  1:08       ` Andy Lutomirski
2017-04-27 13:21         ` Boris Ostrovsky
2017-04-27 16:46           ` Andy Lutomirski
2017-04-27 20:00             ` Boris Ostrovsky
2017-04-27 21:22               ` Andy Lutomirski
2017-04-27  6:27       ` Ingo Molnar
2017-04-27  7:40       ` [Xen-devel] " Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1c1b2e0-e377-2998-51cd-96d93995e868@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®