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

Re: [PATCH 5/5] xen/arm: smmuv1: Intelligent SMR allocation


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 16 Mar 2021 17:54:08 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l+MBN7cKfFPeJ9kNJiqi4ei7+ENVT3/uLQGPG91NxQ0=; b=BBNlSWCHALzvk6+vcK3pYM5cyRZNSWSyxW6JXqRf8GvCRr6Lor/Gkp/Vf5Vr8timdhE+fXsk6NblANnGuyDq1Sbo9Mn3Ynr8TERDH15zA+NaEcyXz3gpBtaCoLt/rImmiFcB575I2OhfJgwZv19LGu66WE8clGoxzUjJgM3zbjymejm0ijrwd5BGmj2bo2+26WBZU7je51R9ciBJUatPCah6Qg6ePymN3mofXno5fs3A24ScQqvCNwDD9rWRCM+Dkn7VUB01qMYnZIB8hoWjuWjm9fJr2J+j6ekh+mgdDjaQiFzfnsCnK8mwubUMEZT7IblIRDVbtzYbDiOW1V0rTg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iTx4Qoh+CPi4DewnDYaWTDUocXpYamXqtHidmVy3zHi5AkJA4mnB6ZY7gyotRpRpvCE/8YFt3M+mLtmUbiWT1yOtMnBODvTIilL+6GMO5aeFmyswjfnjhP576OECnTQpA+QVDXJiLvc9+5l8vIOb3DLziU2toZd0gItTMtcS9P8BccV8b+y0Jgn8m3k08RRUD5rvcD+8TG68Iq6i36/3pP7sjEmDImVkc6XW+ulXNtJnu5X8f5frdrU2zAziqHDDYpAZ1WrC2K8HbHIijG72rze29YO3iRL9PTpQ2oeDTtLywzoMrfFy9xkayMBpYzXv/IGdSncd7RYJTlYJtvFp7A==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 16 Mar 2021 17:54:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXFRE3FfFdAlAZ8Eu9+88zMBZ+gqqGwk6AgAAuSQA=
  • Thread-topic: [PATCH 5/5] xen/arm: smmuv1: Intelligent SMR allocation

Hello Julien,

> On 16 Mar 2021, at 3:08 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 09/03/2021 18:19, Rahul Singh wrote:
>> Backport 588888a7399db352d2b1a41c9d5b3bf0fd482390
>> "iommu/arm-smmu: Intelligent SMR allocation" from the Linux kernel
>> This patch fix the stream match conflict issue when two devices have the
>> same stream-id.
>> Only difference while applying this patch is to use spinlock in place of
>> mutex and move iommu_group_alloc(..) function call in
>> arm_smmu_add_device(..) function from the start of the function
>> to the end.
> 
> As you may remember the discussion on the SMMUv3 thread, replacing a spinlock 
> by a mutex has consequences. Can you explain why this is fine?
Yes, I remember the discussion on the SMMUv3 thread, replacing a spinlock with 
a mutex has consequences. 

I replaced the mutex with spinlock in the SMMUv1 code when we are configuring 
the SMMUv1 hardware arm_smmu_master_alloc_smes(..).

I think it is fine to use the spinlock in place of mutex in SMMUv1 where we are 
configuring the hardware via registers as compared to SMMUv3 where we are 
configuring the SMMUv3 hardware with Memory-based circular buffer queues. 
Configuring the hardware via queues might take a long time that why mutex is a 
good choice but if we are configuring the hardware via registers it is very 
fast.

Configuring the SMMUv1 with the register is very fast and there are no side 
effects of this if we use spinlock. Let me know your view on this.

Regards,
Rahul

> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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