[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: Mon, 22 Mar 2021 08:45:44 +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=NT0AObk4Ev3tKcCe1mU2Cya2/nyvJkUnm7haIPLQ4dA=; b=TBBDS6Vy7QzVsFa+3ZyL1uIIG+4ICxT9Ic855dSswJjK4qySLFLfWoUpcuC4+0xYQjp/A/GsC70fY8LeMaXkqFsPw4E7JrOCSlkM/XuIcN6sV14coAR4ioVC8pyMdf9wy01JvB5rivZliePEPX05Cg8torZCbVKmidkdQ1KYoKXERIu3PbABRTbcejo9yiNzut3MctmtjX63hhGGV4XSlsXrtpsIUqsXdnYJBfRWZnGEmbwhhksSQpwcRuQNIupuoPRLZ4F4AIVOU83lB8CF4pwp33Ja6lRewDbyQOmSdktoL5hz/qVusB/oVXFe+KvYeRNyKQp5q6JCPEV4mfL81w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NPH327ymgBCPwZhXs4OcfwHcLLgRfN9cKIJmQa3juBAM43uRXJG+rnY3+/WN1ki8eBSrO67g3RT/6y2uckz7KBrIj5o2+beJDFXRRDjFOnc8+EgDzke0G9koEKopZ/UGo6y/PtBWdJy/Z6jLKKLXl4Fr7tv/Aab77VFz0qOTSLEwqTYaN7zfbuCl//s7SdYiVp6jTVtniwYImJLeXQEQzGk2yX46HKUyjdrZzslBrSUrPSMDM4J15bXHznFPrUF5Xn0iDm92Z4nlH7YLK8m6lIzNwnX+pMa8rQgoxl90EI4QQGGd5wM2x/uSyhKFORiE5Tcy9u9vpnsZNDeLAw1dGw==
  • 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: Mon, 22 Mar 2021 08:46:08 +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+gqqGwk6AgAAuSQCABea+AIAC7gYA
  • Thread-topic: [PATCH 5/5] xen/arm: smmuv1: Intelligent SMR allocation

Hello Julien,

> On 20 Mar 2021, at 12:01 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 16/03/2021 17:54, Rahul Singh wrote:
>> Hello Julien,
> 
> Hi Rahul,
> 
>>> 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.
> 
> This looks fine. Can you explain it the commit message?

Yes, I will add the explanation in the commit message and will send the v2.

Regards,
Rahul
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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