[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-ia64-devel][PATCH][VTD] small patches for VTD


  • To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
  • From: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
  • Date: Wed, 22 Oct 2008 14:30:50 +0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 21 Oct 2008 23:30:57 -0700
  • List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
  • Thread-index: Ack0DyRKnbaix1g9TxWL3uh1WY/dNgAABXCQ
  • Thread-topic: [Xen-ia64-devel][PATCH][VTD] small patches for VTD

Isaku Yamahata wrote:
> On Wed, Oct 22, 2008 at 02:11:52PM +0800, Xu, Anthony wrote:
>> Isaku Yamahata wrote:
>>> On Wed, Oct 22, 2008 at 01:56:05PM +0800, Xu, Anthony wrote:
>>>> Yes, it is not SMP-safe there is lock for p2m.
>>>> Modifying p2m is not a frequent operation, why not add a lock for
>>>> it?
>>>
>>> It is frequent to read p2m table. So lockless approach was adopted
>>> for scalability. It doesn't make sense to lock around only writer
>>> side.
>>>
>>
>> If only add write lock for p2m, is there any bad impact/senario?
>> Can you explain more details?
>
> Generally lock should protect both readers and writers.
> So locking around only writers doesn't make sense.


So you can use read/write lock, multiple reader one writer.
Because write is very rare, it will not impact performance, but it makes code 
in mm.c clear and easy to modify.
I think that's why read/write lock exist.


Anthony

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.