All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, borntraeger@de.ibm.com, cotte@de.ibm.com,
	heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com
Subject: Re: [PATCH 3/3] kvm-s390: streamline memslot handling - rebased
Date: Mon, 15 Jun 2009 15:47:09 +0200	[thread overview]
Message-ID: <4A3650DD.8030905@linux.vnet.ibm.com> (raw)
In-Reply-To: <4A34E758.6000000@redhat.com>

Avi Kivity wrote:
> Marcelo Tosatti wrote:
>>  
>>> (continued below)
>>>    
>>>> Anyway, yeah, the set request / wait mechanism you implement here is
>>>> quite similar to the idea mentioned earlier that could be used for 
>>>> x86.
>>>>
>>>> Just get rid of this explicit KVM_REQ_MMU_RELOAD knowledge in
>>>> arch-independent code please (if you want to see this merged).
>>>>         
>>> I agree to lift the wait part to other archs later if needed, but 
>>> as  mentioned above I could move this to arch code to the cost of 
>>> one arch  hook more. But as also mentioned it doesn't really hurt. I 
>>> agree that it  does not need to be KVM_REQ_MMU_RELOAD specific, we 
>>> could just  walk/clear/wake all bits on that vcpu->requests variable.
>>> Would that be generic enough in your opinion ?
>>>     
>>
>> Don't know.
>>
>> Avi?
>>   
>
> I think I lost the thread here, but I'll try.  Isn't the wake part 
> make_all_vcpus_request() in kvm_main.c?  The wait part could be moved 
> to a similar generic function.
>
I'll try to summarize my current thoughts a bit:
The rebased patch series brings several fixes and the wait/wakeup 
mechanism which is in discussion here.
As explained before this keeps the new wait implementation in s390 arch 
code which allows us to experiment with it. Later if we are happy with 
it we might (or not) continue the merge and bring this mechanism to 
make_all_vcpus_request (as on x86 you don't have the issues I try to fix 
here we don't need to hurry bringing that into generic code).

Well now to the wait/wakeup which is here in discussion in detail:
The s390 arch code can kick a guest, but we don't know implicitly (as 
x86 does) that the kick succeeded, it might happen somewhen sooner or later.
Therefore the code uses wait_on_bit to wait until the vcpu->request bit 
is consumed.
To ensure cleanup of these waiting threads in some special cases the 
clear&wake up is also needed at other places than the real bit 
consumption. One of them is the vcpu release code where we should 
clear&wakeup all waiters (Marcelo correctly pointed out that we should 
not be bit specific there, so I just just wake up all in the updated code).

That was the discussion here: "if it would be ok to clear & wake up 
all". As wake_up_bit doesn't hurt if there is no waiter it looks like 
the best solution to to do that in the generic part of vcpu_release. If 
ever someone else waits for this or another bit in vcpu->requests, the 
code ensures all of them are awaken on vcpu release.

I send an updated version of the rebased series in a few minutes, 
containing updates related to what marcelo pointed out.

P.S. in case you think we need much more discussions we might try to 
catch up on irc to save this thread a few cycles :-)

-- 

Grüsse / regards, Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization 


      reply	other threads:[~2009-06-15 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 14:26 [PATCH 0/3] kvm-s390: revised version of kvm-s390 guest memory handling - rebased ehrhardt
2009-06-02 14:26 ` [PATCH 1/3] kvm-s390: infrastructure to kick vcpus out of guest state " ehrhardt
2009-06-02 14:26 ` [PATCH 2/3] kvm-s390: update vcpu->cpu " ehrhardt
2009-06-02 14:26 ` [PATCH 3/3] kvm-s390: streamline memslot handling " ehrhardt
2009-06-05 20:53   ` Marcelo Tosatti
2009-06-08 10:51     ` Christian Ehrhardt
2009-06-08 11:10       ` Avi Kivity
2009-06-08 12:05         ` Christian Ehrhardt
2009-06-08 12:09           ` Avi Kivity
2009-06-09  0:56       ` Marcelo Tosatti
2009-06-14 12:04         ` Avi Kivity
2009-06-15 13:47           ` Christian Ehrhardt [this message]

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=4A3650DD.8030905@linux.vnet.ibm.com \
    --to=ehrhardt@linux.vnet.ibm.com \
    --cc=avi@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=schwidefsky@de.ibm.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.