All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Ashish Kalra <Ashish.Kalra@amd.com>
Cc: ovidiu.panait@windriver.com, kvm@vger.kernel.org,
	liam.merwick@oracle.com, mizhang@google.com, pbonzini@redhat.com,
	thomas.lendacky@amd.com, michael.roth@amd.com, pgonda@google.com,
	marcorr@google.com, alpergun@google.com, jarkko@kernel.org,
	jroedel@suse.de, bp@alien8.de, rientjes@google.com
Subject: Re: [PATCH 5.4 1/1] KVM: SEV: add cache flush to solve SEV cache incoherency issues
Date: Tue, 27 Sep 2022 00:37:17 +0000	[thread overview]
Message-ID: <YzJFvWPb1syXcVQm@google.com> (raw)
In-Reply-To: <20220927000729.498292-1-Ashish.Kalra@amd.com>

On Tue, Sep 27, 2022, Ashish Kalra wrote:
> With this patch applied, we are observing soft lockup and RCU stall issues on
> SNP guests with 128 vCPUs assigned and >=10GB guest memory allocations.

...

> From the call stack dumps, it looks like migrate_pages() > The invocation of
> migrate_pages() as in the following code path does not seem right: 
>     
>     do_huge_pmd_numa_page
>       migrate_misplaced_page
>         migrate_pages
>     
> as all the guest memory for SEV/SNP VMs will be pinned/locked, so why is the
> page migration code path getting invoked at all ?

LOL, I feel your pain.  It's the wonderful NUMA autobalancing code.  It's been a
while since I looked at the code, but IIRC, it "works" by zapping PTEs for pages that
aren't allocated on the "right" node without checking if page migration is actually
possible.

The actual migration is done on the subsequent page fault.  In this case, the
balancer detects that the page can't be migrated and reinstalls the original PTE.

I don't know if using FOLL_LONGTERM would help?  Again, been a while.  The workaround
I've used in the past is to simply disable the balancer, e.g.

  CONFIG_NUMA_BALANCING=n

or
  
  numa_balancing=disable

on the kernel command line.

  reply	other threads:[~2022-09-27  0:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 14:52 [PATCH 5.4 1/1] KVM: SEV: add cache flush to solve SEV cache incoherency issues Ovidiu Panait
2022-09-26 19:00 ` Liam Merwick
2022-09-27  0:07 ` Ashish Kalra
2022-09-27  0:37   ` Sean Christopherson [this message]
2022-10-06 17:36     ` Kalra, Ashish
2022-10-07  1:15       ` Sean Christopherson
2022-10-07  6:03         ` Mingwei Zhang
2022-10-07 15:51           ` Sean Christopherson
2022-10-07 17:00             ` Sean Christopherson
2022-09-27  8:03 ` Ovidiu Panait

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=YzJFvWPb1syXcVQm@google.com \
    --to=seanjc@google.com \
    --cc=Ashish.Kalra@amd.com \
    --cc=alpergun@google.com \
    --cc=bp@alien8.de \
    --cc=jarkko@kernel.org \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=liam.merwick@oracle.com \
    --cc=marcorr@google.com \
    --cc=michael.roth@amd.com \
    --cc=mizhang@google.com \
    --cc=ovidiu.panait@windriver.com \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=rientjes@google.com \
    --cc=thomas.lendacky@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.