* Re: qemu-kvm loops after kernel udpate
[not found] ` <5051AE8B.7090904@redhat.com>
@ 2012-09-18 19:40 ` Jiri Slaby
2012-09-18 19:46 ` Andrew Morton
2012-09-19 14:18 ` [PATCH] mm: call invalidate_range_end in do_wp_page even for zero pages Haggai Eran
0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2012-09-18 19:40 UTC (permalink / raw)
To: Avi Kivity
Cc: Jiri Slaby, Marcelo Tosatti, kvm, LKML, Haggai Eran,
Andrew Morton, linux-mm
On 09/13/2012 11:59 AM, Avi Kivity wrote:
> On 09/12/2012 09:11 PM, Jiri Slaby wrote:
>> On 09/12/2012 10:18 AM, Avi Kivity wrote:
>>> On 09/12/2012 11:13 AM, Jiri Slaby wrote:
>>>>
>>>>> Please provide the output of vmxcap
>>>>> (http://goo.gl/c5lUO),
>>>>
>>>> Unrestricted guest no
>>>
>>> The big real mode fixes.
>>>
>>>
>>>>
>>>>> and a snapshot of kvm_stat while the guest is hung.
>>>>
>>>> kvm statistics
>>>>
>>>> exits 6778198 615942
>>>> host_state_reload 1988 187
>>>> irq_exits 1523 138
>>>> mmu_cache_miss 4 0
>>>> fpu_reload 1 0
>>>
>>> Please run this as root so we get the tracepoint based output; and press
>>> 'x' when it's running so we get more detailed output.
>>
>> kvm statistics
>>
>> kvm_exit 13798699 330708
>> kvm_entry 13799110 330708
>> kvm_page_fault 13793650 330604
>> kvm_exit(EXCEPTION_NMI) 6188458 330604
>> kvm_exit(EXTERNAL_INTERRUPT) 2169 105
>> kvm_exit(TPR_BELOW_THRESHOLD) 82 0
>> kvm_exit(IO_INSTRUCTION) 6 0
>
> Strange, it's unable to fault in the very first page.
I bisected that. Note the bisection log. I have never seen something
like that :D:
git bisect start
git bisect bad 3de9d1a1500472bc80478bd75e33fa9c1eba1422
git bisect good fea7a08acb13524b47711625eebea40a0ede69a0
git bisect good 95a2fe4baa1ad444df5f94bfc9416fc6b4b34cef
git bisect good f42c0d57a5a60da03c705bdea9fbba381112dd60
git bisect good 31a2e241a9e37a133278959044960c229acc5714
git bisect good f15fb01c5593fa1b58cc7a8a9c59913e2625bf2e
git bisect good 16d21ff46f5d50e311d07406c31f96916e5e8e1a
git bisect good 0b84592f458b4e8567aa7d803aff382c1d3b64fd
git bisect bad b955428e7f14cd29fe9d8059efa3ea4be679c83d
git bisect bad 20c4da4f68fcade05eda9c9b7dbad0a78cc5efe8
git bisect bad 31b90ed2a90f80fb528ac55ee357a815e1dedc36
git bisect bad b273fe14ee5b38cecc7bce94f7777f35a0bf9ee4
git bisect bad de426dbe9a60706b91b40397f69f819a39a06b6b
git bisect bad 6b998094ec50248e72b9f251d0607b58b18dba38
git bisect bad cf9b81d47a89f5d404a0cd8013b461617751e520
=== 8< ===
Reverting cf9b81d47a89 (mm: wrap calls to set_pte_at_notify with
invalidate_range_start and invalidate_range_end) on the top of today's
-next fixes the issue.
thanks,
--
js
suse labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: qemu-kvm loops after kernel udpate
2012-09-18 19:40 ` qemu-kvm loops after kernel udpate Jiri Slaby
@ 2012-09-18 19:46 ` Andrew Morton
2012-09-19 0:00 ` Stephen Rothwell
2012-09-19 14:18 ` [PATCH] mm: call invalidate_range_end in do_wp_page even for zero pages Haggai Eran
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2012-09-18 19:46 UTC (permalink / raw)
To: Jiri Slaby
Cc: Avi Kivity, Jiri Slaby, Marcelo Tosatti, kvm, LKML, Haggai Eran,
linux-mm, Sagi Grimberg, Shachar Raindel, Liran Liss
On Tue, 18 Sep 2012 21:40:31 +0200
Jiri Slaby <jslaby@suse.cz> wrote:
> On 09/13/2012 11:59 AM, Avi Kivity wrote:
> > On 09/12/2012 09:11 PM, Jiri Slaby wrote:
> >> On 09/12/2012 10:18 AM, Avi Kivity wrote:
> >>> On 09/12/2012 11:13 AM, Jiri Slaby wrote:
> >>>>
> >>>>> Please provide the output of vmxcap
> >>>>> (http://goo.gl/c5lUO),
> >>>>
> >>>> Unrestricted guest no
> >>>
> >>> The big real mode fixes.
> >>>
> >>>
> >>>>
> >>>>> and a snapshot of kvm_stat while the guest is hung.
> >>>>
> >>>> kvm statistics
> >>>>
> >>>> exits 6778198 615942
> >>>> host_state_reload 1988 187
> >>>> irq_exits 1523 138
> >>>> mmu_cache_miss 4 0
> >>>> fpu_reload 1 0
> >>>
> >>> Please run this as root so we get the tracepoint based output; and press
> >>> 'x' when it's running so we get more detailed output.
> >>
> >> kvm statistics
> >>
> >> kvm_exit 13798699 330708
> >> kvm_entry 13799110 330708
> >> kvm_page_fault 13793650 330604
> >> kvm_exit(EXCEPTION_NMI) 6188458 330604
> >> kvm_exit(EXTERNAL_INTERRUPT) 2169 105
> >> kvm_exit(TPR_BELOW_THRESHOLD) 82 0
> >> kvm_exit(IO_INSTRUCTION) 6 0
> >
> > Strange, it's unable to fault in the very first page.
>
> I bisected that. Note the bisection log. I have never seen something
> like that :D:
> git bisect start
> git bisect bad 3de9d1a1500472bc80478bd75e33fa9c1eba1422
> git bisect good fea7a08acb13524b47711625eebea40a0ede69a0
> git bisect good 95a2fe4baa1ad444df5f94bfc9416fc6b4b34cef
> git bisect good f42c0d57a5a60da03c705bdea9fbba381112dd60
> git bisect good 31a2e241a9e37a133278959044960c229acc5714
> git bisect good f15fb01c5593fa1b58cc7a8a9c59913e2625bf2e
> git bisect good 16d21ff46f5d50e311d07406c31f96916e5e8e1a
> git bisect good 0b84592f458b4e8567aa7d803aff382c1d3b64fd
> git bisect bad b955428e7f14cd29fe9d8059efa3ea4be679c83d
> git bisect bad 20c4da4f68fcade05eda9c9b7dbad0a78cc5efe8
> git bisect bad 31b90ed2a90f80fb528ac55ee357a815e1dedc36
> git bisect bad b273fe14ee5b38cecc7bce94f7777f35a0bf9ee4
> git bisect bad de426dbe9a60706b91b40397f69f819a39a06b6b
> git bisect bad 6b998094ec50248e72b9f251d0607b58b18dba38
> git bisect bad cf9b81d47a89f5d404a0cd8013b461617751e520
>
> === 8< ===
>
> Reverting cf9b81d47a89 (mm: wrap calls to set_pte_at_notify with
> invalidate_range_start and invalidate_range_end) on the top of today's
> -next fixes the issue.
hm, thanks. This will probably take some time to resolve so I think
I'll drop
mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock.patch
mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix.patch
mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix-fix.patch
mm-wrap-calls-to-set_pte_at_notify-with-invalidate_range_start-and-invalidate_range_end.patch
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: qemu-kvm loops after kernel udpate
2012-09-18 19:46 ` Andrew Morton
@ 2012-09-19 0:00 ` Stephen Rothwell
2012-09-19 0:20 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2012-09-19 0:00 UTC (permalink / raw)
To: Andrew Morton
Cc: Jiri Slaby, Avi Kivity, Jiri Slaby, Marcelo Tosatti, kvm, LKML,
Haggai Eran, linux-mm, Sagi Grimberg, Shachar Raindel,
Liran Liss
[-- Attachment #1: Type: text/plain, Size: 721 bytes --]
Hi Andrew,
On Tue, 18 Sep 2012 12:46:46 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> hm, thanks. This will probably take some time to resolve so I think
> I'll drop
>
> mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock.patch
> mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix.patch
> mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix-fix.patch
> mm-wrap-calls-to-set_pte_at_notify-with-invalidate_range_start-and-invalidate_range_end.patch
Should I attempt to remove these from the akpm tree in linux-next today?
Or should I just wait for a new mmotm?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: qemu-kvm loops after kernel udpate
2012-09-19 0:00 ` Stephen Rothwell
@ 2012-09-19 0:20 ` Andrew Morton
2012-09-19 1:36 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2012-09-19 0:20 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Jiri Slaby, Avi Kivity, Jiri Slaby, Marcelo Tosatti, kvm, LKML,
Haggai Eran, linux-mm, Sagi Grimberg, Shachar Raindel,
Liran Liss
On Wed, 19 Sep 2012 10:00:34 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Andrew,
>
> On Tue, 18 Sep 2012 12:46:46 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > hm, thanks. This will probably take some time to resolve so I think
> > I'll drop
> >
> > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock.patch
> > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix.patch
> > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix-fix.patch
> > mm-wrap-calls-to-set_pte_at_notify-with-invalidate_range_start-and-invalidate_range_end.patch
>
> Should I attempt to remove these from the akpm tree in linux-next today?
That would be best - there's no point in having people test (and debug)
dead stuff.
> Or should I just wait for a new mmotm?
You could be brave and test http://ozlabs.org/~akpm/mmots/ for me :)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: qemu-kvm loops after kernel udpate
2012-09-19 0:20 ` Andrew Morton
@ 2012-09-19 1:36 ` Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2012-09-19 1:36 UTC (permalink / raw)
To: Andrew Morton
Cc: Jiri Slaby, Avi Kivity, Jiri Slaby, Marcelo Tosatti, kvm, LKML,
Haggai Eran, linux-mm, Sagi Grimberg, Shachar Raindel,
Liran Liss
[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]
Hi Andrew,
On Tue, 18 Sep 2012 17:20:29 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Wed, 19 Sep 2012 10:00:34 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > On Tue, 18 Sep 2012 12:46:46 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> > >
> > > hm, thanks. This will probably take some time to resolve so I think
> > > I'll drop
> > >
> > > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock.patch
> > > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix.patch
> > > mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix-fix.patch
> > > mm-wrap-calls-to-set_pte_at_notify-with-invalidate_range_start-and-invalidate_range_end.patch
> >
> > Should I attempt to remove these from the akpm tree in linux-next today?
>
> That would be best - there's no point in having people test (and debug)
> dead stuff.
OK, I removed them.
> > Or should I just wait for a new mmotm?
>
> You could be brave and test http://ozlabs.org/~akpm/mmots/ for me :)
Brave? maybe. Stupid? no :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] mm: call invalidate_range_end in do_wp_page even for zero pages
2012-09-18 19:40 ` qemu-kvm loops after kernel udpate Jiri Slaby
2012-09-18 19:46 ` Andrew Morton
@ 2012-09-19 14:18 ` Haggai Eran
1 sibling, 0 replies; 6+ messages in thread
From: Haggai Eran @ 2012-09-19 14:18 UTC (permalink / raw)
To: Jiri Slaby
Cc: linux-kernel, kvm, linux-mm, Shachar Raindel, Haggai Eran,
Avi Kivity, Andrew Morton
The previous patch "mm: wrap calls to set_pte_at_notify with
invalidate_range_start and invalidate_range_end" only called the
invalidate_range_end mmu notifier function in do_wp_page when the new_page
variable wasn't NULL. This was done in order to only call invalidate_range_end
after invalidate_range_start was called. Unfortunately, there are situations
where new_page is NULL and invalidate_range_start is called. This caused
invalidate_range_start to be called without a matching invalidate_range_end,
causing kvm to loop indefinitely on the first page fault.
This patch adds a flag variable to do_wp_page that marks whether the
invalidate_range_start notifier was called. invalidate_range_end is then
called if the flag is true.
Reported-by: Jiri Slaby <jslaby@suse.cz>
Cc: Avi Kivity <avi@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
---
I tested this patch against yesterday's linux-next (next-20120918), and it
seems to solve the problem with kvm. I used the same command line you reported:
qemu-kvm -k en-us -usbdevice tablet -balloon virtio -hda IMAGE -smp 2 \
-m 1000M -net user -net nic,model=e1000 -usb -serial pty
I was hoping you could also test it yourself, and see that it also works for
you, if you don't mind.
mm/memory.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 1a92d87..76ec199 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2529,6 +2529,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
struct page *dirty_page = NULL;
unsigned long mmun_start; /* For mmu_notifiers */
unsigned long mmun_end; /* For mmu_notifiers */
+ bool mmun_called = false; /* For mmu_notifiers */
old_page = vm_normal_page(vma, address, orig_pte);
if (!old_page) {
@@ -2706,8 +2707,9 @@ gotten:
if (mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))
goto oom_free_new;
- mmun_start = address & PAGE_MASK;
- mmun_end = (address & PAGE_MASK) + PAGE_SIZE;
+ mmun_start = address & PAGE_MASK;
+ mmun_end = (address & PAGE_MASK) + PAGE_SIZE;
+ mmun_called = true;
mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
/*
@@ -2776,8 +2778,7 @@ gotten:
page_cache_release(new_page);
unlock:
pte_unmap_unlock(page_table, ptl);
- if (new_page)
- /* Only call the end notifier if the begin was called. */
+ if (mmun_called)
mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
if (old_page) {
/*
--
1.7.11.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-19 14:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <504F7ED8.1030702@suse.cz>
[not found] ` <20120911190303.GA3626@amt.cnet>
[not found] ` <504F93F1.2060005@suse.cz>
[not found] ` <50504299.2050205@redhat.com>
[not found] ` <50504439.3050700@suse.cz>
[not found] ` <5050453B.6040702@redhat.com>
[not found] ` <5050D048.4010704@suse.cz>
[not found] ` <5051AE8B.7090904@redhat.com>
2012-09-18 19:40 ` qemu-kvm loops after kernel udpate Jiri Slaby
2012-09-18 19:46 ` Andrew Morton
2012-09-19 0:00 ` Stephen Rothwell
2012-09-19 0:20 ` Andrew Morton
2012-09-19 1:36 ` Stephen Rothwell
2012-09-19 14:18 ` [PATCH] mm: call invalidate_range_end in do_wp_page even for zero pages Haggai Eran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox