[PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events

Marc Hartmayer posted 20 patches 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20240423180906.16164-1-mhartmay@linux.ibm.com
src/node_device/node_device_driver.h |   5 +-
src/util/virmdev.h                   |   4 +
src/conf/node_device_conf.c          |  10 +-
src/node_device/node_device_driver.c |  28 +-
src/node_device/node_device_udev.c   | 516 ++++++++++++++++++---------
src/test/test_driver.c               |  11 +-
src/util/virmdev.c                   |  20 ++
src/libvirt_private.syms             |   2 +
8 files changed, 398 insertions(+), 198 deletions(-)
[PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Marc Hartmayer 1 year, 9 months ago
When an udev event occurs for a mediated device (mdev) the mdev config data
requires an update via mdevctl as the udev event does not contain all config
data. This update needs to occur immediately and to be finished before the
libvirt nodedev event is issued to keep the API usage reliable.

Changelog:
v1->v2:
 + squashed old patches 3 and 17 (comments from Jonathon and Boris)
 + added r-b's from Jonathon and Boris
 + worked in comments from Jonathon to old patch 15
 + added comment why only one worker can currently be used
 + added patch `node_device_udev: remove incorrect G_GNUC_UNUSED`
RFCv1->v1:
 + removed some of my own s-o-b's that were accidentally inserted in the RFC
 + added r-b's from Boris and Jonathon
 + worked in comments from Boris and Jonathon, but I did not inline
   "nodeDeviceDefResetMdevActiveConfig" as I'm not sure whether this improves
   the readability
 + reworked patch "[RFC PATCH v1 11/15] node_device_udev: Use
   `stateShutdownPrepare` and `stateShutdownWait`"
 + reworked patch "node_device_udev: Use a worker pool for processing events and
   emitting nodedev event"
 + added patches:
   - node_device_udev: Move responsibility to release `(init|udev)Thread` to `udevEventDataDispose`
   - node_device_udev: Fix leak of mdevctlLock, udevThreadCond, and mdevCtlMonitor
   - node_device_udev: nodeStateShutdownPrepare: Disconnect the signals explicitly
   - node_device_udev: Pass the driver state as parameter in prepartion for the next commit
   - node_device_udev: Add support for `g_autoptr` to `udevEventData
   - node_device_udev: Pass the `udevEventData` via parameter and use refcounting

Boris Fiuczynski (3):
  nodedev: fix mdev add udev event data handling
  nodedev: immediate update of active config on udev events
  nodedev: reset active config data on udev remove event

Marc Hartmayer (17):
  node_device_udev: Set @def to NULL
  node_device_udev: Remove the timeout if the data is disposed
  node_device_udev: Test for mdevctlTimeout != -1
  node_device_udev: Don't take `mdevctlLock` for `mdevctl list` and add
    comments about locking
  node_device_udev: Take lock if `driver->privateData` is modified
  node_device_udev: Add prefix `udev` for udev related data
  node_device_udev: Inline `udevRemoveOneDevice`
  node_device_udev: Move responsibility to release `(init|udev)Thread`
    to `udevEventDataDispose`
  node_device_udev: Fix leak of mdevctlLock, udevThreadCond, and
    mdevCtlMonitors
  node_device_udev: Introduce and use `stateShutdownPrepare` and
    `stateShutdownWait`
  node_device_udev: nodeStateShutdownPrepare: Disconnect the signals
    explicitly
  node_device_udev: Pass the driver state as parameter in preparation
    for the next commit
  node_device_udev: Use a worker pool for processing events and emitting
    nodedev event
  node_device_udev: Make the code easier to read
  node_device_udev: Add support for `g_autoptr` to `udevEventData`
  node_device_udev: Pass the `udevEventData` via parameter and use
    refcounting
  node_device_udev: remove incorrect G_GNUC_UNUSED

 src/node_device/node_device_driver.h |   5 +-
 src/util/virmdev.h                   |   4 +
 src/conf/node_device_conf.c          |  10 +-
 src/node_device/node_device_driver.c |  28 +-
 src/node_device/node_device_udev.c   | 516 ++++++++++++++++++---------
 src/test/test_driver.c               |  11 +-
 src/util/virmdev.c                   |  20 ++
 src/libvirt_private.syms             |   2 +
 8 files changed, 398 insertions(+), 198 deletions(-)


base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
-- 
2.34.1
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Marc Hartmayer 1 year, 7 months ago
On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer <mhartmay@linux.ibm.com> wrote:
> When an udev event occurs for a mediated device (mdev) the mdev config data
> requires an update via mdevctl as the udev event does not contain all config
> data. This update needs to occur immediately and to be finished before the
> libvirt nodedev event is issued to keep the API usage reliable.
>

[…snip…]

>  src/test/test_driver.c               |  11 +-
>  src/util/virmdev.c                   |  20 ++
>  src/libvirt_private.syms             |   2 +
>  8 files changed, 398 insertions(+), 198 deletions(-)
>
>
> base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
> -- 
> 2.34.1
> _______________________________________________
> Devel mailing list -- devel@lists.libvirt.org
> To unsubscribe send an email to devel-leave@lists.libvirt.org

Polite ping. Should I rebase or how do we want to proceed with this
series?

-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Jonathon Jongsma 1 year, 7 months ago
On 6/13/24 6:13 AM, Marc Hartmayer wrote:
> On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer <mhartmay@linux.ibm.com> wrote:
>> When an udev event occurs for a mediated device (mdev) the mdev config data
>> requires an update via mdevctl as the udev event does not contain all config
>> data. This update needs to occur immediately and to be finished before the
>> libvirt nodedev event is issued to keep the API usage reliable.
>>
> 
> […snip…]
> 
>>   src/test/test_driver.c               |  11 +-
>>   src/util/virmdev.c                   |  20 ++
>>   src/libvirt_private.syms             |   2 +
>>   8 files changed, 398 insertions(+), 198 deletions(-)
>>
>>
>> base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
>> -- 
>> 2.34.1
>> _______________________________________________
>> Devel mailing list -- devel@lists.libvirt.org
>> To unsubscribe send an email to devel-leave@lists.libvirt.org
> 
> Polite ping. Should I rebase or how do we want to proceed with this
> series?
> 


My apologies. I thought I remembered reviewing this series and, looking 
back at the archives, it seems that I did. Do you just need somebody to 
push it upstream?

Thanks,
Jonathon
Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Boris Fiuczynski 1 year, 7 months ago
On 6/13/24 11:14 PM, Jonathon Jongsma wrote:
> On 6/13/24 6:13 AM, Marc Hartmayer wrote:
>> On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer 
>> <mhartmay@linux.ibm.com> wrote:
>>> When an udev event occurs for a mediated device (mdev) the mdev 
>>> config data
>>> requires an update via mdevctl as the udev event does not contain all 
>>> config
>>> data. This update needs to occur immediately and to be finished 
>>> before the
>>> libvirt nodedev event is issued to keep the API usage reliable.
>>>
>>
>> […snip…]
>>
>>>   src/test/test_driver.c               |  11 +-
>>>   src/util/virmdev.c                   |  20 ++
>>>   src/libvirt_private.syms             |   2 +
>>>   8 files changed, 398 insertions(+), 198 deletions(-)
>>>
>>>
>>> base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
>>> -- 
>>> 2.34.1
>>> _______________________________________________
>>> Devel mailing list -- devel@lists.libvirt.org
>>> To unsubscribe send an email to devel-leave@lists.libvirt.org
>>
>> Polite ping. Should I rebase or how do we want to proceed with this
>> series?
>>
> 
> 
> My apologies. I thought I remembered reviewing this series and, looking 
> back at the archives, it seems that I did. Do you just need somebody to 
> push it upstream?
> 
> Thanks,
> Jonathon
> 

Hi Jonathon,
I think Marc is looking for someone to push his series.
Seems like patches 2, 3 and 20 are missing your rb or did Marc forget to 
add them?
@Marc, could you send a rebased v3 since it seems the series no longer 
cleanly applies on master.

-- 
Mit freundlichen Grüßen/Kind regards
    Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Jonathon Jongsma 1 year, 7 months ago
On 6/18/24 6:33 AM, Boris Fiuczynski wrote:
> On 6/13/24 11:14 PM, Jonathon Jongsma wrote:
>> On 6/13/24 6:13 AM, Marc Hartmayer wrote:
>>> On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer 
>>> <mhartmay@linux.ibm.com> wrote:
>>>> When an udev event occurs for a mediated device (mdev) the mdev 
>>>> config data
>>>> requires an update via mdevctl as the udev event does not contain 
>>>> all config
>>>> data. This update needs to occur immediately and to be finished 
>>>> before the
>>>> libvirt nodedev event is issued to keep the API usage reliable.
>>>>
>>>
>>> […snip…]
>>>
>>>>   src/test/test_driver.c               |  11 +-
>>>>   src/util/virmdev.c                   |  20 ++
>>>>   src/libvirt_private.syms             |   2 +
>>>>   8 files changed, 398 insertions(+), 198 deletions(-)
>>>>
>>>>
>>>> base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
>>>> -- 
>>>> 2.34.1
>>>> _______________________________________________
>>>> Devel mailing list -- devel@lists.libvirt.org
>>>> To unsubscribe send an email to devel-leave@lists.libvirt.org
>>>
>>> Polite ping. Should I rebase or how do we want to proceed with this
>>> series?
>>>
>>
>>
>> My apologies. I thought I remembered reviewing this series and, 
>> looking back at the archives, it seems that I did. Do you just need 
>> somebody to push it upstream?
>>
>> Thanks,
>> Jonathon
>>
> 
> Hi Jonathon,
> I think Marc is looking for someone to push his series.
> Seems like patches 2, 3 and 20 are missing your rb or did Marc forget to 
> add them?
> @Marc, could you send a rebased v3 since it seems the series no longer 
> cleanly applies on master.
> 

For the v2 patch series I acked the cover letter for the series. So I'll 
just rebase and add my r-b to all of them and push. Sorry for the delay.

Jonathon
Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events
Posted by Marc Hartmayer 1 year, 7 months ago
On Tue, Jun 18, 2024 at 08:59 AM -0500, Jonathon Jongsma <jjongsma@redhat.com> wrote:
> On 6/18/24 6:33 AM, Boris Fiuczynski wrote:
>> On 6/13/24 11:14 PM, Jonathon Jongsma wrote:
>>> On 6/13/24 6:13 AM, Marc Hartmayer wrote:
>>>> On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer 
>>>> <mhartmay@linux.ibm.com> wrote:
>>>>> When an udev event occurs for a mediated device (mdev) the mdev 
>>>>> config data
>>>>> requires an update via mdevctl as the udev event does not contain 
>>>>> all config
>>>>> data. This update needs to occur immediately and to be finished 
>>>>> before the
>>>>> libvirt nodedev event is issued to keep the API usage reliable.
>>>>>
>>>>
>>>> […snip…]
>>>>
>>>>>   src/test/test_driver.c               |  11 +-
>>>>>   src/util/virmdev.c                   |  20 ++
>>>>>   src/libvirt_private.syms             |   2 +
>>>>>   8 files changed, 398 insertions(+), 198 deletions(-)
>>>>>
>>>>>
>>>>> base-commit: c38720b337f74337ec94c0fe2e97a7c2c57188ae
>>>>> -- 
>>>>> 2.34.1
>>>>> _______________________________________________
>>>>> Devel mailing list -- devel@lists.libvirt.org
>>>>> To unsubscribe send an email to devel-leave@lists.libvirt.org
>>>>
>>>> Polite ping. Should I rebase or how do we want to proceed with this
>>>> series?
>>>>
>>>
>>>
>>> My apologies. I thought I remembered reviewing this series and, 
>>> looking back at the archives, it seems that I did. Do you just need 
>>> somebody to push it upstream?
>>>
>>> Thanks,
>>> Jonathon
>>>
>> 
>> Hi Jonathon,
>> I think Marc is looking for someone to push his series.
>> Seems like patches 2, 3 and 20 are missing your rb or did Marc forget to 
>> add them?
>> @Marc, could you send a rebased v3 since it seems the series no longer 
>> cleanly applies on master.
>> 
>
> For the v2 patch series I acked the cover letter for the series. So I'll 
> just rebase and add my r-b to all of them and push. Sorry for the
> delay.

Thanks and no problems.

>
> Jonathon
>
-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294