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

Re: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Mon, 25 Sep 2023 23:03:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iEXxmJg5EQgBBvzYfEUV7jzNCS73zXwmqlx5gapiToI=; b=UJbBq1gpV6yEkXOVqyKlJJUepA5/LqaH8le0NpKChoKN33Ts05MpZ68hTxfjQPYqrw6Ut29L33k5nUbp0iVRgTYXSc+Vr4tSXmhgA5jwdiZUVHF9t6c9Uc9b1WjKFL2HeCcrcvFN9PomWNQUpxWCeaNYFSFyP0QioXkj3wDV4+192oVuZqH9/BqMvKll28fvricYr/H+Ln4eWhGKhCiJrYlsyUsnNC/2BcoMs/zordy4tHmcq7lWDwaJlf9bE3sJuSB6JhfrElGTzRRZV9uFp/FIUmsFMDqB+hYHRQHs1nr4knShFY4d/nQNIGvVjCgJ5azFfmOvtgescyRInfcXmg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9NdtKbN97PC/EHNLdAkHDEHg3BtvSXe9vQ0N3QXqQ6STZ26IIL3ry68H+++okMDw5U8Wt1m86OH6DnrmIWxRIPW/ZhfkQnGL5Pp/QNIJnsZmk7XKJ/jm5dWJqYyx9LfW9GvbKzHewKPfw5XMmIk0l+v5LrJtso+46YpMOhhXXKCWBIDX5q+YEwEOMTZxF9eKZ4T9NDh5y+J0n9JjeUW37K4+8Fqzw4Du3JxqWPVhc0iOA5vEp89+Kc+CfjUIy33OfJlZJ6iPQKVj+8JI7p7WQpIwNogijyypxAtz+JX1qFJU5Q+7SbNa98Jl6vF2JZLcBPYCFCJt0nRt9QXm1apuw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Mon, 25 Sep 2023 23:04:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZ2s9KfUsugiaE80OWAJ/SuT82fLAiaWIAgAnmCQA=
  • Thread-topic: [PATCH v9 02/16] vpci: use per-domain PCI lock to protect vpci structure

Hi Roger,

Roger Pau Monné <roger.pau@xxxxxxxxxx> writes:

> On Tue, Aug 29, 2023 at 11:19:42PM +0000, Volodymyr Babchuk wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>> 
>> Use a previously introduced per-domain read/write lock to check
>> whether vpci is present, so we are sure there are no accesses to the
>> contents of the vpci struct if not. This lock can be used (and in a
>> few cases is used right away) so that vpci removal can be performed
>> while holding the lock in write mode. Previously such removal could
>> race with vpci_read for example.
>> 
>> When taking both d->pci_lock and pdev->vpci->lock they are should be
>
> When taking both d->pci_lock and pdev->vpci->lock the order should be
> ...
>

>> taken in this exact order: d->pci_lock then pdev->vpci->lock to avoid
>> possible deadlock situations.
>>

Will it be better to write like this:

"When taking both d->pci_lock and pdev->vpci->lock, they should be
taken in this exact order: d->pci_lock then pdev->vpci->lock to avoid
possible deadlock situations."

?

I am asking because your suggestion leads to "When taking both
d->pci_lock and pdev->vpci->lock the order should be taken in this exact
order: ... "

[...]

As for other comments, I am taking into account your, Jan's and Stewart's
comments and reworking this patch.

-- 
WBR, Volodymyr

 


Rackspace

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