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

Re: [RFC PATCH] pci: introduce per-domain PCI rwlock


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 12 Jul 2023 11:09:12 +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=yBQplZJ/bBI+Ds3UBCsq/QIdWwTo2b0qGVSwh7iiGTI=; b=G8WTmcXMVOpbO+RZmjtynoIOPWdyLrSf81+TfHFtqE647B3Vxf+S0Kd+tYyheoKHktiLYrkSR4FSozS3uPOqz6D1zPn0LvrPoc0cn5KeQ2GPuIOvxNHqn2GROYmVgQjsy/x4F7mHGWw9H1nCe50u6ak7sKbtwySWklUEDp5nNWM/VoDDHjkMFwD37pdRvRO9aKNn/eYA/WbKCjwJRCRNJQ3jWgBDBd6hK4V2VBmIff36Y7bLt2I7YauFS0Z7JIkoK0G7sfCJsC5zU9dbWltJqPtlxG+ewAuPMjnYyfZrBhibn8otoxUqbX0BObzeHe7gk34ryXjApDIfQUGlTxHwKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJ2Fs0Re0laEhWB9s13xkRX73E35Ti5MV9Ig2K9fxjaSSTd95sw4lT08dh9OeTuZEBjkrLJ6c/e6R0mfrMfX0ZODrj35JhEAmzHYHsA5m6+QLVbwRtJbUMcsFKagCQ+/aACRbUY0qhtxIjebg6GRww95dY3K0glRihpPgalUgO7wSWOrfCafXO9UfOW/skLTEqzlsOiGkSFHFTQ2cgugmUPyrdgVGurni6yCRB2qdrML0CgDBugo3XLAVRxEa/qhiswh8R55aX8H/WQh7isZ8IkkOevrsztY9bcQ7oKDPnckB+T1F+o0f8Qu6fOeNSaOln63TqKuJzAUpDXAbslSKA==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 12 Jul 2023 11:11:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZs5ESsjHhLtlMU0qzCbDGds6cO6+0XLQAgABxyYCAAQ0QAIAAE50A
  • Thread-topic: [RFC PATCH] pci: introduce per-domain PCI rwlock

Hi Jan, Roger,

Jan Beulich <jbeulich@xxxxxxxx> writes:

> Up front remark: I'm sorry for some possibly unhelpful replies below. I,
> for one, am of the opinion that some of the issues you ask about are to
> be looked into by whoever wants / needs to rework the locking model.
> After all this (likely) is why nobody has dared to make an attempt before
> the need became apparent.

I have no great need desire or need to rework the locking model. I was
perfectly fine with much narrower vpci_lock. As you remember, it is
Roger who suggested to extend this lock to the include the whole PCI
device.

I already tried something like this as part of the another patch series:
"[RFC,01/10] xen: pci: add per-domain pci list lock" [1], with the same
result: it was considered very hard to do this properly, so I dropped
that effort. I am not so familiar with x86-specific code as a whole and
IOMMU drivers in particular to be 100% sure that I am doing correct
changes. Without support from x86 guys I can't do proper patches and
looks like x86 guys are not interested in this. So, this is dead end.

Roger, in [2] I proposed another approach to fix ABBA in modify_bars():
store copy of BARs in the domain structure. Taking into account that my
effort to introduce d->pci_lock basically failed (again), I am proposing
to return back to d->vpci_lock + BARs shadow copy in the domain
struct. What do you think? And you, Jan?

[1] 
https://lore.kernel.org/all/20220831141040.13231-2-volodymyr_babchuk@xxxxxxxx/
[2] https://lore.kernel.org/all/87ilbfnqmo.fsf@xxxxxxxx/

-- 
WBR, Volodymyr


 


Rackspace

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