login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
October
»
10
Re: [PATCH v6 10/12] Handle async PF in non preemptable context
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Gleb Natapov
Subject:
Re: [PATCH v6 10/12] Handle async PF in non preemptable context
Date: Sunday, October 10, 2010 - 7:25 am
On Wed, Oct 06, 2010 at 12:41:32PM +0200, Gleb Natapov wrote:
quoted text
> On Tue, Oct 05, 2010 at 04:51:50PM -0300, Marcelo Tosatti wrote: > > On Mon, Oct 04, 2010 at 05:56:32PM +0200, Gleb Natapov wrote: > > > If async page fault is received by idle task or when preemp_count is > > > not zero guest cannot reschedule, so do sti; hlt and wait for page to be > > > ready. vcpu can still process interrupts while it waits for the page to > > > be ready. > > > > > > Acked-by: Rik van Riel <riel@redhat.com> > > > Signed-off-by: Gleb Natapov <gleb@redhat.com> > > > --- > > > arch/x86/kernel/kvm.c | 40 ++++++++++++++++++++++++++++++++++------ > > > 1 files changed, 34 insertions(+), 6 deletions(-) > > > > > > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > > > index 36fb3e4..f73946f 100644 > > > --- a/arch/x86/kernel/kvm.c > > > +++ b/arch/x86/kernel/kvm.c > > > @@ -37,6 +37,7 @@ > > > #include <asm/cpu.h> > > > #include <asm/traps.h> > > > #include <asm/desc.h> > > > +#include <asm/tlbflush.h> > > > > > > #define MMU_QUEUE_SIZE 1024 > > > > > > @@ -78,6 +79,8 @@ struct kvm_task_sleep_node { > > > wait_queue_head_t wq; > > > u32 token; > > > int cpu; > > > + bool halted; > > > + struct mm_struct *mm; > > > }; > > > > > > static struct kvm_task_sleep_head { > > > @@ -106,6 +109,11 @@ void kvm_async_pf_task_wait(u32 token) > > > struct kvm_task_sleep_head *b = &async_pf_sleepers[key]; > > > struct kvm_task_sleep_node n, *e; > > > DEFINE_WAIT(wait); > > > + int cpu, idle; > > > + > > > + cpu = get_cpu(); > > > + idle = idle_cpu(cpu); > > > + put_cpu(); > > > > > > spin_lock(&b->lock); > > > e = _find_apf_task(b, token); > > > @@ -119,19 +127,33 @@ void kvm_async_pf_task_wait(u32 token) > > > > > > n.token = token; > > > n.cpu = smp_processor_id(); > > > + n.mm = current->active_mm; > > > + n.halted = idle || preempt_count() > 1; > > > + atomic_inc(&n.mm->mm_count); > > > > Can't see why this reference is needed. > I thought that if kernel thread does fault on behalf of some > process mm can go away while kernel thread is sleeping. But it looks > like kernel thread increase reference to mm it runs with by himself, so > may be this is redundant (but not harmful). >
Actually it is not redundant. Kernel thread will release reference to active_mm on reschedule. -- Gleb. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH v6 00/12] KVM: Add host swap event notifications fo ...
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 01/12] Add get_user_pages() variant that fails i ...
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 05/12] Move kvm_smp_prepare_boot_cpu() from kvmc ...
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 06/12] Add PV MSR to enable asynchronous page fa ...
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 10/12] Handle async PF in non preemptable context
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
[PATCH v6 12/12] Send async PF when guest is not in usersp ...
, Gleb Natapov
, (Mon Oct 4, 8:56 am)
Re: [PATCH v6 12/12] Send async PF when guest is not in us ...
, Rik van Riel
, (Mon Oct 4, 7:37 pm)
Re: [PATCH v6 10/12] Handle async PF in non preemptable co ...
, Marcelo Tosatti
, (Tue Oct 5, 12:51 pm)
Re: [PATCH v6 10/12] Handle async PF in non preemptable co ...
, Gleb Natapov
, (Wed Oct 6, 3:41 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Avi Kivity
, (Thu Oct 7, 5:42 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Avi Kivity
, (Thu Oct 7, 5:58 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Avi Kivity
, (Thu Oct 7, 6:10 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Thu Oct 7, 10:14 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Avi Kivity
, (Thu Oct 7, 10:18 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Rik van Riel
, (Thu Oct 7, 10:48 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Gleb Natapov
, (Thu Oct 7, 10:53 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Gleb Natapov
, (Thu Oct 7, 10:59 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Thu Oct 7, 11:03 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Avi Kivity
, (Sat Oct 9, 11:43 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Avi Kivity
, (Sat Oct 9, 11:48 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Sun Oct 10, 12:56 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Sun Oct 10, 5:32 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Avi Kivity
, (Sun Oct 10, 5:38 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Avi Kivity
, (Sun Oct 10, 5:40 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Avi Kivity
, (Sun Oct 10, 5:47 am)
Re: [PATCH v6 08/12] Handle async PF in a guest.
, Gleb Natapov
, (Sun Oct 10, 6:22 am)
Re: [PATCH v6 06/12] Add PV MSR to enable asynchronous pag ...
, Gleb Natapov
, (Sun Oct 10, 6:27 am)
Re: [PATCH v6 10/12] Handle async PF in non preemptable co ...
, Gleb Natapov
, (Sun Oct 10, 7:25 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer