public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Chen, Tiejun" <tiejun.chen@intel.com>
To: Joerg Roedel <joro@8bytes.org>, Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code
Date: Wed, 17 Dec 2014 09:38:57 +0800	[thread overview]
Message-ID: <5490DEB1.30305@intel.com> (raw)
In-Reply-To: <1418744846-12868-1-git-send-email-joro@8bytes.org>

On 2014/12/16 23:47, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> When assigning devices to large memory guests (>=128GB guest
> memory in the failure case) the functions to create the
> IOMMU page-tables for the whole guest might run for a very
> long time. On non-preemptible kernels this might cause
> Soft-Lockup warnings. Fix these by adding a cond_resched()
> to the mapping and unmapping loops.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>   virt/kvm/iommu.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
> index c1e6ae9..ac427e8 100644
> --- a/virt/kvm/iommu.c
> +++ b/virt/kvm/iommu.c

This file is already gone after one latest commit c274e03af705, "kvm: 
x86: move assigned-dev.c and iommu.c to arch/x86/" is introduced, so you 
need to pull your tree firstly :)

Tiejun


> @@ -137,7 +137,7 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
>
>   		gfn += page_size >> PAGE_SHIFT;
>
> -
> +		cond_resched();
>   	}
>
>   	return 0;
> @@ -311,6 +311,8 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
>   		kvm_unpin_pages(kvm, pfn, unmap_pages);
>
>   		gfn += unmap_pages;
> +
> +		cond_resched();
>   	}
>   }
>
>

  reply	other threads:[~2014-12-17  1:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 15:47 [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code Joerg Roedel
2014-12-17  1:38 ` Chen, Tiejun [this message]
2014-12-17 10:35   ` Joerg Roedel
2014-12-17 10:46     ` Paolo Bonzini
2014-12-17 10:50       ` Joerg Roedel

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=5490DEB1.30305@intel.com \
    --to=tiejun.chen@intel.com \
    --cc=gleb@kernel.org \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox