From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: will@kernel.org, kvmarm@lists.cs.columbia.edu,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: tsbogend@alpha.franken.de, maz@kernel.org,
sean.j.christopherson@intel.com, paulus@ozlabs.org,
stable@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH 2/2] KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set
Date: Tue, 11 Aug 2020 11:52:41 +0100 [thread overview]
Message-ID: <1b326944-c4aa-eb52-b7dc-a77f9eecae63@arm.com> (raw)
In-Reply-To: <20200811102725.7121-3-will@kernel.org>
On 08/11/2020 11:27 AM, Will Deacon wrote:
> When an MMU notifier call results in unmapping a range that spans multiple
> PGDs, we end up calling into cond_resched_lock() when crossing a PGD boundary,
> since this avoids running into RCU stalls during VM teardown. Unfortunately,
> if the VM is destroyed as a result of OOM, then blocking is not permitted
> and the call to the scheduler triggers the following BUG():
>
> | BUG: sleeping function called from invalid context at arch/arm64/kvm/mmu.c:394
> | in_atomic(): 1, irqs_disabled(): 0, non_block: 1, pid: 36, name: oom_reaper
> | INFO: lockdep is turned off.
> | CPU: 3 PID: 36 Comm: oom_reaper Not tainted 5.8.0 #1
> | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
> | Call trace:
> | dump_backtrace+0x0/0x284
> | show_stack+0x1c/0x28
> | dump_stack+0xf0/0x1a4
> | ___might_sleep+0x2bc/0x2cc
> | unmap_stage2_range+0x160/0x1ac
> | kvm_unmap_hva_range+0x1a0/0x1c8
> | kvm_mmu_notifier_invalidate_range_start+0x8c/0xf8
> | __mmu_notifier_invalidate_range_start+0x218/0x31c
> | mmu_notifier_invalidate_range_start_nonblock+0x78/0xb0
> | __oom_reap_task_mm+0x128/0x268
> | oom_reap_task+0xac/0x298
> | oom_reaper+0x178/0x17c
> | kthread+0x1e4/0x1fc
> | ret_from_fork+0x10/0x30
>
> Use the new 'flags' argument to kvm_unmap_hva_range() to ensure that we
> only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is set in the notifier
> flags.
>
> Cc: <stable@vger.kernel.org>
> Fixes: 8b3405e345b5 ("kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd")
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Signed-off-by: Will Deacon <will@kernel.org>
> ---
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2020-08-11 10:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 10:27 [PATCH 0/2] KVM: arm64: Fix sleeping while atomic BUG() on OOM Will Deacon
2020-08-11 10:27 ` [PATCH 1/2] KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() Will Deacon
2020-08-19 23:57 ` Sasha Levin
2020-08-26 13:54 ` Sasha Levin
2020-08-11 10:27 ` [PATCH 2/2] KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set Will Deacon
2020-08-11 10:52 ` Suzuki K Poulose [this message]
2020-08-18 6:31 ` [PATCH 0/2] KVM: arm64: Fix sleeping while atomic BUG() on OOM Paolo Bonzini
2020-08-18 10:16 ` Will Deacon
2020-08-18 10:30 ` Marc Zyngier
2020-08-20 7:26 ` Paolo Bonzini
2020-08-18 10:34 ` Marc Zyngier
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=1b326944-c4aa-eb52-b7dc-a77f9eecae63@arm.com \
--to=suzuki.poulose@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=paulus@ozlabs.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=stable@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=will@kernel.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