public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	Zachary Amsden <zamsden@redhat.com>
Subject: Re: [PATCH 2/2] KVM: Convert read-only users of vm_list to RCU
Date: Thu, 10 Feb 2011 14:47:39 +0100	[thread overview]
Message-ID: <4D53EC7B.3030903@siemens.com> (raw)
In-Reply-To: <4D53E5FB.5090109@redhat.com>

On 2011-02-10 14:19, Avi Kivity wrote:
> On 02/10/2011 03:14 PM, Jan Kiszka wrote:
>> On 2011-02-10 13:57, Avi Kivity wrote:
>>>  On 02/10/2011 02:56 PM, Avi Kivity wrote:
>>>>>  What's the benefit? The downside is a bit more complexity as you need an
>>>>>  additional callback handler.
>>>>
>>>>
>>>>  synchronize_rcu() can be very slow (its a systemwide operation), and
>>>>  mmu_shrink() can be called often on a loaded system.
>>>>
>>>
>>>  In fact this just shows that vm_list is not a good candidate for rcu;
>>>  rcu is useful where most operations are reads, but if we discount stats,
>>>  most operations on vm_list are going to be writes.
>>
>> Accept for mmu_shrink, which is write but not delete, thus works without
>> that slow synchronize_rcu.
> 
> I don't really see how you can implement list_move_rcu(), it has to be 
> atomic or other users will see a partial vm_list.

Right, even if we synchronized that step cleanly, rcu-protected users
could miss the moving vm during concurrent list walks.

What about using a separate mutex for protecting vm_list instead?
Unless I missed some detail, mmu_shrink should allow blocking.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-02-10 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4D512EF7.8040409@siemens.com>
2011-02-08 11:55 ` [PATCH 2/2] KVM: Convert read-only users of vm_list to RCU Jan Kiszka
2011-02-10 10:16   ` Avi Kivity
2011-02-10 11:31     ` Jan Kiszka
2011-02-10 12:34       ` Avi Kivity
2011-02-10 12:45         ` Jan Kiszka
2011-02-10 12:56           ` Avi Kivity
2011-02-10 12:57             ` Avi Kivity
2011-02-10 13:14               ` Jan Kiszka
2011-02-10 13:19                 ` Avi Kivity
2011-02-10 13:47                   ` Jan Kiszka [this message]
2011-02-10 14:26                     ` Avi Kivity
2011-02-10 14:34                       ` Jan Kiszka
2011-02-10 14:47                         ` Avi Kivity
2011-02-10 14:55                           ` Jan Kiszka
2011-02-15 12:32   ` Marcelo Tosatti
2011-02-15 14:08     ` Jan Kiszka

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=4D53EC7B.3030903@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=zamsden@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