All of lore.kernel.org
 help / color / mirror / Atom feed
* Documentation of the kvm->srcu lock
@ 2013-09-09 12:00 Thomas Huth
  2013-09-09 12:13 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2013-09-09 12:00 UTC (permalink / raw)
  To: kvm


 Hi all!

I am quite new to KVM, and I recently had to struggle with the
kvm->srcu lock a little bit ... documentation for this lock seems
to be quite sparse, I've only found some descriptions in mailing
list archives (the description at the following URL is quite good:
http://www.mail-archive.com/kvm@vger.kernel.org/msg90003.html ).

So I wonder whether it would be helpful for others, too, if some
information about this lock was added to the documentation file
Documentation/virtual/kvm/locking.txt for example? I'd like to
suggest the following text as a first draft (using some information
from the URL above):

 Name:		kvm->srcu
 Type:		srcu lock
 Arch:		any
 Protects:	- kvm->memslots
 		- kvm->buses
 Comment:	The srcu read lock must be held while accessing memslots (e.g.
 		when using gfn_to_* functions) and while accessing in-kernel
 		MMIO/PIO address->device structure mapping (kvm->buses).
 		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
 		if it is needed by multiple functions.

What do you think? Since I am not an expert in this area, extension
and/or corrections are very welcome!

 Regards,
  Thomas


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Documentation of the kvm->srcu lock
  2013-09-09 12:00 Documentation of the kvm->srcu lock Thomas Huth
@ 2013-09-09 12:13 ` Paolo Bonzini
  2013-09-09 12:26   ` Xiao Guangrong
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2013-09-09 12:13 UTC (permalink / raw)
  To: Thomas Huth; +Cc: kvm, Xiao Guangrong

Il 09/09/2013 14:00, Thomas Huth ha scritto:
> 
>  Hi all!
> 
> I am quite new to KVM, and I recently had to struggle with the
> kvm->srcu lock a little bit ... documentation for this lock seems
> to be quite sparse, I've only found some descriptions in mailing
> list archives (the description at the following URL is quite good:
> http://www.mail-archive.com/kvm@vger.kernel.org/msg90003.html ).
> 
> So I wonder whether it would be helpful for others, too, if some
> information about this lock was added to the documentation file
> Documentation/virtual/kvm/locking.txt for example? I'd like to
> suggest the following text as a first draft (using some information
> from the URL above):
> 
>  Name:		kvm->srcu
>  Type:		srcu lock
>  Arch:		any
>  Protects:	- kvm->memslots
>  		- kvm->buses
>  Comment:	The srcu read lock must be held while accessing memslots (e.g.
>  		when using gfn_to_* functions) and while accessing in-kernel
>  		MMIO/PIO address->device structure mapping (kvm->buses).
>  		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
>  		if it is needed by multiple functions.
> 
> What do you think? Since I am not an expert in this area, extension
> and/or corrections are very welcome!

Yes, this looks good.  Xiao, any suggestions?

Paolo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Documentation of the kvm->srcu lock
  2013-09-09 12:13 ` Paolo Bonzini
@ 2013-09-09 12:26   ` Xiao Guangrong
  2013-09-09 12:47     ` Thomas Huth
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Guangrong @ 2013-09-09 12:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Thomas Huth, kvm

On 09/09/2013 08:13 PM, Paolo Bonzini wrote:
> Il 09/09/2013 14:00, Thomas Huth ha scritto:
>>
>>  Hi all!
>>
>> I am quite new to KVM, and I recently had to struggle with the
>> kvm->srcu lock a little bit ... documentation for this lock seems
>> to be quite sparse, I've only found some descriptions in mailing
>> list archives (the description at the following URL is quite good:
>> http://www.mail-archive.com/kvm@vger.kernel.org/msg90003.html ).
>>
>> So I wonder whether it would be helpful for others, too, if some
>> information about this lock was added to the documentation file
>> Documentation/virtual/kvm/locking.txt for example? I'd like to
>> suggest the following text as a first draft (using some information
>> from the URL above):
>>
>>  Name:		kvm->srcu
>>  Type:		srcu lock
>>  Arch:		any
>>  Protects:	- kvm->memslots
>>  		- kvm->buses
>>  Comment:	The srcu read lock must be held while accessing memslots (e.g.
>>  		when using gfn_to_* functions) and while accessing in-kernel
>>  		MMIO/PIO address->device structure mapping (kvm->buses).
>>  		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
>>  		if it is needed by multiple functions.
>>
>> What do you think? Since I am not an expert in this area, extension
>> and/or corrections are very welcome!
> 
> Yes, this looks good.  Xiao, any suggestions?

It's nice indeed! :)

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Documentation of the kvm->srcu lock
  2013-09-09 12:26   ` Xiao Guangrong
@ 2013-09-09 12:47     ` Thomas Huth
  2013-09-09 13:51       ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2013-09-09 12:47 UTC (permalink / raw)
  To: kvm; +Cc: Xiao Guangrong, Paolo Bonzini

Am Mon, 09 Sep 2013 20:26:49 +0800
schrieb Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>:

> On 09/09/2013 08:13 PM, Paolo Bonzini wrote:
> > Il 09/09/2013 14:00, Thomas Huth ha scritto:
> >>
> >>  Hi all!
> >>
> >> I am quite new to KVM, and I recently had to struggle with the
> >> kvm->srcu lock a little bit ... documentation for this lock seems
> >> to be quite sparse, I've only found some descriptions in mailing
> >> list archives (the description at the following URL is quite good:
> >> http://www.mail-archive.com/kvm@vger.kernel.org/msg90003.html ).
> >>
> >> So I wonder whether it would be helpful for others, too, if some
> >> information about this lock was added to the documentation file
> >> Documentation/virtual/kvm/locking.txt for example? I'd like to
> >> suggest the following text as a first draft (using some information
> >> from the URL above):
> >>
> >>  Name:		kvm->srcu
> >>  Type:		srcu lock
> >>  Arch:		any
> >>  Protects:	- kvm->memslots
> >>  		- kvm->buses
> >>  Comment:	The srcu read lock must be held while accessing memslots (e.g.
> >>  		when using gfn_to_* functions) and while accessing in-kernel
> >>  		MMIO/PIO address->device structure mapping (kvm->buses).
> >>  		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
> >>  		if it is needed by multiple functions.
> >>
> >> What do you think? Since I am not an expert in this area, extension
> >> and/or corrections are very welcome!
> > 
> > Yes, this looks good.  Xiao, any suggestions?
> 
> It's nice indeed! :)
> 
> Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>

Great :-) ... ok, can you then simply pick up the above text or shall I
submit a real patch for that file?

 Thomas


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Documentation of the kvm->srcu lock
  2013-09-09 12:47     ` Thomas Huth
@ 2013-09-09 13:51       ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-09-09 13:51 UTC (permalink / raw)
  To: Thomas Huth; +Cc: kvm, Xiao Guangrong

Il 09/09/2013 14:47, Thomas Huth ha scritto:
> Am Mon, 09 Sep 2013 20:26:49 +0800
> schrieb Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>:
> 
>> On 09/09/2013 08:13 PM, Paolo Bonzini wrote:
>>> Il 09/09/2013 14:00, Thomas Huth ha scritto:
>>>>
>>>>  Hi all!
>>>>
>>>> I am quite new to KVM, and I recently had to struggle with the
>>>> kvm->srcu lock a little bit ... documentation for this lock seems
>>>> to be quite sparse, I've only found some descriptions in mailing
>>>> list archives (the description at the following URL is quite good:
>>>> http://www.mail-archive.com/kvm@vger.kernel.org/msg90003.html ).
>>>>
>>>> So I wonder whether it would be helpful for others, too, if some
>>>> information about this lock was added to the documentation file
>>>> Documentation/virtual/kvm/locking.txt for example? I'd like to
>>>> suggest the following text as a first draft (using some information
>>>> from the URL above):
>>>>
>>>>  Name:		kvm->srcu
>>>>  Type:		srcu lock
>>>>  Arch:		any
>>>>  Protects:	- kvm->memslots
>>>>  		- kvm->buses
>>>>  Comment:	The srcu read lock must be held while accessing memslots (e.g.
>>>>  		when using gfn_to_* functions) and while accessing in-kernel
>>>>  		MMIO/PIO address->device structure mapping (kvm->buses).
>>>>  		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
>>>>  		if it is needed by multiple functions.
>>>>
>>>> What do you think? Since I am not an expert in this area, extension
>>>> and/or corrections are very welcome!
>>>
>>> Yes, this looks good.  Xiao, any suggestions?
>>
>> It's nice indeed! :)
>>
>> Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
> 
> Great :-) ... ok, can you then simply pick up the above text or shall I
> submit a real patch for that file?

Sending a patch would be appreciated.

Paolo


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-09 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 12:00 Documentation of the kvm->srcu lock Thomas Huth
2013-09-09 12:13 ` Paolo Bonzini
2013-09-09 12:26   ` Xiao Guangrong
2013-09-09 12:47     ` Thomas Huth
2013-09-09 13:51       ` Paolo Bonzini

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.